phpdave11 / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/phpdave11/gofpdf
MIT License
214 stars 42 forks source link

Page size increase after use another file as PDF as a template #32

Closed r2r72 closed 1 year ago

r2r72 commented 1 year ago

Hi guys, I am tried to update existing pdf file, just add some text and picture, and got some strange behaviour. If you import file as template and then save it even without any changes at all page size increase by 2.83 times. For example original file was 612 792 px then after import all pages and save it again (without any changes) it is became 1734 2245 px, if I try to repeat that exercise next step will be 4917 * 6363 px, and so on. Even if I specify sizeType in code it does not help at all. I think it is an issue.

r2r72 commented 1 year ago

Sorry, I find out the root of the problem, it was all about units. In my code it was pdf := gofpdf.New("P", "mm", "A4", "") all that I need to do it change it to pdf := gofpdf.New("P", "pt", "A4", "") and everything runs perfectly.