Print search result pages

The PDF-XChange Viewer for End Users
+++ FREE +++

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

wosmond
User
Posts: 1
Joined: Thu Dec 24, 2009 7:09 pm

Print search result pages

Post by wosmond »

Hi all, I've got a ~7500 page pdf that I'm searching through using multiple search terms and I'm wondering if there is some way that I haven't found yet to print out all of the pages on which a match was found. If there is no such way then I'm assuming I can just export all the pages to .txt using pdf-tools, write a groovy script to search through the files for my strings of interest, then generate a page number list suitable for printing using File -> Print -> Pages. I'd like to avoid doing the latter because it's not terribly efficient, and ideally I'd like to see the highlights of the occurrences of the search term on each printed page.

As an aside, I'm astounded at how much faster this viewer is at searching through the actual pdf than acrobat, hats off to you guys. One small bug I noticed though, you can't paste a search term into the input field that is "longer" than the field itself (the part of that wouldn't visibly fit into the field is truncated). But if I widen the search pane, hence widening the search term input field, I can paste in the whole string.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2476
Joined: Thu Jun 30, 2005 4:11 pm

Re: Print search result pages

Post by Vasyl - PDF-XChange »

Hi all, I've got a ~7500 page pdf that I'm searching through using multiple search terms and I'm wondering if there is some way that I haven't found yet to print out all of the pages on which a match was found. If there is no such way then I'm assuming I can just export all the pages to .txt using pdf-tools, write a groovy script to search through the files for my strings of interest, then generate a page number list suitable for printing using File -> Print -> Pages. I'd like to avoid doing the latter because it's not terribly efficient, and ideally I'd like to see the highlights of the occurrences of the search term on each printed page.
No simple way for this in PDF-XChange Viewer. But exists one method for this case - you may use our PDF-XChange Viewer ActiveX SDK:
1. Obtain text from <PageIndex> page by:

Code: Select all

DoDocumentVerb(docId, "Pages[<PageIndex>].Text", "get", dataIn(0, -1), dataOut, 0);
2. Search entries manually in obtained text and if you found some:
2.1.(?) if needed - you may highlight entries by code:

Code: Select all

DoDocumentVerb(docId, "Pages[<PageIndex>].Text", "highlight", dataIn(<EntryFirstChar>, <EntryCharsCount>), NULL, 0);
2.2. you may print this page by code:

Code: Select all

SetProperty("Print.RangeType", "exact", 0);
SetProperty("Print.RangeFilter", "All", 0);
SetProperty("Print.RangeText", "<PageIndex>", 0);
PrintDocument(docId, PXCVA_NoUI);
-----
For details, see our PDF-XChange Viewer ActiveX SDK Help('Reference/Named Items/Objects/Documents/<Item>/Pages/<Item>/Text' section)
...you can't paste a search term into the input field that is "longer" than the field itself (the part of that wouldn't visibly fit into the field is truncated)...
Oops. This issue will be fixed in the next build. Thanks.

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.