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

Any example use OpenGL to render PDF? #200

Closed
zeroxer opened this issue Mar 9, 2023 · 2 comments
Closed

Any example use OpenGL to render PDF? #200

zeroxer opened this issue Mar 9, 2023 · 2 comments

Comments

@zeroxer
Copy link

zeroxer commented Mar 9, 2023

  • Parsing pdf use PDF-Writer.
  • Rendering pdf use OpenGL.
@galkahana
Copy link
Owner

As for parsing PDF with PDF-Writer there are several examples I can provide. First there's the post I created about it in the project blog with several starters:
https://www.pdfhummus.com/post/45501628414/parsing-pdf-0

I also used the parser to create a text extraction tool. It parses the basic features of the document, like pages count and page media box (the page dimensions) as well as parses the content of the PDF file looking for text placement commands in order to understand what text is drawn there. I recently also added paths parsing for some very initial attempt at parsing table data. you can find the project here:
https://github.com/galkahana/pdf-text-extraction
I can provide more pointers there to how the parser is used.

This library has a NodeJS counterpart and the methods names are kinda similar, so if you want to read some node code to figure out what you can do here then there's also some examples of the parser in javascript, in particular here's one that parses form data from PDF:
https://github.com/galkahana/HummusJSSamples/blob/master/parsing-form-values/pdf-digital-form.js

As for rendering PDF to bitmap or to be used in opengl, then while the parser of this library could be potentially used to build a renderer, it sounds to me like a large project and there are existing libraries that can render PDF. Adobe PDF library is one example, and unfortunately the only one i used in the past, for javascript i'm familiar with PDF.JS. but if you will look for "PDF Renreder in XXXXX language" you will probably chance on a good option.

@zeroxer
Copy link
Author

zeroxer commented Mar 11, 2023

Thanks for your help. I'll try.

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