⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barcodepdf417.cs

📁 C# 製做的PDF417二維條碼生成程序,可根據輸入的資料自動生成二維條碼
💻 CS
📖 第 1 页 / 共 5 页
字号:
		{			int theInt32_2;			int theInt32_1;			theInt32_1 = 0;			theInt32_2 = (this.m_SecurityLevel + 1);			switch (theInt32_2)			{				case 0:				{					return ((int) BarcodePDF417.coef0[index]);				}				case 1:				{					return ((int) BarcodePDF417.coef1[index]);				}				case 2:				{					return ((int) BarcodePDF417.coef2[index]);				}				case 3:				{					return ((int) BarcodePDF417.coef3[index]);				}				case 4:				{					return ((int) BarcodePDF417.coef4[index]);				}				case 5:				{					return ((int) BarcodePDF417.coef5[index]);				}				case 6:				{					return ((int) BarcodePDF417.coef6[index]);				}				case 7:				{					return ((int) BarcodePDF417.coef7[index]);				}				case 8:				{					return ((int) BarcodePDF417.coef8[index]);				}			}			return theInt32_1;		}				private void CreateEC ()				{			int theInt32_6;			int theInt32_5;			int theInt32_4;			int theInt32_3;			int theInt32_2;			int theInt32_1;			theInt32_1 = 1;			theInt32_2 = 0;			for (theInt32_2 = 0; (theInt32_2 <= (this.m_SecurityLevel + 1)); theInt32_2 += 1)			{				theInt32_1 *= 2;			}			for (theInt32_2 = 0; (theInt32_2 < theInt32_1); theInt32_2 += 1)			{				this.m_ECCodes[theInt32_2] = 0;			}			for (theInt32_2 = 0; (theInt32_2 <= ((((int) this.m_CountAferEncode) - theInt32_1) - 1)); theInt32_2 += 1)			{				theInt32_3 = ((((int) this.m_EncodedData[theInt32_2]) + ((int) this.m_ECCodes[(theInt32_1 - 1)])) % 929);				for (theInt32_6 = (theInt32_1 - 1); (theInt32_6 >= 1); theInt32_6--)				{					theInt32_4 = ((theInt32_3 * this.FindCoef (theInt32_6)) % 929);					theInt32_5 = (929 - theInt32_4);					this.m_ECCodes[theInt32_6] = ((ushort) ((((int) this.m_ECCodes[(theInt32_6 - 1)]) + theInt32_5) % 929));				}				theInt32_4 = ((theInt32_3 * this.FindCoef (0)) % 929);				theInt32_5 = (929 - theInt32_4);				this.m_ECCodes[0] = ((ushort) (theInt32_5 % 929));			}			for (theInt32_2 = (theInt32_1 - 1); (theInt32_2 >= 0); theInt32_2--)			{				if (((int) this.m_ECCodes[theInt32_2]) != 0)				{					this.m_ECCodes[theInt32_2] = ((ushort) (929 - ((int) this.m_ECCodes[theInt32_2])));				}			}			for (theInt32_2 = 0; (theInt32_2 < theInt32_1); theInt32_2 += 1)			{				this.m_EncodedData[((((int) this.m_CountAferEncode) - theInt32_1) + theInt32_2)] = this.m_ECCodes[((theInt32_1 - theInt32_2) - 1)];			}		}				private int[] PDF417_compact_text (byte[] bytes, int[] controlBlock, int datacols)				{			int theInt32_17;			int theInt32_16;			int[] theInt32Array2;			int theInt32_15;			int theInt32_14;			int theInt32_13;			int theInt32_12;			byte theByte1;			int theInt32_11;			int theInt32_10;			bool theBoolean1;			int theInt32_9;			int theInt32_8;			int[] theInt32Array1;			int theInt32_7;			int theInt32_6;			int theInt32_5;			string theString3;			int theInt32_4;			int theInt32_3;			string theString2;			string theString1;			int theInt32_2;			int theInt32_1;			theInt32_1 = ((int) Math.Pow (2D, ((double) (this.m_SecurityLevel + 1))));			theInt32_2 = 0;			theString1 = "A";			theString2 = "A";			theInt32_3 = 0;			theInt32_4 = 0;			theString3 = "A";			if ((datacols < 1) || (datacols > 30))			{				datacols = 1;			}			theInt32_5 = 0;			theInt32_6 = 928;			theInt32_7 = 928;			if (this.m_Rows > 90)			{				this.m_Rows = 90;			}			if (this.m_Rows > 0)			{				theInt32_6 = (datacols * this.m_Rows);			}			theInt32_7 = ((theInt32_6 - theInt32_1) - controlBlock.Length);			theInt32Array1 = new int[((uint) (1000 + (bytes.Length * 3)))];			theInt32_8 = theInt32_5;			theInt32_9 = 0;			theBoolean1 = false;			theInt32_10 = 0;			theInt32_11 = 0;					L_00A3:			if (theInt32_8 < bytes.Length)			{				theInt32_10 = theInt32_8;				theInt32_11 = theInt32_9;				theByte1 = bytes[theInt32_8];				theInt32_3 = this.findChar (theByte1.ToString ());				theInt32_8 += 1;				if (theInt32_3 >= 0)				{					if ((theString3.CompareTo ("B") == 0) && (theString1.CompareTo ("A") == 0))					{						theString1 = "B";					}					theString2 = BarcodePDF417.textCodes[theInt32_3, 1];					theInt32_4 = int.Parse (theString2.Substring (1, (theString2.Length - 1)));					theString2 = theString2.Substring (0, 1);					theBoolean1 = false;					if (theString2.CompareTo (theString1) == 0)					{						theInt32Array1[theInt32_9++] = theInt32_4;						theBoolean1 = true;					}					if ((theString2.CompareTo ("D") == 0) && (! theBoolean1))					{						theInt32Array1[theInt32_9++] = 29;						theInt32Array1[theInt32_9++] = theInt32_4;						theBoolean1 = true;					}					if (((theString2.CompareTo ("C") == 0) && (theString1.CompareTo ("C") != 0)) && (! theBoolean1))					{						theInt32Array1[theInt32_9++] = 28;						theInt32Array1[theInt32_9++] = theInt32_4;						theBoolean1 = true;						theString1 = "C";					}					if (((theString2.CompareTo ("B") == 0) && (theString1.CompareTo ("B") != 0)) && (! theBoolean1))					{						theInt32Array1[theInt32_9++] = 27;						theInt32Array1[theInt32_9++] = theInt32_4;						theBoolean1 = true;						theString1 = "B";						theString3 = "B";					}					if (((theString2.CompareTo ("A") == 0) && (theString1.CompareTo ("A") != 0)) && (! theBoolean1))					{						if (theString1.CompareTo ("B") == 0)						{							theInt32Array1[theInt32_9++] = 27;						}						if (theString1.CompareTo ("C") == 0)						{							theInt32Array1[theInt32_9++] = 28;							theString3 = "A";						}						theInt32Array1[theInt32_9++] = theInt32_4;						theBoolean1 = true;						theString1 = "A";					}				}				if (Math.Ceiling (((double) ((theInt32_9 / 2) + 1))) < ((double) theInt32_7))				{					goto L_00A3;				}			}			theInt32_8 = theInt32_10;			theInt32_9 = theInt32_11;			if ((theInt32_9 % 2) != 0)			{				theInt32Array1[theInt32_9++] = 29;			}			theInt32_2 = ((((theInt32_9 / 2) + 1) + theInt32_1) + controlBlock.Length);			theInt32_12 = ((theInt32_9 / 2) + 1);			theInt32_13 = (theInt32_2 / datacols);			if ((theInt32_2 % datacols) != 0)			{				theInt32_13 += 1;			}			if (theInt32_13 < 3)			{				theInt32_13 = 3;			}			if (theInt32_13 > 90)			{				return null;			}			else			{				if (theInt32_13 > this.m_Rows)				{					this.m_RuntimeRows = ((short) theInt32_13);				}				else				{					theInt32_13 = ((int) this.m_Rows);					this.m_RuntimeRows = this.m_Rows;				}				theInt32_2 = (theInt32_13 * datacols);				if (theInt32_2 > 928)				{					return null;				}				else				{					theInt32_14 = (((theInt32_2 - theInt32_1) - controlBlock.Length) - theInt32_12);					for (theInt32_15 = 0; (theInt32_15 < theInt32_14); theInt32_15 += 1)					{						theInt32Array1[theInt32_9++] = 30;						theInt32Array1[theInt32_9++] = 0;					}					theInt32Array2 = new int[((uint) theInt32_2)];					theInt32Array2[0] = ((theInt32_2 - theInt32_1) - controlBlock.Length);					for (theInt32_16 = 1; (theInt32_16 <= theInt32_9); theInt32_16 += 1)					{						if (((theInt32_16 - 1) % 2) != 0)						{							theInt32Array2[(theInt32_16 / 2)] = ((theInt32Array2[(((theInt32_16 - 1) / 2) + 1)] * 30) + theInt32Array1[(theInt32_16 - 1)]);						}						else						{							theInt32Array2[(((theInt32_16 - 1) / 2) + 1)] = theInt32Array1[(theInt32_16 - 1)];						}					}					for (theInt32_17 = 0; (theInt32_17 < controlBlock.Length); theInt32_17 += 1)					{						theInt32Array2[(((theInt32_2 - theInt32_1) - controlBlock.Length) + theInt32_17)] = controlBlock[theInt32_17];					}					return theInt32Array2;				}			}		}				private int[] PDF417_compact_numeric (byte[] bytes, int[] controlBlock, int datacols)				{			int theInt32_14;			int[] theInt32Array3;			int theInt32_13;			int theInt32_12;			int theInt32_11;			int theInt32_10;			long theInt64_1;			byte theByte1;			int theInt32_9;			string theString1;			int theInt32_8;			int theInt32_7;			int theInt32_6;			int theInt32_5;			int[] theInt32Array2;			int[] theInt32Array1;			int theInt32_4;			int theInt32_3;			int theInt32_2;			int theInt32_1;			theInt32_1 = ((int) Math.Pow (2D, ((double) (this.m_SecurityLevel + 1))));			theInt32_2 = 0;			if ((datacols < 1) || (datacols > 30))			{				datacols = 1;			}			theInt32_3 = 928;			theInt32_4 = 928;			if (this.m_Rows > 90)			{				this.m_Rows = 90;			}			if (this.m_Rows > 0)			{				theInt32_3 = (datacols * this.m_Rows);			}			theInt32_4 = ((theInt32_3 - theInt32_1) - controlBlock.Length);			if ((datacols < 1) || (datacols > 30))			{				datacols = 1;			}			theInt32Array1 = new int[((uint) bytes.Length)];			theInt32Array2 = new int[30];			theInt32_5 = theInt32_2;			theInt32_6 = 2;			theInt32_7 = theInt32_5;			theInt32_8 = 0;					L_013A:			if (theInt32_5 < bytes.Length)			{				theString1 = "1";				theInt32_7 = theInt32_5;				theInt32_9 = 0;				while ((theInt32_9 < 44) && (theInt32_5 < bytes.Length))				{					theByte1 = bytes[theInt32_5];					theString1 = (theString1 + theByte1.ToString ());					theInt32_9 += 1;					theInt32_5 += 1;				}				theInt64_1 = long.Parse (theString1);				theInt32_10 = 0;				while (theInt64_1 != ((long) 0))				{					theInt32Array2[theInt32_10++] = ((int) (theInt64_1 % ((long) 900)));					theInt64_1 /= 900L;				}				if ((theInt32_6 + theInt32_10) <= theInt32_4)				{					for (theInt32_11 = 1; (theInt32_11 <= theInt32_10); theInt32_11 += 1)					{						theInt32Array1[theInt32_6++] = theInt32Array2[(theInt32_10 - theInt32_11)];						theInt32_8 += 1;					}					goto L_013A;				}				theInt32_5 = theInt32_7;			}			theInt32_8 = (((theInt32_8 + 2) + theInt32_1) + controlBlock.Length);			theInt32_12 = (theInt32_8 / datacols);			if ((theInt32_8 % datacols) != 0)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -