summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
AgeCommit message (Collapse)AuthorFilesLines
47 hourstdf#160714 use crop box for bounds of embedded PDF objectPatrick Luby1-4/+10
If there is no crop box, fallback to the media box just to be safe. Change-Id: I29f99a43e550cf09a1534c0aa01ffd6a55536fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166544 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
10 daysDrop FRound, and use generalized basegfx::froundMike Kaganski1-4/+4
Change-Id: I7447e649dc3ef4e51242f69c7486a3e84e103d2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166159 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-01tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangleMike Kaganski1-2/+2
... instead of tools::Rectangle. Several problems were there: 1. First, a horizontal bounding rectangle was calculated, with due rounding; and then the result was rotated, and after that, rounded again. That made the resulting rotated rectangle coordinates very imprecise. 2. Also, ceil/floor was applied without normalization; and in case of rotated font, that meant, that sometimes the range could be not expanded to cover partially covered pixels, but instead collapsed. 3. The rotation to angles other than 90 degree multiples was done incorrectly, resulting in cut off parts of characters. 4. For 90 degrees, the imprecise result of sin/cos converted 0.0 into values like 3e-16, which then could be ceil'ed up to 1. Using B2DRectangle and its transform allows to simplify and fix the calculations easily, and avoids premature rounding. Render of rotated text of small size is more stable with this change. Change-Id: Idffd74b9937feb2418ab76a8d325fdaf4ff841b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165553 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-07fix use-after-free in PDFWriterImpl::appendUnicodeTextStringEncryptNoel Grandin1-1/+1
where if the resize triggers a copy, the pCopy pointer is now pointing to a block of memory that has been freed. Change-Id: I2ecfe6ad30f85b4c9e8c85f6296ac03ed4f04c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164485 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-02Drop unused variableMike Kaganski1-2/+1
Change-Id: I913c25e0ab4fb593e6d85805ed677dbe4db94c35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164127 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-13tdf#159689: trailing newline before "endstream" must not count in LengthMike Kaganski1-1/+1
Change-Id: Ic1e636c9d4e5a531113f26e147427fb75ce3591c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163185 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-05tdf#108037 speed up exporting large pdf (2)Noel Grandin1-30/+32
reduce the number of allocations we need to do for OStringBuffer Shaves 2% off the convert time. Change-Id: I0852c870b3c9e1941213f80f359d00cb8ee391df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-10cid#1546141 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+2
and cid#1546004 COPY_INSTEAD_OF_MOVE cid#1545934 COPY_INSTEAD_OF_MOVE cid#1545563 COPY_INSTEAD_OF_MOVE cid#1545533 COPY_INSTEAD_OF_MOVE cid#1545529 COPY_INSTEAD_OF_MOVE cid#1545502 COPY_INSTEAD_OF_MOVE cid#1545499 COPY_INSTEAD_OF_MOVE cid#1545479 COPY_INSTEAD_OF_MOVE cid#1545344 COPY_INSTEAD_OF_MOVE cid#1545324 COPY_INSTEAD_OF_MOVE cid#1545313 COPY_INSTEAD_OF_MOVE cid#1545252 COPY_INSTEAD_OF_MOVE cid#1545186 COPY_INSTEAD_OF_MOVE Change-Id: I44a783876699f88c769f239ae84eb5cae44d5f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30move IsFuzzing to comphelperCaolán McNamara1-1/+1
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin1-3/+3
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-06make AlphaMask separate from BitmapNoel Grandin1-2/+2
Having it subclass Bitmap encourages confusion in passing it around, and I need the extra type-safety for my work on merged-alpha Change-Id: I35819f9b8ee609cbdaf865563c78531e397b529b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160235 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-29Extended loplugin:ostr: vclStephan Bergmann1-6/+6
Change-Id: Ia9e958deec9716e38381a027451d5ee821efe23d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160095 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-19Extended loplugin:ostr: vclStephan Bergmann1-26/+26
Change-Id: I2a9d5383d1831d8bf61e5280d66556d71fccae52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159666 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-03tdf#157028 vcl: PDF export: inline OBJR dictionariesMichael Stahl1-31/+22
There seems to be no reason why SE child OBJR dictionaries are separate objects, they could just be inline. Change-Id: I9e4fcdf56d9b7454325f9d3ef7ba55bdc090f948 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158838 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2023-11-03tdf#156478 Remove unused default values for MediaBox and UserUnitTobias Kokolakis1-41/+5
Change-Id: Ica75be2fa238fdf2a40e274f1175710923b281e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156468 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-27tdf#152571 speedup slow draw file saveNoel Grandin1-1/+2
with lots of images, we seem to spend lots of time calculating CRC. Replace the vcl checksum/CRC with rtl_crc32 in sal/, which forwards to the zlib implementation, which has all kinds of nice SIMD code for performance. Change-Id: I295e2ee91b3450fa558b06e67aac0fbb20b85f52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-25vcl,sw: PDF/UA export: produce Ruby and Warichu SEsMichael Stahl1-0/+38
These need to generate multiple elements in SwTextPainter::PaintMultiPortion() and it's not altogether obvious. Change-Id: Ib5fd36c3ea8e15dff93a87bb231c3cc4f78b0089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158398 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-24tdf#157028 vcl: PDF export: inline attribute dictionariesMichael Stahl1-21/+14
There seems to be no reason why SE attribute dictionaries are separate objects, they could just be inline, which saves a little space (1%) and more importantly the PDF file is easier to read with less clutter. Change-Id: Iaaea2432313c0b710edabecae32545205f4f495e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158392 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-23vcl: migrate text layout functions out of OutputDeviceChris Sherlock1-1/+1
OutputDevice is not where text layout should be done. There are a number of text layout functions that are used across the text layout classes, so I have moved them into TextLayoutHelper and made the text layout classes rely on this. I have made TextLayoutHelper implement the ITextLayout interface because this is still useful to new classes that need to implement new text layout functionality. Change-Id: Ic137a938576e7a6a64db0e5780bbbdd8342ef421 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157362 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-19tdf#157680 scale down size and adjust size and scale factor for /BBoxPatrick Luby1-8/+10
The size of an embedded PDF files is multiplied by PDF_INSERT_MAGIC_SCALE_FACTOR for platforms like macOS so undo that by adjusting the size and scale factor. For some unknown reason, when exporting the following PDF, the estimated size of embedded PDF charts are 20x larger than expected. This only occurs on macOS so possibly there is some special conversion from MapUnit::MapPoint to MapUnit::MapTwip elsewhere in the code: https://bugs.documentfoundation.org/attachment.cgi?id=190109 Change-Id: Id0563466fea3d7a3a0419787ec9da45f0c1d2e0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157852 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann1-1/+1
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann1-1/+1
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-09-20tdf#156842 increase scale for external PDF dataPatrick Luby1-0/+10
For some unknown reason, the scale is 8 times larger than for non-external PDF XObjects. This fix also allows the CppunitTest_vcl_pdfexport to run successfully on macOS. Change-Id: I166914e6ac575c50985efba3fb7a38ec758dea1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157090 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-09-07tdf#157112: fix off-by-one error in /LastChar of PDF Type 3 fontsKhaled Hosny1-1/+1
It should be the index of the last glyph in the subset, so nGlyphs - 1. Change-Id: I62853a27b602d7b3e6b6265555542dd417438fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156630 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-04tdf#138792: PDF export: add batch of dublin core attributesSarper Akdemir1-2/+26
Adds support for exporting, editing in the UI and storage in ODF for the dublin core attributes listed below. Contributor (http://purl.org/dc/elements/1.1/contributor) Coverage (http://purl.org/dc/elements/1.1/coverage) Identifier (http://purl.org/dc/elements/1.1/identifier) Publisher (http://purl.org/dc/elements/1.1/publisher) Relation (http://purl.org/dc/elements/1.1/relation) Rights (http://purl.org/dc/elements/1.1/rights) Source (http://purl.org/dc/elements/1.1/source) Type (http://purl.org/dc/elements/1.1/type) Introduces XDocumentProperties2 to extend XDocumentProperties interface. Change-Id: Ie2e0b1fbbbd00b66aef477ba1bf4e4f61c03a3b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156330 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-04tdf#138792: PDF export: export metadata pdf:PDFVersionSarper Akdemir1-11/+21
Adds export of pdf:PDFVersion metadata. Change-Id: Ic4c3eec3672839d0d125b64dfca6149912cd2458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156329 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-04tdf#138792: PDF export: fix date of xmp:CreateDateSarper Akdemir1-2/+10
for pdf export xmp:CreateDate should be the modification date instead of the creation date. Change-Id: I2a86f30cb528cb2bd5e0f9e7c9a8a8b8d2993f50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156327 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-08-24vcl: Fix gcc 13.2 build (vcl::PDFWriterImpl::emitType3Font)Michael Weghorn1-1/+1
Fix this build failure seen with a gcc 13.2.0 `--enable-werror` build on Debian testing: .../vcl/source/gdi/pdfwriter_impl.cxx: In member function ‘bool vcl::PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace*, const vcl::pdf::FontSubset&, std::__debug::map<int, int>&)’: .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: error: moving a temporary object prevents copy elision [-Werror=pessimizing-move] 2719 | BitmapEx aBitmapEx = std::move(aReader.read()); | ~~~~~~~~~^~~~~~~~~~~~~~~~ .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: note: remove ‘std::move’ call cc1plus: all warnings being treated as errors make[1]: *** [.../solenv/gbuild/LinkTarget.mk:337: .../workdir/CxxObject/vcl/source/gdi/pdfwriter_impl.o] Error 1 Change-Id: I9f0ba1afd0dee2a8aaa4708672c755ab3a97e5a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156021 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-23tdf#156853: Fix PDF export of bitmap color fontsPatrick Luby1-1/+12
Emoji bitmaps need to have their alpha mask inverted like is done with transparent images and shapes. So, invert the alpha mask of Type 3 font bitmaps. Also, add links to test documents for future development and testing. Regression from: commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I18223a231ab751945883ede029d660949a406f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155960 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-22Revert "tdf#156853: Fix PDF export of bitmap color fonts"Patrick Luby1-10/+0
This reverts commit 3e20c3e73cbd10e8323f0997e3a6536abd11e2bd. Reason for revert: This breaks every single fix that I have made for exporting alpha masks to PDF. A different solution is needed as the invert needs to be where it was to snapshot the AlphaMask. Change-Id: I5f743b67067dff43a2324d6ca9bc1f444e245a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155917 Reviewed-by: Patrick Luby <plubius@neooffice.org> Tested-by: Patrick Luby <plubius@neooffice.org>
2023-08-22tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEMKhaled Hosny1-17/+22
Adobe Acrobat seems to have a bug with Type 3 fonts with unusual UPEM, the common 1000 and 2048 UPEM work fine, but Sitka has 2250 UPEM and Acrobat handles the advance widths in this case incorrectly and everything gets cramped up with gaps when we re-start glyph positioning. Workaround this by always using 0.001 scale in FontMatrix (equivalent to 1000 UPEM) and scale everything if the font’s UPEM is different. Change-Id: I80d25a16456f04bb00304b22b967688fa8260a83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155935 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-22tdf#156853: Fix PDF export of bitmap color fontsKhaled Hosny1-0/+10
Move the alpha inversion down to createBitmapEmit() so that it gets applied to any bitmap embedded in the PDF, especially since embedded color bitmap glyphs don't go through the higher level code path. Regression from: commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I68601a7a0d9ac01f5e8054f074f8e18fcbdea1be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155930 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-09use sal_uInt64 when dealing with stream positionNoel Grandin1-4/+4
Change-Id: Ibb8637e4648f56d7f9895a31df006915df8f8fdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155517 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-30tdf#156528: Fix handling PDF page scaling factor after large pagesMike Kaganski1-6/+2
The map mode wasn't set when current page's user unit was 1, which meant that it used the unchanged value from the previous page, where it could be different. Change-Id: Id1f1515dceac25cddc12081a86fabf8b32d633f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155025 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-26cid#1538888 silence Improper use of negative valueCaolán McNamara1-0/+2
and cid#1538887 Improper use of negative value Change-Id: I0d62fb6b3650351dbe6c3cbbc0809b145afc2f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154934 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-23vcl: Drop now unneeded DevicePoint typedefKhaled Hosny1-14/+14
It has been always typedef'd to basegfx::B2DPoint since: commit 5e218b5c51f7d9cd10bd9db832879efca41b9c75 Date: Wed Jan 12 21:19:32 2022 +0000 always use B2DPoint for DevicePoint Change-Id: I9f5202d5a71c77dd79f1759923917c26bf68a9af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154632 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23vcl: Use doubles for glyph item coordinatesKhaled Hosny1-1/+1
Change how glyph coordinates are represented inside VCL to use floating point instead of integers. Should make no functional difference because we are still rounding them. Change-Id: I5480ee3dec3afab50194954095fd6829ebaa4a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154499 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-20tdf#154990 vcl: PDF export: incorrect checks of annotation struct parentsMichael Stahl1-3/+3
The first form annotation is missing /StructParent. The invalid value is -1, not 0. Typically 0 is the index of the MCIDs entry (m_aMCIDParents) in the ParentTree /Nums, but if there is not a single MCID in the document, this is omitted and 0 may be a valid annotation then. Change-Id: I9885d176eae272d98000f9d9f0ffae82558c0ea0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154668 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-14tdf#154982 drawinglayer,svx,sw,vcl: PDF export: hell flys and shapes...Michael Stahl1-1/+4
... should be below their anchor paragraph in the structure tree. Refactor SwEnhancedPDFExportHelper (etc.) to use the new EnsureStructureElement()/InitStructureElement() functions instead of SetCurrentStructureElement() for the frames, and allow it for flys that don't have their anchor paragraphs created yet because the hell layer is exported before the document body. Change-Id: I1be3b54002e8196772e6f9d81dd0fd0c85b6e34b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154399 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-14tdf#154982 vcl: PDF Export: split BeginStructureElementMichael Stahl1-52/+148
... into 3 parts: EnsureStructureElement/InitStructureElement/BeginStructureElement So EnsureStructureElement and BeginStructureElement/EndStructureElement can be called multiple times for the same object, passing in a unique key and PDFExtOutDevData will only create the element once. InitStructureElement will be used exactly once for each object when its actual content is exported. In PDFExtOutDevData rely on the indexes being the same here and in PDFWriterImpl, because then only PDFExtOutDevData needs to maintain the map from key to index. Change-Id: Idea6e34627fe559038cf13cf01dafe84b759e3c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154357 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-13use more frozenNoel Grandin1-122/+115
Change-Id: Ie3e6e7e947d9322f3999cf3274a6c10ea717afe2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154276 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-11tdf#152234 vcl: Role values are lowercaseMichael Stahl1-4/+4
Old version 3 of PAC throws exceptions if these are capitalized; presumably this is case sensitive, and all-lowercase unlike everything else. Change-Id: Ifc0cef38e333123e810376ab6a7630443d253841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154282 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-06ScanlineFormat::N1BitLsbPal is unusedNoel Grandin1-33/+3
ever since commit 4160be791daaef1a0c059a248f678cbad6408a69 Author: Caolán McNamara <caolanm@redhat.com> Date: Tue Jan 10 20:55:31 2023 +0000 no more X11SalBitmap Change-Id: I9dd55acdde6af1bf7501a71e92725ab739801b0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154060 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-04tdf#156151: Take PDF DPI into account when outputting Type 3 glyphsKhaled Hosny1-3/+10
We were always assuming the default 720 DPI, but this is not always true when printing to file as the DPI would depend on printer settings in this case. Change-Id: I747f8e24f0942ecb94eb8acfc1dd9972d83ba0e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153978 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-04tdf#152235 filter,vcl: PDF/UA export: tag watermark as ArtifactMichael Stahl1-2/+2
Change-Id: I64e57a832678be935b69a5cea328cc252a4bf29d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153951 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-03tdf#48707: Explicitly set overline color in PDF exportKhaled Hosny1-0/+3
Like we do with underline color, so that color does not leak from elsewhere. Change-Id: I3716a117a0d0a1260e47cbfed2242f401a09d7b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153877 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-03tdf#152231 vcl: PDF/UA export: content of comments in the marginMichael Stahl1-6/+7
... is also Artifact. The problem is that ImpEditEngine::Paint() always produces tags, it can't easily check if it's inside a layout environment that is an Artifact. But it looks like PDFWriterImpl::beginStructureElement() already wants to handle and suppress a structure element inside a NonStruct, except that it calls endStructureElementMCSeq() before checkEmitStructure(), so no structure marked content sequence is produced, but the content is outside the Artifact marked content sequence, and possibly a second Artifact marked content sequence will be opened once the structure element is finished. (btw, it's allowed to nest marked content sequences in PDF, but nesting a structure element inside an Artifact appears dubious) Change-Id: Ib3eef9c611e28242854c712ce974fd8cfecd8ac2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153810 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-30tdf#156084: Fix PDF export of bitmap color fontsKhaled Hosny1-3/+2
A regression from the commit below caused the resources dictionary of the Type 3 font to be omitted making the images inaccessible: commit 845fbfcce9091e541bab657163b026aad8648261 Author: Khaled Hosny <khaled@libreoffice.org> Date: Thu Jun 15 06:27:38 2023 +0300 Don’t add empty Fonts dictionary to Type 3 font resources Change-Id: I479ca328bd1b1228ba722678d3d9686c8456b350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153780 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-20tdf#115321: Fix PDF position of emphasis mark in vertical textKhaled Hosny1-3/+26
This aligns the code in PDF writer with OutputDevice::ImplDrawEmphasisMarks(). Change-Id: I404beda30ff0eb1d6c59d971a7daa59b559ef70f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153326 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-15Use sal_Int32 instead of overzealous use of autoKhaled Hosny1-1/+1
Change-Id: Ia307f398260343fe388965673da42d9404195224 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153117 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>