Hi there
Is there someway to detect whether the generated PDF has the “evaluation” text on it ?
- reason is I’m writing unit tests and one thing I want to test is the licence file has been successfully used
Hi Steve,
One option could be to read the text from the pdf document and match string like "Evaluation Only" etc.
This is how you can do that:
1. Extract text from the pdf file or page
PdfExtractor extractor = new PdfExtractor();
extractor.BindPdf(".\\pdffile.pdf");
extractor.ExtractText();
extractor.GetText(".\\textfile.txt");
2. Use text in the textfile.txt for comparison
load text in a string type variable i.e. strContent
then use strContent.Contains("Evaluation Only");
if you get true it means evaluation version is being used.
That's just an idea, if it helps!
Regards.
Hello Steve,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for considering Aspose.
Aspose.Pdf.Kit has class named PdfExtractor which offers a function named, ExtractText which returns the text from Pdf file. You can extract the text into a file or into MemoryStream and search for particular string ("Evaluation" in this case) programmatically. For more related information and code snippet, please visit http://www.aspose.com/documentation/file-format-components/aspose.pdf.kit-for-.net-and-java/extract-text-from-pdf-document.html
NOTE: This is Beta version of PdfExtractor. Some features may not be supported well and we may be not able to fix them in short time.
Thanks for the pointer, much appreciated
Thanks for the pointer, again much appreciated