path: root/include
diff options
authorTomaž Vajngerl <>2020-03-29 16:30:19 +0200
committerTomaž Vajngerl <>2020-03-29 22:19:32 +0200
commit489b18edd6dc87287f260ba87d95abcc95d87932 (patch)
tree7651eb720c3d5782fe75d0699019c27034e602e7 /include
parent125a1abfb251264f5a434ef7fa12cdbd2d7b2ff2 (diff)
pdfium: fix setting the size of the document when opening PDF
When loading the pages of PDF, the size of the document was set to the wrong value. Size returned by ImportPDFUnloaded was in pixels, which is not really useful considering the svx and sd core uses 100th mm as the unit and converting it to a device dependent pixel will just bring grief. Also we don't need to know the size in pixels until we actually render. This change removes DPI as the parameter to the ImportPDFUnloaded and changes the code to get the size of the page from the PDF as points and converts that to 100th mm. Change-Id: I0c0db23d2775e2897ba7621ef6320a974c0b9275 Reviewed-on: Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <>
Diffstat (limited to 'include')
1 files changed, 3 insertions, 15 deletions
diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx
index b56e8139447d..ba0eb1ca85be 100644
--- a/include/vcl/pdfread.hxx
+++ b/include/vcl/pdfread.hxx
@@ -14,19 +14,10 @@
#include <tools/gen.hxx>
#include <tools/stream.hxx>
-namespace com
-namespace sun
-namespace star
-namespace uno
+namespace com::sun::star::uno
template <typename> class Sequence;
class Bitmap;
class Graphic;
@@ -40,13 +31,10 @@ VCL_DLLPUBLIC size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vecto
/// Imports a PDF stream into rGraphic as VectorGraphicData.
VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic);
-/// Import PDF as Graphic images (1 per page), all unloaded.
-/// Since Graphic is unloaded, we need to return the page size (in pixels) separately.
-/// Does not set rPdfData if no conversion is done.
+/// Import PDF as Graphic images (1 per page), but not loaded yet.
/// Returns the number of pages read.
VCL_DLLPUBLIC size_t ImportPDFUnloaded(const OUString& rURL,
- std::vector<std::pair<Graphic, Size>>& rGraphics,
- double fResolutionDPI = 96.);
+ std::vector<std::pair<Graphic, Size>>& rGraphics);