Pdf.js: Combining multiple PDFs?

Created on 19 Jun 2014  路  6Comments  路  Source: mozilla/pdf.js

Is it possible to load multiple PDFs so as to be able print them as if they were a single PDF?

This may not be the right place for this... We're trying to provide batch printing on the client side. Due to our "framework", we cannot concatenate multiple PDFs on the server side. Presently, we are exporting multiple individual PDFs in a zip file, but batch printing from Windows Explorer does not provide the ability to set print settings (printer, number of copies). Would it be possible to load these multiple individual PDF files with PDF.js, and then the user can use print from the browser, where they can specify print settings?

1-other

Most helpful comment

No.

All 6 comments

Is it possible to load multiple PDFs so as to be able print them as if they were a single PDF?

Yes and probably no. Loading of multiple PDFs is supported -- you can load them using PDFJS.getDocument(). Problem that you have to paint the page to canvases, and not all browsers will do a good job of printing it. At the moment, only Firefox has mozPrintCallback, which allows "paint" graphics directly to the printers context (see [1], [2] and [3]). Other browsers will print a bitmap when canvas is printed (including page headers, also see [4] or [5]).

Including this functionality in the standard viewer will be out of scope of this project. Closing as answered.

[1] https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L1542
[2] https://github.com/mozilla/pdf.js/blob/master/web/page_view.js#L687
[3] https://github.com/mozilla/pdf.js/blob/master/web/viewer.css#L1830
[4] https://github.com/mozilla/pdf.js/pull/3670
[5] https://github.com/mozilla/pdf.js/blob/master/web/viewer.css#L1801

Thank you.

you solved this zeckalpha ?

No, I did not. Not with pdf.js anyway. Best of luck.

@zeckalpha Did you find any other client side solution to this?

No.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

syssgx picture syssgx  路  29Comments

Vanuan picture Vanuan  路  34Comments

AliND picture AliND  路  29Comments

kaymes picture kaymes  路  62Comments

agilgur5 picture agilgur5  路  32Comments