summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-03-13 23:55:26 -0400
committerJan Holesovsky <kendy@collabora.com>2018-06-07 10:45:18 +0200
commit7939efc7136987fad348baca2cd686a00aee73cd (patch)
treec142fd2770bb97d83fa91b971e370cf3b4acc73c /include
parent9b11fdd36ec80f9d1ae0a05455745361e0ce9ced (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. Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
Diffstat (limited to 'include')
-rw-r--r--include/vcl/graph.hxx6
-rw-r--r--include/vcl/pdfread.hxx46
2 files changed, 51 insertions, 1 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 847e20e202ab..cd2e48c273f7 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -231,10 +231,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..9f2797768646
--- /dev/null
+++ b/include/vcl/pdfread.hxx
@@ -0,0 +1,46 @@
+/* -*- 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>
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+template <typename> class Sequence;
+}
+}
+}
+}
+class Bitmap;
+class Graphic;
+
+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: */