On Tue, 2021-06-15 at 20:47 +0800, Shane Hou wrote:
> Otherwise why did drawing lines and drawing XObjects result in
> different situations?

        Hi,
simply because drawing a line is a primitive thing, which adds data
only to the content stream itself, while the XObject is a complicated
thing, with adds its own resources.

> Do you mean if the input PDF files are more than one page, instead of
> constructing multiple `PDFXObject`s that reference corresponding
> pages of input PDF files, I should add the whole document into the
> output PDF file, then manipulate those newly-added pages?

Correct. If you are going to add only a single page from each PDF file
then it doesn't matter, but if there will be more pages added, then
it's better to merge whole documents, transform the needed pages into
the XObject-s, delete the pages and recreate the new pages with the
desired content.

I suggest you try both approaches and compare the file sizes. If I'm
not mistaken, then copying pages by one will generate larger content
(supposing the page contains special resources, like embedded fonts and
the like, which increase the file size quickly when being duplicated).
        Bye,
        zyx



_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to