Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

TextDevice methods are changing the text position.

$
0
0
I was using Aspose.Pdf (9.4.0) with the method Absorber and when I started using the class textDevice the "footer" of the PDF has become returned in the string before the "header". 

Why this is happening? Attached the file and image .

The following code snippet: 

textDevice:
using (MemoryStream textStream = new MemoryStream())
{
  textDevice = new TextDevice();
  Aspose.Pdf.Text.TextOptions.TextExtractionOptions textExtOptions = new Aspose.Pdf.Text.TextOptions.TextExtractionOptions(Aspose.Pdf.Text.TextOptions.TextExtractionOptions.TextFormattingMode.Raw);
   textDevice.ExtractionOptions = textExtOptions;
   textDevice.Process(pdfDocument.Pages[page], textStream);                       
   textStream.Close();
   linha = Encoding.Unicode.GetString(textStream.ToArray());
}

TextAbsorber:
textAbsorber = new TextAbsorber();
pdfDocument.Pages[page].Accept(textAbsorber);
linha = textAbsorber.Text;


Att,

Viewing all articles
Browse latest Browse all 3131

Trending Articles