diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-03-29 16:30:19 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-04-01 20:54:20 +0200 |
commit | b0cc614b7119c6933426b5e0cde9628596671bd5 (patch) | |
tree | 91078fbcf2f66d3a8521143f5a914db5d01e7611 /include | |
parent | 17bb1ecae40aea4a9a9e6b4b0eb1d40f597b60a4 (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.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91330
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 489b18edd6dc87287f260ba87d95abcc95d87932)
Change-Id: I0c0db23d2775e2897ba7621ef6320a974c0b9275
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91452
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/pdfread.hxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx index 986c208c25a5..914b714f9f94 100644 --- a/include/vcl/pdfread.hxx +++ b/include/vcl/pdfread.hxx @@ -39,13 +39,10 @@ VCL_DLLPUBLIC size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vecto 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, - const double fResolutionDPI = 96.); + std::vector<std::pair<Graphic, Size>>& rGraphics); } #endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX |