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

How to Draw on Existing PDF #43

Open
abhilashsajeev opened this issue May 30, 2023 · 3 comments
Open

How to Draw on Existing PDF #43

abhilashsajeev opened this issue May 30, 2023 · 3 comments

Comments

@abhilashsajeev
Copy link

The examples in documentation shows adding new pdfs only. I would like to add lines and curves to existing pdf file. Could you please provide minimal working example of doing the same

@sbinet
Copy link
Contributor

sbinet commented Jun 5, 2023

as of now, go-pdf/fpdf can only create PDFs from scratch.
to achieve what you want, one would need to add infrastructure and code that reads+parses PDFs and then produces a Fpdf document (on top of which one would add new instructions).

I am not against adding such capabilities, but that's a bit outside of the current amount of time I can dedicate to go-pdf/fpdf.
(but I do accept PRs, though.)

@gedw99
Copy link

gedw99 commented Jun 8, 2023

Can I suggest the htmx pattern .

it allows you to do pressure enhancement . What does that mean ?

Basically you can add more content to an existing file. It’s used normally for html when you want to change the dom nodes and inject new dom

So it’s a way to add more to a pdf basically

what I don’t know is if the pdf format gives a type of selector / dom where you can add / overwrite existing pdf like you can do with html ??

If there is then it’s a great way to make pdfs editable

@rorycl
Copy link

rorycl commented Jul 4, 2024

Assuming go-pdf/fpdf maintains some compatibility with jung-kurt/gofpdf, drawing on the pdf is quite simple.

Check out this example which draws vectors from a remarkable tablet .rm file onto a new layer of a pdf.

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

4 participants