We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is an error when try to fill the Acrobat Form. Attached the templates and the results after filled.
iTextSharp.LGPLv2.Core version: 1.7.5 .NET Core SDK version: .Net Standard 2.0 IDE: VS 2019
var workStream = new MemoryStream(); var reader = new PdfReader(@"R:\\template.pdf"); var stamper = new PdfStamper(reader, workStream); stamper.AcroFields.SetField("{NUMERO_DIAS_VISTA2}", "2039"); stamper.Writer.CloseStream = false; stamper.Close(); reader.Close(); byte[] byteInfo = workStream.ToArray(); workStream.Write(byteInfo, 0, byteInfo.Length); workStream.Position = 0; File.WriteAllBytes(@"r:\demo1.pdf", byteInfo);
diff --git "a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfReader.cs" "b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfReader.cs" index dd7b950..0667b5d 100644 --- "a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfReader.cs" +++ "b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfReader.cs" @@ -2502,7 +2502,17 @@ namespace iTextSharp.text.pdf if (map.ContainsKey(k)) { Tokens.Seek(address[k]); - PdfObject obj = ReadPrObject(); + Tokens.NextToken(); + PdfObject obj; + if (Tokens.TokenType == PrTokeniser.TK_NUMBER) + { + obj = new PdfNumber(Tokens.StringValue); + } + else + { + Tokens.Seek(address[k]); + obj = ReadPrObject(); + } _xrefObj[objNumber[k]] = obj; } }
template.pdf filled_fixed.pdf filled_175.pdf
The text was updated successfully, but these errors were encountered:
1bf4d28
No branches or pull requests
Summary of the issue
There is an error when try to fill the Acrobat Form. Attached the templates and the results after filled.
Environment
Example code/Steps to reproduce:
Fix
Output:
template.pdf
filled_fixed.pdf
filled_175.pdf
The text was updated successfully, but these errors were encountered: