Overview of how print to PDF works?

162 views
Skip to first unread message

Nikita Alekseev

unread,
Aug 25, 2019, 2:01:27 AM8/25/19
to Chromium-discuss
I am trying to find an overview of how pdfs are generated, when the page is printed to PDF. I understand there must be some generator, which transforms DOM of the page into a PDF document, but I was unable to find any details about that. Ideally, I would like to know where in the source code the PDF is generated. Does chromium use any third-party library to create PDF, or is it all hand-written.

If anyone has any information about this topic, I would be glad if you could share that with me.


Jon Perryman

unread,
Aug 25, 2019, 9:32:04 PM8/25/19
to Chromium-discuss
For printing PDF's on my Windows 10 PC, there is a print driver called "Microsoft to PDF" that I select as a printer. It is not specific to any program or browser. 

Jon. 

On Sat, Aug 24, 2019 at 11:01 PM Nikita Alekseev <n.aleks...@gmail.com> wrote:
I am trying to find an overview of how pdfs are generated, when the page is printed to PDF. I understand there must be some generator, which transforms DOM of the page into a PDF document, but I was unable to find any details about that. Ideally, I would like to know where in the source code the PDF is generated. Does chromium use any third-party library to create PDF, or is it all hand-written.

If anyone has any information about this topic, I would be glad if you could share that with me.


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Alan Screen

unread,
Aug 27, 2019, 3:27:15 AM8/27/19
to Chromium-discuss, n.aleks...@gmail.com
If you mean when using "Save as PDF" from within Chrome then it will use Skia to generate the resultant PDF.  The layer where web content layout gets provided to Skia for PDF generation can be found in [1], and the lower-level PDF generation internals of the Skia library are in [2].

Jon Perryman

unread,
Aug 27, 2019, 12:25:56 PM8/27/19
to awsc...@chromium.org, Chromium-discuss
Out of curiosity, where is "save as PDF"? I'm running google chrome Version 76.0.3809.100 (Official Build) (64-bit) on windows 10 but can't find it.

Thanks, Jon.

Alan Screen

unread,
Aug 29, 2019, 10:58:16 AM8/29/19
to Chromium-discuss, awsc...@chromium.org
It is one of the destinations that you can select when in the print preview, which you should get when hitting Ctrl+P.

You won't see it if you use system print dialog (Ctrl+Shift+P).
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages