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

Difference in behaviour between Aspose.Pdf.Kit.PdfExtractor and Aspose.Pdf.Facades.PdfExtractor

$
0
0
Hi

When I use Aspose.Pdf.Facades.PdfExtractor to extract text from a pdf file and save it as a Docx file, after every line of text an empty line gets created. If I implement this using Aspose.Pdf.Kit.PdfExtractor I do not have that problem. Please compare the differences between the attached files to see the effect. I am not able to use PDF.Kit for our Live product. What can I do to fix this?

    SetPdfKitAsposeLicence();
            //SetPdfAsposeLicence();

            //Instantiate PdfExtractor object
            var extractor = new Aspose.Pdf.Kit.PdfExtractor { Password = "" };
            //var extractor = new Aspose.Pdf.Facades.PdfExtractor { Password = "" };
            
            using (var msIn = new MemoryStream(inFile))
            {
                using (var msOut = new MemoryStream())
                {
                    //Bind the input PDF document to extractor
                    extractor.BindPdf(msIn);

                    extractor.ExtractTextMode = 1;

                    //Extract text from the input PDF document
                    extractor.ExtractText();

                    //Save the extracted text to a text file
                    extractor.GetText(msOut);

                    msOut.Position = 0;
                    var sr = new StreamReader(msOut);

                    string pdfText = sr.ReadToEnd();

                    return pdfText;
                }
            }

Regards Rob

Viewing all articles
Browse latest Browse all 3131

Trending Articles