summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ipdf/pdfread.cxx
AgeCommit message (Collapse)AuthorFilesLines
2017-11-17loplugin:casttovoid (--disable-pdfium)Stephan Bergmann1-7/+2
Change-Id: I38017e3b191ef210facf46323c9a3bb5f54bf0a3
2017-11-07fix !HAVE_FEATURE_PDFIUM buildCaolán McNamara1-1/+1
Change-Id: Ied661aafbaf9d85b01ef57e83bbacd9f9a828f2b
2017-11-07tdf#113550 RTF import: fix incorrect text indentMiklos Vajna1-3/+3
Left indent was set to non-zero in the style, but direct formatting set it back to zero. Teach deduplication to remove the NS_ooxml::LN_CT_PPrBase_ind SPRM itself in case the last attribute was removed. Change-Id: I01b202f0241b02816b2b392326737b1150caffc2 Reviewed-on: https://gerrit.libreoffice.org/44385 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-06tdf#108748 generate PDF preview on SwapInJan-Marek Glogowski1-22/+44
When including a PDF as an image, it's represented internally as a Bitmap with additional PDF data. On SwapIn, LibreOffice just imported the PDF data missing the PDF preview. The Graphic also gad the wrong image type, which results in a busy loop on master, with a strange / unhelpful STR_COMCORE_READERROR generated by SwNoTextFrame::PaintPicture. This is a workaround to generate the Bitmap on SwapIn, which will really slow down LibreOffice when importing many PDFs. I guess the job of generating the PDF previews should probably be deferred to a thread or a low priority Scheduler task, just like the general image loading is handled. Change-Id: I8084e4533995ecddc5b03ef19cb0c6a2dbf60ebd Reviewed-on: https://gerrit.libreoffice.org/43906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-09-28RTF export: various minor cleanupsMiklos Vajna1-4/+1
Change-Id: I6bdbe246bf65dcfa193289210f7c464769d5e2ad Reviewed-on: https://gerrit.libreoffice.org/42887 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-05new loplugin unnecessaryparenNoel Grandin1-1/+1
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-11Related: tdf#106972 vcl PDF import: downgrade PDF >= 1.5Miklos Vajna1-4/+103
There are two problems with these newer PDF versions: - the current PDF export code doesn't know how to roundtrip such PDF images (needs work on both the import and export side) - upgrading the default PDF export version would upset readers who can't parse PDF >= 1.5 So instead of raising the default PDF export version, for now just be conservative and depend on pdfium to downgrade the PDF image version to 1.4 if it would be higher. Given that this modifies the input of the graphic filter this also needs changes in the ODF export, so that the filter result will contain that downgraded data, not the original one. Change-Id: I1efa97af8110e9a6ee3e8a7339bcc7d70457cfb0 Reviewed-on: https://gerrit.libreoffice.org/36413 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-04-07vcl: remove no longer needed WIN_Rectangle()Miklos Vajna1-6/+0
Not needed anymore after commit a5a571307fb3306b74ab46b085cde6388270a770 (tdf#82580 tools: rename Rectangle to tools::Rectangle, 2017-03-30). Change-Id: I25a11ca0b6c2e9e96847bd01b5e82835d1dd4a95
2017-03-02tdf#106270 vcl PDF import: use BitmapWriteAccess::CopyScanline()Miklos Vajna1-21/+6
This requires one function call / row only, cross-platform and works with OpenGL enabled as well. Change-Id: I12fd0f52a1a7e8e683b50071ded95f63fecc4d40 Reviewed-on: https://gerrit.libreoffice.org/34774 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-24vcl PDF import: there is no PNG encoding hereMiklos Vajna1-1/+1
It was a copy&paste error from xmlsecurity/workben/pdfverify.cxx, which does PNG encoding. Change-Id: I7b5108a7cddffdc859276b656a6e1168f23d3863
2017-02-22vcl: use auto when initializing with a cast in pdfreadMiklos Vajna1-5/+5
Change-Id: Ic785ef3f767cf529dc51e4d49234145fc8d14f97 Reviewed-on: https://gerrit.libreoffice.org/34535 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-20vcl PDF filter: avoid copy&pasteMiklos Vajna1-4/+6
By using a single ifdef block for the disable-pdfium case and by adding PDFWriterImpl::BitmapEmit::getObject(). Change-Id: Ia21e16d469bc75e9b1a95342ed01caef3e91ccd9 Reviewed-on: https://gerrit.libreoffice.org/34462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-14Werror=unused-function in some configsCaolán McNamara1-0/+4
Change-Id: I7cc4106063831f342c82c57b0476b9ac8c4b479a
2017-02-13vcl pdf import: use pdfium instead of draw_pdf_importMiklos Vajna1-73/+94
Replace creating a full Draw component with direct pdfium library calls. This also means that the result is now a bitmap, not a metafile for now. Also decouple HAVE_FEATURE_PDFIMPORT and HAVE_FEATURE_PDFIUM, the first is the "import PDF into Draw" feature, the second is the "insert PDF as image" feature. Change-Id: I72c25642ec84cc831df362e02b1520c6e6d9adcf Reviewed-on: https://gerrit.libreoffice.org/34217 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-10vcl: move out ImportPDF() from the global namespaceMiklos Vajna1-1/+6
It's a public symbol and can live in the vcl namespace just fine. Change-Id: I677f22e79f8ddc0c0756cc9bfeb498249354c516
2016-06-28sd draw page: add PreviewMetafile UNO propertyMiklos Vajna1-3/+2
This allows an unnecessary GDIMetaFile -> WMF -> GDIMetaFile roundtrip, and also avoids the odd black border at the bottom / right of the preview metafile in the PDF import-as-graphic filter. Change-Id: I7e3e782bbe0cf56def352e23b60864bb7773b607 Reviewed-on: https://gerrit.libreoffice.org/26743 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-24vcl: add graphic export-as-pdf filterMiklos Vajna1-0/+7
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>
2016-06-23vcl: add initial PDF import-as-graphic filterMiklos Vajna1-0/+107
This allows Insert -> Image e.g. in Writer to read a PDF file, and insert the metafile equivalent of the first page into the document. Currently the original PDF document is lost on import (unlike when inserting an SVG file). Change-Id: Ib0472c5d9bd9a1da054353fa3a3a638a1052721e Reviewed-on: https://gerrit.libreoffice.org/26586 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>