private void EncodeTextCompleteString(string text) { TextMode textMode = new TextMode(); text = PDF417.ValidateText(text); this.encodedRawData.AddRange((IEnumerable <long>)textMode.EncodeData(text, false)); }
internal TextModeDefinitionEntry GetNextValidCharacter( string remainingData) { TextModeDefinitionEntry characterInTable = TextMode.FindCharacterInTable((int)remainingData[0]); if (characterInTable != null || remainingData.Length <= 1) { return(characterInTable); } remainingData = remainingData.Substring(1); return(this.GetNextValidCharacter(remainingData)); }
private static string ValidateText(string text) { string empty = string.Empty; for (int index = 0; index < text.Length; ++index) { if (TextMode.FindCharacterInTable((int)text[index]) != null) { empty += (string)(object)text[index]; } } return(empty); }
private void EncodeText(string text, ref int dataIndex, int numberOfTexModeCharsAtPosition) { TextMode textMode = new TextMode(); int startIndex = dataIndex + numberOfTexModeCharsAtPosition; bool shouldApplyNonLatchData = false; if (startIndex < text.Length - 1) { PDF417.DetermineNextMode(text.Substring(startIndex), ref shouldApplyNonLatchData); } this.encodedRawData.Add(900L); this.encodedRawData.AddRange((IEnumerable <long>)textMode.EncodeData(text.Substring(dataIndex, numberOfTexModeCharsAtPosition), shouldApplyNonLatchData)); dataIndex += numberOfTexModeCharsAtPosition; }
internal void PadData(bool shouldApplyNonLatchData) { if (shouldApplyNonLatchData) { if (this.CurrentSymbolSubmode != TextSubMode.Punctuation) { this.formattedDataInt.Add((long)TextMode.FindCharacterInTable(1006).RowIndex); } else { this.formattedDataInt.Add((long)TextMode.FindCharacterInTable(1001).RowIndex); } } else { this.formattedDataInt.Add((long)TextMode.FindCharacterInTable(1005).RowIndex); } }
private static int GetNumberOfCharsAtPosition(string text, int currentPosition) { int num = 0; while (currentPosition <= text.Length - 1 && PDF417.GetNumberOfDigitsAtPosition(text, currentPosition) < 13 && TextMode.FindCharacterInTable((int)text[currentPosition]) != null) { ++currentPosition; ++num; } return(num); }