Hi,
I'm trying to find a text in a PDF document with FindText method, but I have no result if the PDF is converted from DOCX by spire.doc, while FindText works if the same document is exported in PDF from Word 2010. FindText works also with other PDF documents.
This is my code to convert from DOCX:
Spire.Doc.Document doc = new Spire.Doc.Document();
doc.LoadFromStream(msIn, Spire.Doc.FileFormat.Auto);
var pdfParams = new ToPdfParameterList()
{
IsEmbeddedAllFonts = true,
IsHidden = true,
PdfConformanceLevel = PdfConformanceLevel.Pdf_A1B
};
doc.SaveToStream(msOut, pdfParams);
This is my code to find the text in converted PDF:
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
byte[] result = null;
Spire.Pdf.PdfDocument pdf = new Spire.Pdf.PdfDocument();
pdf.LoadFromBytes(barr);
PdfTextFindCollection words = pdf.Pages[1].FindText("Carota");
Thanks.