From 51ac74617a33f518d068dd6e1f86431ee805bfbc Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 1 Apr 2014 13:41:13 +0200 Subject: vcl/README: some notes on debugging PDF export Change-Id: Ic48d6be35fd9308a28d9fa62b184cd34dd8f9f6b --- vcl/README | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'vcl/README') diff --git a/vcl/README b/vcl/README index 76ee2bb21062..65113a62dd5d 100644 --- a/vcl/README +++ b/vcl/README @@ -152,3 +152,39 @@ before running LibreOffice; it will give you lots of useful hints. You can also fallback to EMF (from EMF+) rendering via export EMF_PLUS_DISABLE=1 + + +== Printing/PDF export == + +Printing from Writer works like this: + +1) individual pages print by passing an appropriate OutputDevice to XRenderable +2) in drawinglayer, a VclMetafileProcessor2D is used to record everything on + the page (because the OutputDevice has been set up to record a MetaFile) +3) the pages' MetaFiles are converted to PDF by the vcl::PDFWriter + in vcl/source/gdi/pdfwriter* + +Creating the ODF thumbnail for the first page works as above except step 3 is: + +3) the MetaFile is replayed to create the thumbnail + +On-screen display differs in step 1 and 2: + +1) the VCL Window gets invalidated somehow and paints itself +2) in drawinglayer, a VclPixelProcessor2D is used to display the content + + +=== Debugging PDF export === + +Debugging the PDF export becomes much easier in higher debug-levels, where +compression is disabled (so the PDF file is directly readable) and +the MARK function puts comments into the PDF file about which method +generated the following PDF content. + +touch vcl/source/gdi/pdfwriter* && make vcl dbglevel=3 + +To de-compress the contents of a PDF file written by a release build or +other programs, use the "pdfunzip" tool: + +LD_LIBRARY_PATH=$PWD/instdir/ure/lib workdir/LinkTarget/Executable/pdfunzip input.pdf output.pdf + -- cgit