You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing the following contents in my document's text:
LastNameLoan O\0cer
Email:EncProd@na\0nc.com
It would appear that the Text property is substituting a \0 when it encounters an "fi" sequence in the document's text. I am using a MemoryStream (instantiated from a byte array) as my parameter to PdfDocument.Open. I have checked that this memory stream creates a valid pdf file when written to a file with the following code:
var file = new FileStream(".\\testPdf2.pdf", FileMode.Create, FileAccess.Write);
var memStream = new MemoryStream(uploadedFileByteArray);
memStream.WriteTo(file);
file.Close();
I am able to load and view this file in Acrobat Reader. Am using the following code to process this with PdfPig:
using (PdfDocument doc = PdfDocument.Open(memStream))
{
foreach (Page page in doc.GetPages())
{
string pageText = page.Text;
}
}
It is this pageText variable that has the issue identified above and the content of the page is truncated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am seeing the following contents in my document's text:
LastNameLoan O\0cer
Email:EncProd@na\0nc.com
It would appear that the Text property is substituting a \0 when it encounters an "fi" sequence in the document's text. I am using a MemoryStream (instantiated from a byte array) as my parameter to PdfDocument.Open. I have checked that this memory stream creates a valid pdf file when written to a file with the following code:
I am able to load and view this file in Acrobat Reader. Am using the following code to process this with PdfPig:
using (PdfDocument doc = PdfDocument.Open(memStream))
{
foreach (Page page in doc.GetPages())
{
string pageText = page.Text;
}
}
It is this pageText variable that has the issue identified above and the content of the page is truncated.
Has anyone encountered anything like this?
Beta Was this translation helpful? Give feedback.
All reactions