diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-24 13:00:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-24 11:51:01 +0000 |
commit | 7d76bb251e0c88ff17282a33b801a5d17a434af5 (patch) | |
tree | 927e5ff1968764b40b070dca8e6aae8b3e9d25ce /vcl/source/filter/ipdf/pdfread.cxx | |
parent | 47443d720d5f2bee0993222fd6383a59056d8591 (diff) |
vcl: add graphic export-as-pdf filter
In case the metafile was imported from a PDF originally, then this
allows storing the PDF stream next to the graphic. This means that e.g.
in Writer choosing 'Save' from the context menu of the graphic can write
the original PDF stream, not the replacement metafile.
Change-Id: I4ab45d5af17fe46d7538df6d79d6b57ed163572a
Reviewed-on: https://gerrit.libreoffice.org/26628
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/source/filter/ipdf/pdfread.cxx')
-rw-r--r-- | vcl/source/filter/ipdf/pdfread.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index cc63415eba6d..6bd1f6f524a8 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -101,6 +101,13 @@ VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic) rGraphic = aMtf; + // Save the original PDF stream for later use. + rStream.Seek(STREAM_SEEK_TO_END); + uno::Sequence<sal_Int8> aPdfData(rStream.Tell()); + rStream.Seek(STREAM_SEEK_TO_BEGIN); + rStream.ReadBytes(aPdfData.getArray(), aPdfData.getLength()); + rGraphic.setPdfData(aPdfData); + return true; } |