Closed chunyenHuang closed 7 years ago
Merging pages is the most involved option of copying pages. Though i must say 10 secs is a lot in terms of anything that hummus does, so uts a bit suspicious.
One option is to use drawImage instead if merging. But yes, modifying is probably the best approach, yes. Use the background pdf as your modified source, and drawImage to place the overlay on top if it.
I thought I read all the documentation already, but I definitely missed drawImage
....
Thanks for your advice and time, it runs perfectly right now.
@galkahana, could I make a suggestion of renaming the drawImage()
method to overlay()
or something else? After reading the docs and going into C++ source code, I understand what the method is doing, but the original name is misleading. At first I thought it actually converted the overlaying PDF page to image, but they are kept as objects (+metadata) even if you run transformation (like rotating, scaling) on it.
wouldn't go as far as changing the method name, but its a good idea to note this on the documentation. will do. thanks.
Hello Gal, Thanks for bringing us amazing HummusJS.
I just start to use this module, and need your help for merging existing pages.
I want to put
overlay.pdf
on top ofbackground.pdf
. Here is my current approach.Apparently this is not a good idea, because copying context from both pdf takes more than 10 seconds for some large and complex pdf files.
I want to ask if there is any way that I can use
and retrieve the
inTargetPage
formergePDFPageToPage
from this existing pdf file instead of getting frompdfWriter.createPage()
?? or this is also a wrong approach??Thanks again for all your efforts.