Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search for text in pdf document #380

Closed
doug-gov opened this issue Mar 11, 2020 · 1 comment
Closed

Search for text in pdf document #380

doug-gov opened this issue Mar 11, 2020 · 1 comment

Comments

@doug-gov
Copy link

I'm new to javascript and have been tasked with creating a table of contents in an existing PDF. I was wondering if there was a way in PDFDocument or PDFPage where I can search for text a string.

I read the existing pdf in using fs.fileread. But if a do a .toString() on the PDFPage I cannot see any text. My thinking was I could read the PDF in, go page by page and search for headers and make a note of what page they are found in. Then insert a blank page and use drawText to display the header along with a page number.

Thanks for any help you can give me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants