Bug 144653 - The command ".uno:ExportToPDF" ignore all given options in FilterData argument.
Summary: The command ".uno:ExportToPDF" ignore all given options in FilterData argument.
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
Whiteboard: QA:needsComment
Depends on:
Blocks: PDF-Export PDF-Export-Options-Dialog UNO
  Show dependency treegraph
Reported: 2021-09-22 08:30 UTC by grv0815
Modified: 2021-11-23 01:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description grv0815 2021-09-22 08:30:17 UTC
I recorded two pdf exports of a writer document with different quality and resolution setting with the macro recorder. You can find the shortened result below.
The code create two pdf files with the given filenames but this files are identical. The export use for both calls the once manually given options from the export dialog. Afaik, this should be only with the ".uno:ExportDirectToPDF" command.

Here is the recorded basic macro:

sub PDF_Export
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///C:/Users/###Path to File###-OrigDPI-lossless.pdf"
args1(1).Name = "FilterName"
args1(1).Value = "writer_pdf_Export"
args1(2).Name = "FilterData"
args1(2).Value = Array(Array("UseLosslessCompression",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Quality",0,90,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ReduceImageResolution",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("MaxImageResolution",0,150,com.sun.star.beans.PropertyState.DIRECT_VALUE),###and so on###)

dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "URL"
args2(0).Value = "file:///C:/Users/###Path to File###-OrigDPI-95vH.pdf"
args2(1).Name = "FilterName"
args2(1).Value = "writer_pdf_Export"
args2(2).Name = "FilterData"
args2(2).Value = Array(Array("UseLosslessCompression",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Quality",0,95,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ReduceImageResolution",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("MaxImageResolution",0,150,com.sun.star.beans.PropertyState.DIRECT_VALUE),###and so on###)

dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args2())

Steps to Reproduce:
1. Open writer document with a "big" picture.
2. start the macro recorder.
3. Export as PDF with the options UseLosslessCompression=true and ReduceImageResolution=false into File A.pdf
4. Export as PDF with the options Quality=60% and ReduceImageResolution=75dpi into File B.pdf
5. stop macro recording and run the created basic macro

Actual Results:
The files A.pdf and B.pdf have the same size and both include the 75dpi picture of poor 60% quality - because this was the last manually configured setting in the export pdf dialog.

Expected Results:
The Picture in File A.pdf should have the original resolution and quality, due to the settings UseLosslessCompression=true and ReduceImageResolution=false.
The Picture in File B.pdf should have the reduced resolution and quality, due to the settings Quality=60% and ReduceImageResolution=75dpi

Reproducible: Always

User Profile Reset: Yes

Additional Info:
First found in Version, updated to and now to

Version: (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-AT (de_AT); UI: de-DE
Calc: CL

The bug is in all three versions reproducible