diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-13 23:55:26 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-01 08:59:10 +0200 |
commit | 52a0b46bfdc32e5c37b3d7343a42c6388f3d569d (patch) | |
tree | e4939d36f57dfe06aad329350630b5e960ebb5ea /include | |
parent | 32817f930580b6b378dd470ccbdf967c06540db2 (diff) |
sd: import PDFs as images using Pdfium new SdPdfFilter
LOK now opens PDFs as images using Pdfium,
which has a superior accuracy and support
to poppler, the default pdf reader.
(cherry picked from commit 0e8f4f45b44935c7c8002d606b97a48e60e37b23)
Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/graph.hxx | 6 | ||||
-rw-r--r-- | include/vcl/pdfread.hxx | 32 |
2 files changed, 37 insertions, 1 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index c77a54ff3f41..b232dc4b0990 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -227,10 +227,14 @@ public: const VectorGraphicDataPtr& getVectorGraphicData() const; void setPdfData(const std::shared_ptr<css::uno::Sequence<sal_Int8>>& rPdfData); - void setPdfData(const css::uno::Sequence<sal_Int8>& rPdfData) { setPdfData(std::make_shared<css::uno::Sequence<sal_Int8>>(rPdfData)); } std::shared_ptr<css::uno::Sequence<sal_Int8>> getPdfData() const; bool hasPdfData() const; + /// Set the page number of the multi-page source this Graphic is rendered from. + void setPageNumber(sal_Int32 nPageNumber); + /// Get the page number of the multi-page source this Graphic is rendered from. + sal_Int32 getPageNumber() const; + static css::uno::Sequence<sal_Int8> getUnoTunnelId(); }; diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx new file mode 100644 index 000000000000..969667dc17f9 --- /dev/null +++ b/include/vcl/pdfread.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX +#define INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX + +#include <tools/stream.hxx> +#include <vcl/graph.hxx> + +namespace vcl +{ + +/// Imports a PDF stream into rGraphic as a GDIMetaFile. +VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Bitmap& rBitmap, + css::uno::Sequence<sal_Int8>& rPdfData, + sal_uInt64 nPos = STREAM_SEEK_TO_BEGIN, + sal_uInt64 nSize = STREAM_SEEK_TO_END); +VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic); + +VCL_DLLPUBLIC size_t ImportPDF(const OUString& rURL, std::vector<Bitmap>& rBitmaps, + css::uno::Sequence<sal_Int8>& rPdfData); +} + +#endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |