filter/source/pdf/impdialog.cxx | 4 - filter/source/pdf/pdfexport.cxx | 2 filter/source/pdf/pdffilter.cxx | 2 officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 sc/qa/uitest/calc_tests4/exportToPDF.py | 4 - sd/qa/uitest/impress_tests/exportToPDF.py | 4 - sw/qa/core/text/itrform2.cxx | 4 + sw/qa/core/text/text.cxx | 11 +++++ sw/qa/inc/swmodeltestbase.hxx | 14 ++++++ sw/qa/uitest/writer_tests4/exportToPDF.py | 4 - sw/qa/unit/swmodeltestbase.cxx | 15 ++++++ vcl/CppunitTest_vcl_pdfexport.mk | 4 + vcl/qa/cppunit/pdfexport/pdfexport.cxx | 28 ++++++++++--- vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 20 +++++++-- 14 files changed, 98 insertions(+), 20 deletions(-)
New commits: commit 159d823c7b7502ee07d897d74c4e74c6e1873596 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Jul 30 08:28:16 2024 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Jul 30 12:16:50 2024 +0200 tdf#153040 PDF export: disable export of form fields as PDF forms by default Open <https://bugs.documentfoundation.org/attachment.cgi?id=195586>, notice that from "bbb", the middle "b" is bold, export to PDF, none of the "b"s are bold. The reason for this is that by default we map form controls and content controls to fillable PDF forms, which can only contain plain text. Fix the problem by defaulting to not exporting form controls / content controls to PDF forms: most users just want a PDF that is close to what they saw in the edit window -- and the ones who want a fillable PDF form can still opt in. Once the UI checkbox is enabled, we even remember that. Based on <https://gerrit.libreoffice.org/c/core/+/152622>, thanks Justin! Change-Id: Iddb75d1dbd969045321e139154f254c059eebf16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171226 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index ae822ad7a720..0ce804066362 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -80,7 +80,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property mbIsExportPlaceholders( false ), mbAddStream( false ), mnFormsType( 0 ), - mbExportFormFields( true ), + mbExportFormFields( false ), mbAllowDuplicateFieldNames( false ), mbExportBookmarks( true ), mbExportHiddenSlides ( false ), @@ -213,7 +213,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property mbIsExportPlaceholders = maConfigItem.ReadBool( u"ExportPlaceholders"_ustr, false ); mbAddStream = maConfigItem.ReadBool( u"IsAddStream"_ustr, false ); - mbExportFormFields = maConfigItem.ReadBool( u"ExportFormFields"_ustr, true ); + mbExportFormFields = maConfigItem.ReadBool( u"ExportFormFields"_ustr, false ); mnFormsType = maConfigItem.ReadInt32( u"FormsType"_ustr, 0 ); if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) ) mnFormsType = 0; diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8029958001ea..dac9e816bfe2 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -408,7 +408,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& bool bExportNotesPages = false; bool bExportOnlyNotesPages = false; bool bUseTransitionEffects = true; - bool bExportFormFields = true; + bool bExportFormFields = false; sal_Int32 nFormsFormat = 0; bool bAllowDuplicateFieldNames = false; bool bHideViewerToolbar = false; diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index 70bc8d9b14a8..373c7d859787 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -110,7 +110,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) aCfgItem.ReadBool( u"ExportOnlyNotesPages"_ustr, false ); aCfgItem.ReadBool( u"UseTransitionEffects"_ustr, true ); aCfgItem.ReadBool( u"IsSkipEmptyPages"_ustr, false ); - aCfgItem.ReadBool( u"ExportFormFields"_ustr, true ); + aCfgItem.ReadBool( u"ExportFormFields"_ustr, false ); aCfgItem.ReadInt32( u"FormsType"_ustr, 0 ); aCfgItem.ReadBool( u"HideViewerToolbar"_ustr, false ); aCfgItem.ReadBool( u"HideViewerMenubar"_ustr, false ); diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index d55a89369c25..fae4d7310201 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -4723,7 +4723,7 @@ <desc>Specifies whether form fields are exported as widgets or only their fixed print representation is exported.</desc> </info> - <value>true</value> + <value>false</value> </prop> <prop oor:name="FormsType" oor:type="xs:int" oor:nillable="false"> <info> diff --git a/sc/qa/uitest/calc_tests4/exportToPDF.py b/sc/qa/uitest/calc_tests4/exportToPDF.py index 777d9899e421..a2cd0e55a451 100644 --- a/sc/qa/uitest/calc_tests4/exportToPDF.py +++ b/sc/qa/uitest/calc_tests4/exportToPDF.py @@ -35,13 +35,13 @@ class exportToPDF(UITestCase): with self.ui_test.execute_dialog_through_command('.uno:ExportToPDF', close_button="") as xDialog: selectedChildren = ['bookmarks', 'display', 'effects', 'enablea11y', - 'enablecopy', 'exporturl', 'forms', 'reduceresolution', 'tagged'] + 'enablecopy', 'exporturl', 'reduceresolution', 'tagged'] for child in selectedChildren: self.assertEqual("true", get_state_as_dict(xDialog.getChild(child))['Selected']) nonSelectedChildren = ['allowdups', 'center', 'comments', 'convert', 'embed', 'emptypages', 'export', 'exportplaceholders', - 'firstonleft', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', + 'firstonleft', 'forms', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', 'toolbar', 'usereferencexobject', 'viewpdf', 'watermark', 'window'] for child in nonSelectedChildren: diff --git a/sd/qa/uitest/impress_tests/exportToPDF.py b/sd/qa/uitest/impress_tests/exportToPDF.py index 8e7466823b8e..6cf6a63e1da0 100644 --- a/sd/qa/uitest/impress_tests/exportToPDF.py +++ b/sd/qa/uitest/impress_tests/exportToPDF.py @@ -37,13 +37,13 @@ class exportToPDF(UITestCase): with self.ui_test.execute_dialog_through_command('.uno:ExportToPDF', close_button="") as xDialog: selectedChildren = ['bookmarks', 'display', 'effects', 'enablea11y', - 'enablecopy', 'exporturl', 'forms', 'reduceresolution', 'tagged'] + 'enablecopy', 'exporturl', 'reduceresolution', 'tagged'] for child in selectedChildren: self.assertEqual("true", get_state_as_dict(xDialog.getChild(child))['Selected']) nonSelectedChildren = ['allowdups', 'center', 'comments', 'convert', 'embed', 'emptypages', 'export', 'exportplaceholders', - 'firstonleft', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', + 'firstonleft', 'forms', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', 'toolbar', 'usereferencexobject', 'viewpdf', 'watermark', 'window'] for child in nonSelectedChildren: diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx index 00ea3debe556..79d017058095 100644 --- a/sw/qa/core/text/itrform2.cxx +++ b/sw/qa/core/text/itrform2.cxx @@ -204,6 +204,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckedCheckboxContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a checked checkbox content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -240,6 +241,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFFontColor) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a document with a custom orange font color and a content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -272,6 +274,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownText) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a document with a dropdown: custom default text and 3 items: createSwDoc(); uno::Reference<lang::XMultiServiceFactory> xMSF(mxComponent, uno::UNO_QUERY); @@ -336,6 +339,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFComments) // When exporting to PDF, exporting notes in master (and not as widgets): uno::Sequence<beans::PropertyValue> aFilterData = { + comphelper::makePropertyValue(u"ExportFormFields"_ustr, true), comphelper::makePropertyValue(u"ExportNotes"_ustr, false), comphelper::makePropertyValue(u"ExportNotesInMargin"_ustr, true), }; diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 2ca30c713f03..74a5c9507d38 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -219,6 +219,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159924) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159336) { + SwExportFormFieldsGuard g; createSwDoc("tdf159336.odt"); save(u"writer_pdf_Export"_ustr); @@ -1042,6 +1043,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1089,6 +1091,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPlaceholderPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a content control, in placeholder mode: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1117,6 +1120,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a checkbox content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1147,6 +1151,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a dropdown content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1177,6 +1182,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF2) if (!pPDFium) return; + SwExportFormFieldsGuard g; createSwDoc("tdf153040.docx"); save(u"writer_pdf_Export"_ustr); @@ -1201,6 +1207,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDateContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a date content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1234,6 +1241,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a document with a custom 24pt font size and a content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1266,6 +1274,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a combo box content control: createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1297,6 +1306,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRichContentControlPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a rich content control, its value set to "xxx<b>yyy</b>": createSwDoc(); SwDoc* pDoc = getSwDoc(); @@ -1333,6 +1343,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testPlaceholderFieldPDF) if (!pPDFium) return; + SwExportFormFieldsGuard g; // Given a file with a text-type placeholder field: createSwDoc("placeholder.fodt"); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 322b25f9582b..2c0605e29010 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -61,6 +61,10 @@ #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) class SwXTextDocument; +namespace comphelper +{ +class ConfigurationChanges; +} namespace vcl { namespace pdf @@ -69,6 +73,16 @@ class PDFiumDocument; } } +/// Temporarily enables the ExportFormFields setting. +class SWQAHELPER_DLLPUBLIC SwExportFormFieldsGuard +{ + std::shared_ptr<comphelper::ConfigurationChanges> m_pBatch; + bool m_bValue; +public: + SwExportFormFieldsGuard(); + ~SwExportFormFieldsGuard(); +}; + /// Base class for filter tests loading or roundtripping a document, then asserting the document model. class SWQAHELPER_DLLPUBLIC SwModelTestBase : public UnoApiXmlTest { diff --git a/sw/qa/uitest/writer_tests4/exportToPDF.py b/sw/qa/uitest/writer_tests4/exportToPDF.py index 7d747d269a64..e2ca9d72bd34 100644 --- a/sw/qa/uitest/writer_tests4/exportToPDF.py +++ b/sw/qa/uitest/writer_tests4/exportToPDF.py @@ -33,13 +33,13 @@ class exportToPDF(UITestCase): with self.ui_test.execute_dialog_through_command('.uno:ExportToPDF', close_button="") as xDialog: selectedChildren = ['bookmarks', 'display', 'effects', 'enablea11y', - 'enablecopy', 'exporturl', 'forms', 'reduceresolution', 'tagged'] + 'enablecopy', 'exporturl', 'reduceresolution', 'tagged'] for child in selectedChildren: self.assertEqual("true", get_state_as_dict(xDialog.getChild(child))['Selected']) nonSelectedChildren = ['allowdups', 'center', 'comments', 'convert', 'embed', 'emptypages', 'export', 'exportplaceholders', - 'firstonleft', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', + 'firstonleft', 'forms', 'hiddenpages', 'menubar', 'notes', 'onlynotes', 'open', 'pdfa', 'pdfua', 'resize', 'singlepagesheets', 'toolbar', 'usereferencexobject', 'viewpdf', 'watermark', 'window'] for child in nonSelectedChildren: diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 58500587660b..84437dffd5e5 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -25,6 +25,7 @@ #include <vcl/scheduler.hxx> #include <comphelper/configuration.hxx> #include <officecfg/Office/Writer.hxx> +#include <officecfg/Office/Common.hxx> #include <IDocumentLayoutAccess.hxx> #include <docsh.hxx> @@ -558,4 +559,18 @@ void SwModelTestBase::emulateTyping(SwXTextDocument& rTextDoc, const std::u16str } } +SwExportFormFieldsGuard::SwExportFormFieldsGuard() +{ + m_pBatch = comphelper::ConfigurationChanges::create(); + m_bValue = officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::get(); + officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::set(true, m_pBatch); + m_pBatch->commit(); +} + +SwExportFormFieldsGuard::~SwExportFormFieldsGuard() +{ + officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::set(m_bValue, m_pBatch); + m_pBatch->commit(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/CppunitTest_vcl_pdfexport.mk b/vcl/CppunitTest_vcl_pdfexport.mk index 33716f5dad36..e04d9d437480 100644 --- a/vcl/CppunitTest_vcl_pdfexport.mk +++ b/vcl/CppunitTest_vcl_pdfexport.mk @@ -42,6 +42,10 @@ $(eval $(call gb_CppunitTest_use_vcl,vcl_pdfexport)) $(eval $(call gb_CppunitTest_use_rdb,vcl_pdfexport,services)) +$(eval $(call gb_CppunitTest_use_custom_headers,vcl_pdfexport,\ + officecfg/registry \ +)) + $(eval $(call gb_CppunitTest_use_configuration,vcl_pdfexport)) # assert if font/glyph fallback occurs diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 1195985703cf..d033b71bb11c 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -23,6 +23,7 @@ #include <vcl/filter/pdfdocument.hxx> #include <tools/zcodec.hxx> #include <o3tl/string_view.hxx> +#include <officecfg/Office/Common.hxx> #include <vcl/filter/PDFiumLibrary.hxx> @@ -43,7 +44,8 @@ public: } void saveAsPDF(std::u16string_view rFile); - void load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument); + void load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument, + bool bUseExportFormFields = false); }; void PdfExportTest::saveAsPDF(std::u16string_view rFile) @@ -54,8 +56,16 @@ void PdfExportTest::saveAsPDF(std::u16string_view rFile) saveWithParams(aMediaDescriptor.getAsConstPropertyValueList()); } -void PdfExportTest::load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument) +void PdfExportTest::load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument, + bool bUseExportFormFields) { + if (bUseExportFormFields) + { + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "ExportFormFields", uno::Any(bUseExportFormFields) }, + })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; + } saveAsPDF(rFile); // Parse the export result. @@ -340,6 +350,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106206) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf127217) { // Import the bugdoc and export as PDF. + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "ExportFormFields", uno::Any(true) }, + })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; saveAsPDF(u"tdf127217.odt"); // Parse the export result with pdfium. @@ -577,6 +591,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107018) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148706) { // Import the bugdoc and export as PDF. + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "ExportFormFields", uno::Any(true) }, + })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; saveAsPDF(u"tdf148706.odt"); // Parse the export result with pdfium. @@ -857,7 +875,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testAlternativeText) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105972) { vcl::filter::PDFDocument aDocument; - load(u"tdf105972.fodt", aDocument); + load(u"tdf105972.fodt", aDocument, /*bUseExportFormFields=*/true); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -921,7 +939,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105972) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148442) { vcl::filter::PDFDocument aDocument; - load(u"tdf148442.odt", aDocument); + load(u"tdf148442.odt", aDocument, /*bUseExportFormFields=*/true); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -990,7 +1008,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148442) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf118244_radioButtonGroup) { vcl::filter::PDFDocument aDocument; - load(u"tdf118244_radioButtonGroup.odt", aDocument); + load(u"tdf118244_radioButtonGroup.odt", aDocument, /*bUseExportFormFields=*/true); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 0501c346d0f1..f34f5914efaa 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -803,6 +803,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testMultiPagePDF) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testFormFontName) { // Import the bugdoc and export as PDF. + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "ExportFormFields", uno::Any(true) }, + })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; saveAsPDF(u"form-font-name.odt"); // Parse the export result with pdfium. @@ -2772,8 +2776,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf154982) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf157397) { // Enable PDF/UA - uno::Sequence<beans::PropertyValue> aFilterData( - comphelper::InitPropertySequence({ { "PDFUACompliance", uno::Any(true) } })); + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "PDFUACompliance", uno::Any(true) }, + { "ExportFormFields", uno::Any(true) }, + })); aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; vcl::filter::PDFDocument aDocument; @@ -3698,8 +3704,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testFlyFrameHyperlinkAnnot) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testFormControlAnnot) { // Enable PDF/UA - uno::Sequence<beans::PropertyValue> aFilterData( - comphelper::InitPropertySequence({ { "PDFUACompliance", uno::Any(true) } })); + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "PDFUACompliance", uno::Any(true) }, + { "ExportFormFields", uno::Any(true) }, + })); aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; vcl::filter::PDFDocument aDocument; @@ -4586,6 +4594,10 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testRexportResourceItemReference) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152246) { // Import the bugdoc and export as PDF. + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "ExportFormFields", uno::Any(true) }, + })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; vcl::filter::PDFDocument aDocument; load(u"content-control-rtl.docx", aDocument);