PDFDocument to open user password protected file?

PDFDocument to open user password protected file?

Forum member · Dec 28, 2009
I've tried to open a PDF file protected with a user password but PDFDocument throws an error on the constructor saying "invalid owner password". I'm trying to give it a user password. Is there no option to pass in a user password? Only an owner password? I've used other libraries which allow me to open a user password protected pdf. i'm trying to open an existing PDF, find certain words, elements, etc. and highlight them. Thanks, Gerry

Re: PDFDocument to open user password protected file?

Support · Dec 28, 2009
Hello Gerry, The owner password is required to merge a PDF which is protected. It is not possible to merge the PDF using the user password. It is not possible to search and highlight the text in a PDF using the Merger product. You can use our Viewer product for search and highlight the text. Please feel free to download the evaluation version of our Viewer product from our website . Thanks, ceTe Software Support Team.

Re: PDFDocument to open user password protected file?

Forum member · Dec 28, 2009
<< Hello Gerry, The owner password is required to merge a PDF which is protected. It is not possible to merge the PDF using the user password. It is not possible to search and highlight the text in a PDF using the Merger product. You can use our Viewer product for search and highlight the text. Please feel free to download the evaluation version of our Viewer product from our website. Thanks, ceTe Software Support Team >> Ok, I'll see about using the owner password. As for the highlighting I need to do it programmatically so using the View Product would not work. I was thinking of enumerating the items in the PDF document and then when I find certain items do some graphics, etc. to make the text appear to be highlighted. Would something like that be possible? Thanks, Gerry

Re: PDFDocument to open user password protected file?

Support · Dec 29, 2009
Hello Gerry, You can search and highlight the text on a page programmatically when using the viewer without any problem. You will have to use the SearchAndHighlightAllTextOnPage method of the viewer control for this. You can not add any graphics to the PDF by using the viewer. Using the Merger you can add a new text with highlight (adding a rectangle with a color and the text with desired font) but it is not possible to edit the existing text and it is not possible to search the text on a PDF. You will have to add the text and highlight rectangle by specifying the X, Y on existing text. Thanks, ceTe Software Support Team.

Re: PDFDocument to open user password protected file?

Forum member · Dec 29, 2009
Thanks for the reply. So is there a way to iterate through the elements on the page and inspect each element? I'd like to be able to do that so that I can look at the text, x, y location, etc. Then add new elements to the page and save the document. Gerry

Re: PDFDocument to open user password protected file?

Support · Dec 30, 2009
Hello Gerry, It is not possible to iterate through the text or elements on the PDF document. You can read or fill the form fields present in the PDF, you can also iterate through the form fields. But it is not possible to loop through or to get the information of text or any other data present in the PDF. Thanks, ceTe Software Support Team.