diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-02-03 20:23:23 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-02-04 09:14:49 +0100 |
commit | 7088140dbf1d5e0391c2662f0213018a45620ff9 (patch) | |
tree | 5f2814ca4adf84df664dfc543bb93007792ac6cb /vcl/source | |
parent | bc2cbd7d577135d2daef611bc2a2c4ac6283dfd0 (diff) |
tdf#129976 PDF export of PDF images: adapt transparency to rendering
The bugdoc has a transparent PDF image, and we currently put a white
background behind that in Impress, given that vcl::RenderPDFBitmaps()
works with Bitmap instances, not BitmapEx ones.
This means that in case we preserve transparency during PDF export, the
content that was rendered OK now becomes unreadable.
Adapt the PDF export to do the same as rendering by putting a white
background behind the PDF image.
Change-Id: I4edcb12fab71bb305d97a50d20fbfbf86d9aab85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87910
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index ec148b2159d8..6726b02b7173 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8757,6 +8757,16 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) // Reset line width to the default. aStream.append(" 1 w\n"); + // vcl::RenderPDFBitmaps() effectively renders a white background for transparent input, be + // consistent with that. + aStream.append("1 1 1 rg\n"); + aStream.append("0 0 "); + aStream.append(aSize.Width()); + aStream.append(" "); + aStream.append(aSize.Height()); + aStream.append(" re\n"); + aStream.append("f*\n"); + // No reference XObject, draw the form XObject containing the original // page streams. aStream.append("/Im"); |