21#include <osl/file.hxx>
30#include <rtl/ustring.hxx>
41#include <officecfg/Office/Common.hxx>
46#include <com/sun/star/beans/XPropertySet.hpp>
47#include <com/sun/star/configuration/theDefaultProvider.hpp>
48#include <com/sun/star/awt/XDevice.hpp>
49#include <com/sun/star/frame/XModel.hpp>
50#include <com/sun/star/frame/ModuleManager.hpp>
51#include <com/sun/star/frame/XStorable.hpp>
52#include <com/sun/star/document/XDocumentProperties.hpp>
53#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
54#include <com/sun/star/container/XNameAccess.hpp>
55#include <com/sun/star/view/XViewSettingsSupplier.hpp>
56#include <com/sun/star/task/XInteractionRequest.hpp>
57#include <com/sun/star/task/PDFExportException.hpp>
58#include <com/sun/star/io/IOException.hpp>
59#include <com/sun/star/io/XOutputStream.hpp>
60#include <com/sun/star/lang/XServiceInfo.hpp>
61#include <com/sun/star/drawing/XShapes.hpp>
62#include <com/sun/star/security/XCertificate.hpp>
63#include <com/sun/star/beans/XMaterialHolder.hpp>
64#include <com/sun/star/xml/crypto/SEInitializer.hpp>
78 const Reference< task::XStatusIndicator >& rxStatusIndicator,
79 const Reference< task::XInteractionHandler >& rxIH,
80 const Reference< XComponentContext >& xContext ) :
81 mxSrcDoc ( rxSrcDoc ),
85 mbUseTaggedPDF ( false ),
86 mnPDFTypeSelection ( 0 ),
87 mbPDFUACompliance ( false),
88 mbExportNotes ( true ),
89 mbExportNotesInMargin ( false ),
90 mbExportPlaceholders ( false ),
91 mbUseReferenceXObject ( false ),
92 mbExportNotesPages ( false ),
93 mbExportOnlyNotesPages ( false ),
94 mbUseTransitionEffects ( true ),
95 mbExportBookmarks ( true ),
96 mbExportHiddenSlides ( false ),
97 mbSinglePageSheets ( false ),
98 mnOpenBookmarkLevels ( -1 ),
99 mbUseLosslessCompression ( false ),
100 mbReduceImageResolution ( true ),
101 mbSkipEmptyPages ( true ),
102 mbAddStream ( false ),
103 mnMaxImageResolution ( 300 ),
106 mbExportFormFields ( true ),
107 mbAllowDuplicateFieldNames ( false ),
108 mnProgressValue ( 0 ),
109 mbRemoveTransparencies ( false ),
111 mbIsRedactMode ( false ),
113 maWatermarkFontName (
"Helvetica" ),
115 mbHideViewerToolbar ( false ),
116 mbHideViewerMenubar ( false ),
117 mbHideViewerWindowControls ( false ),
118 mbFitWindow ( false ),
119 mbCenterWindow ( false ),
120 mbOpenInFullScreenMode ( false ),
121 mbDisplayPDFDocumentTitle ( true ),
122 mnPDFDocumentMode ( 0 ),
123 mnPDFDocumentAction ( 0 ),
126 mnPDFPageLayout ( 0 ),
129 mbRestrictPermissions ( false ),
130 mnPrintAllowed ( 2 ),
131 mnChangesAllowed ( 4 ),
132 mbCanCopyOrExtract ( true ),
133 mbCanExtractForAccessibility( true ),
136 mbExportRelativeFsysLinks ( false ),
137 mnDefaultLinkAction ( 0 ),
138 mbConvertOOoTargetToPDFTarget( false ),
139 mbExportBmkToDest ( false ),
151 Reference< css::view::XRenderable >
const & rRenderable,
152 const Any& rSelection,
154 Sequence< PropertyValue >& rRenderOptions,
155 sal_Int32 nPageCount )
160 Any* pFirstPage =
nullptr;
161 Any* pLastPage =
nullptr;
163 bool bExportNotesPages =
false;
165 auto rRenderOptionsRange = asNonConstRange(rRenderOptions);
166 for( sal_Int32 nData = 0, nDataCount = rRenderOptions.getLength(); nData < nDataCount; ++nData )
168 if ( rRenderOptions[ nData ].
Name ==
"IsFirstPage" )
169 pFirstPage = &rRenderOptionsRange[ nData ].Value;
170 else if ( rRenderOptions[ nData ].
Name ==
"IsLastPage" )
171 pLastPage = &rRenderOptionsRange[ nData ].Value;
172 else if ( rRenderOptions[ nData ].
Name ==
"ExportNotesPages" )
173 rRenderOptionsRange[ nData ].Value >>= bExportNotesPages;
185 sal_Int32 nCurrentPage(0);
188 while ( aIter != aEnd )
190 const Sequence< PropertyValue > aRenderer( rRenderable->getRenderer( *aIter, rSelection, rRenderOptions ) );
193 for(
const PropertyValue& rProp : aRenderer )
195 if ( rProp.Name ==
"PageSize" )
197 rProp.Value >>= aPageSize;
205 const MapMode aMapMode( MapUnit::Map100thMM );
206 const Size aMtfSize( aPageSize.Width, aPageSize.Height );
209 pOut->EnableOutput(
false );
210 pOut->SetMapMode( aMapMode );
218 const sal_Int32 nCurrentRenderer = *aIter;
220 if ( pLastPage && aIter == aEnd )
223 rRenderable->render( nCurrentRenderer, rSelection, rRenderOptions );
228 bool bEmptyPage =
false;
263 *pFirstPage <<=
false;
277 rPDFWriter.
NewPage( 10000, 10000 );
294 Reference< XComponent > m_xSrcDoc;
295 Sequence< beans::NamedValue > m_aPreparedPassword;
299 PDFExportStreamDoc(
const Reference< XComponent >& xDoc,
const Sequence<beans::NamedValue>& rPwd )
301 m_aPreparedPassword( rPwd )
304 virtual void write(
const Reference< XOutputStream >& xStream )
override;
309void PDFExportStreamDoc::write(
const Reference< XOutputStream >& xStream )
311 Reference< css::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY );
315 std::vector<beans::PropertyValue> aArgs {
319 if (m_aPreparedPassword.hasElements())
333 const Reference< XComponent >& xDoc )
noexcept
335 OUString aDocMimetype;
339 Reference< css::frame::XStorable > xStore( xDoc, UNO_QUERY );
340 Reference< frame::XModuleManager2 > xModuleManager = frame::ModuleManager::create(xContext);
343 OUString aDocServiceName = xModuleManager->identify( Reference< XInterface >( xStore, uno::UNO_QUERY ) );
344 if ( !aDocServiceName.isEmpty() )
347 Reference< lang::XMultiServiceFactory > xConfigProvider =
348 configuration::theDefaultProvider::get( xContext );
349 beans::NamedValue aPathProp;
350 aPathProp.Name =
"nodepath";
351 aPathProp.Value <<= OUString(
"/org.openoffice.Setup/Office/Factories/" );
352 uno::Sequence< uno::Any > aArgs{
uno::Any(aPathProp) };
354 Reference< container::XNameAccess > xSOFConfig(
355 xConfigProvider->createInstanceWithArguments(
356 "com.sun.star.configuration.ConfigurationAccess", aArgs ),
359 Reference< container::XNameAccess > xApplConfig;
360 xSOFConfig->getByName( aDocServiceName ) >>= xApplConfig;
361 if ( xApplConfig.is() )
363 OUString aFilterName;
364 xApplConfig->getByName(
"ooSetupFactoryActualFilter" ) >>= aFilterName;
365 if( !aFilterName.isEmpty() )
369 Reference< container::XNameAccess > xFilterFactory(
370 xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.document.FilterFactory", xContext),
373 Sequence< beans::PropertyValue > aFilterData;
374 xFilterFactory->getByName( aFilterName ) >>= aFilterData;
375 for (
const beans::PropertyValue& rProp : std::as_const(aFilterData) )
376 if ( rProp.Name ==
"Type" )
377 rProp.Value >>= aTypeName;
379 if ( !aTypeName.isEmpty() )
382 Reference< container::XNameAccess > xTypeDetection(
383 xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.document.TypeDetection", xContext),
386 Sequence< beans::PropertyValue > aTypeData;
387 xTypeDetection->getByName( aTypeName ) >>= aTypeData;
388 for (
const beans::PropertyValue& rProp : std::as_const(aTypeData) )
389 if ( rProp.Name ==
"MediaType" )
390 rProp.Value >>= aDocMimetype;
403uno::Reference<security::XCertificate>
406 uno::Reference<xml::crypto::XSEInitializer> xSEInitializer
407 = xml::crypto::SEInitializer::create(
mxContext);
408 uno::Reference<xml::crypto::XXMLSecurityContext> xSecurityContext
409 = xSEInitializer->createSecurityContext(OUString());
410 uno::Reference<xml::crypto::XSecurityEnvironment> xSecurityEnvironment
411 = xSecurityContext->getSecurityEnvironment();
412 for (
const auto& xCertificate : xSecurityEnvironment->getPersonalCertificates())
414 if (xCertificate->getSubjectName() == rSubjectName)
428 std::set< vcl::PDFWriter::ErrorCode > aErrors;
430 if(
aURL.GetProtocol() != INetProtocol::File )
434 if( osl::FileBase::getFileURLFromSystemPath( rFile, aTmp ) == osl::FileBase::E_None )
438 if(
aURL.GetProtocol() == INetProtocol::File )
440 Reference< XRenderable > xRenderable(
mxSrcDoc, UNO_QUERY );
442 if( xRenderable.is() )
448 OUString aOpenPassword, aPermissionPassword;
449 Reference< beans::XMaterialHolder > xEnc;
450 Sequence< beans::NamedValue > aPreparedPermissionPassword;
455 Reference< XServiceInfo > xInfo(
mxSrcDoc, UNO_QUERY );
458 if ( xInfo->supportsService(
"com.sun.star.presentation.PresentationDocument" ) )
459 aCreator +=
"Impress";
460 else if ( xInfo->supportsService(
"com.sun.star.drawing.DrawingDocument" ) )
462 else if ( xInfo->supportsService(
"com.sun.star.text.TextDocument" ) )
463 aCreator +=
"Writer";
464 else if ( xInfo->supportsService(
"com.sun.star.sheet.SpreadsheetDocument" ) )
466 else if ( xInfo->supportsService(
"com.sun.star.formula.FormulaProperties" ) )
470 Reference< document::XDocumentPropertiesSupplier > xDocumentPropsSupplier(
mxSrcDoc, UNO_QUERY );
471 if ( xDocumentPropsSupplier.is() )
473 Reference< document::XDocumentProperties > xDocumentProps( xDocumentPropsSupplier->getDocumentProperties() );
474 if ( xDocumentProps.is() )
479 aContext.
DocumentInfo.
Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
486 OUString aProducerOverride = officecfg::Office::Common::Save::Document::GeneratorOverride::get();
487 if (!aProducerOverride.isEmpty())
498 OUString aSignCertificateSubjectName;
499 for (
const beans::PropertyValue& rProp : rFilterData )
501 if ( rProp.Name ==
"PageRange" )
502 rProp.Value >>= aPageRange;
503 else if ( rProp.Name ==
"Selection" )
504 aSelection = rProp.Value;
505 else if ( rProp.Name ==
"UseLosslessCompression" )
507 else if ( rProp.Name ==
"Quality" )
509 else if ( rProp.Name ==
"ReduceImageResolution" )
511 else if ( rProp.Name ==
"IsSkipEmptyPages" )
513 else if ( rProp.Name ==
"MaxImageResolution" )
515 else if ( rProp.Name ==
"UseTaggedPDF" )
517 else if ( rProp.Name ==
"SelectPdfVersion" )
519 else if ( rProp.Name ==
"PDFUACompliance" )
521 else if ( rProp.Name ==
"ExportNotes" )
523 else if ( rProp.Name ==
"ExportNotesInMargin" )
525 else if ( rProp.Name ==
"ExportNotesPages" )
527 else if ( rProp.Name ==
"ExportOnlyNotesPages" )
529 else if ( rProp.Name ==
"UseTransitionEffects" )
531 else if ( rProp.Name ==
"ExportFormFields" )
533 else if ( rProp.Name ==
"FormsType" )
535 else if ( rProp.Name ==
"AllowDuplicateFieldNames" )
538 else if ( rProp.Name ==
"HideViewerToolbar" )
540 else if ( rProp.Name ==
"HideViewerMenubar" )
542 else if ( rProp.Name ==
"HideViewerWindowControls" )
544 else if ( rProp.Name ==
"ResizeWindowToInitialPage" )
546 else if ( rProp.Name ==
"CenterWindow" )
548 else if ( rProp.Name ==
"OpenInFullScreenMode" )
550 else if ( rProp.Name ==
"DisplayPDFDocumentTitle" )
552 else if ( rProp.Name ==
"InitialView" )
554 else if ( rProp.Name ==
"Magnification" )
556 else if ( rProp.Name ==
"Zoom" )
558 else if ( rProp.Name ==
"InitialPage" )
560 else if ( rProp.Name ==
"PageLayout" )
562 else if ( rProp.Name ==
"FirstPageOnLeft" )
564 else if ( rProp.Name ==
"IsAddStream" )
566 else if ( rProp.Name ==
"Watermark" )
568 else if ( rProp.Name ==
"WatermarkColor" )
571 if (rProp.Value >>= nColor)
576 else if (rProp.Name ==
"WatermarkFontHeight")
578 sal_Int32 nFontHeight{};
579 if (rProp.Value >>= nFontHeight)
584 else if (rProp.Name ==
"WatermarkRotateAngle")
586 sal_Int32 nRotateAngle{};
587 if (rProp.Value >>= nRotateAngle)
592 else if (rProp.Name ==
"WatermarkFontName")
594 OUString aFontName{};
595 if (rProp.Value >>= aFontName)
600 else if ( rProp.Name ==
"TiledWatermark" )
603 else if ( rProp.Name ==
"EncryptFile" )
605 else if ( rProp.Name ==
"DocumentOpenPassword" )
606 rProp.Value >>= aOpenPassword;
607 else if ( rProp.Name ==
"RestrictPermissions" )
609 else if ( rProp.Name ==
"PermissionPassword" )
610 rProp.Value >>= aPermissionPassword;
611 else if ( rProp.Name ==
"PreparedPasswords" )
612 rProp.Value >>= xEnc;
613 else if ( rProp.Name ==
"PreparedPermissionPassword" )
614 rProp.Value >>= aPreparedPermissionPassword;
615 else if ( rProp.Name ==
"Printing" )
617 else if ( rProp.Name ==
"Changes" )
619 else if ( rProp.Name ==
"EnableCopyingOfContent" )
621 else if ( rProp.Name ==
"EnableTextAccessForAccessibilityTools" )
624 else if ( rProp.Name ==
"ExportLinksRelativeFsys" )
626 else if ( rProp.Name ==
"PDFViewSelection" )
628 else if ( rProp.Name ==
"ConvertOOoTargetToPDFTarget" )
630 else if ( rProp.Name ==
"ExportBookmarksToPDFDestination" )
632 else if ( rProp.Name ==
"ExportBookmarks" )
634 else if ( rProp.Name ==
"ExportHiddenSlides" )
636 else if ( rProp.Name ==
"SinglePageSheets" )
638 else if ( rProp.Name ==
"OpenBookmarkLevels" )
640 else if ( rProp.Name ==
"SignPDF" )
642 else if ( rProp.Name ==
"SignatureLocation" )
644 else if ( rProp.Name ==
"SignatureReason" )
646 else if ( rProp.Name ==
"SignatureContactInfo" )
648 else if ( rProp.Name ==
"SignaturePassword" )
650 else if ( rProp.Name ==
"SignatureCertificate" )
652 else if (rProp.Name ==
"SignCertificateSubjectName")
653 rProp.Value >>= aSignCertificateSubjectName;
654 else if ( rProp.Name ==
"SignatureTSA" )
656 else if ( rProp.Name ==
"ExportPlaceholders" )
658 else if ( rProp.Name ==
"UseReferenceXObject" )
661 else if ( rProp.Name ==
"IsRedactMode" )
677 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_1_7;
680 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_A_1;
687 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_A_2;
694 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_A_3;
701 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_1_5;
704 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_1_6;
707 aContext.
Version = vcl::PDFWriter::PDFVersion::PDF_1_7;
791 if( aContext.
Version != vcl::PDFWriter::PDFVersion::PDF_A_1 )
847 if(
mbEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.hasElements() )
853 aPermissionPassword.clear();
854 aOpenPassword.clear();
908 if( aContext.
Version == vcl::PDFWriter::PDFVersion::PDF_A_1 &&
932 xDevice->SetOutputDevice(
pOut);
940 if (aSrcMimetype ==
"application/vnd.oasis.opendocument.text")
942 else if (aSrcMimetype ==
"application/vnd.oasis.opendocument.presentation")
944 else if (aSrcMimetype ==
"application/vnd.oasis.opendocument.spreadsheet")
946 else if (aSrcMimetype ==
"application/vnd.oasis.opendocument.graphics")
948 std::unique_ptr<vcl::PDFOutputStream> pStream(
new PDFExportStreamDoc(
mxSrcDoc, aPreparedPermissionPassword));
949 aPDFWriter.
AddAttachedFile(
"Original" + aExt, aSrcMimetype,
u"Embedded original document of this PDF file", std::move(pStream));
954 DBG_ASSERT(
pOut->GetExtOutDevData() ==
nullptr,
"PDFExport: ExtOutDevData already set!!!" );
956 pOut->SetExtOutDevData( &aPDFExtOutDevData );
970 Sequence< PropertyValue > aRenderOptions{
981 Any& rExportNotesValue = aRenderOptions.getArray()[ 1 ].Value;
983 if( !aPageRange.isEmpty() || !aSelection.hasValue() )
988 bool bExportNotesPages =
false;
989 bool bReChangeToNormalView =
false;
990 static constexpr OUStringLiteral sShowOnlineLayout(
u"ShowOnlineLayout" );
991 bool bReHideWhitespace =
false;
992 static constexpr OUStringLiteral sHideWhitespace(
u"HideWhitespace");
993 uno::Reference< beans::XPropertySet > xViewProperties;
995 if ( aCreator ==
"Writer" )
1000 Reference< view::XViewSettingsSupplier > xVSettingsSupplier(
xModel->getCurrentController(), uno::UNO_QUERY_THROW );
1001 xViewProperties = xVSettingsSupplier->getViewSettings();
1002 xViewProperties->getPropertyValue( sShowOnlineLayout ) >>= bReChangeToNormalView;
1003 if( bReChangeToNormalView )
1005 xViewProperties->setPropertyValue( sShowOnlineLayout,
uno::Any(
false ) );
1009 xViewProperties->getPropertyValue(sHideWhitespace) >>= bReHideWhitespace;
1010 if (bReHideWhitespace)
1012 xViewProperties->setPropertyValue(sHideWhitespace,
uno::Any(
false));
1015 catch(
const uno::Exception& )
1021 const sal_Int32 nPageCount = xRenderable->getRendererCount( aSelection, aRenderOptions );
1025 uno::Reference< drawing::XShapes > xShapes;
1026 if ( ! ( aSelection >>= xShapes ) )
1027 bExportNotesPages =
true;
1033 aPageRange = OUString::number( 1 ) +
"-" + OUString::number(nPageCount );
1039 sal_Int32 nTotalPageCount = aRangeEnum.
size();
1040 if ( bExportPages && bExportNotesPages )
1041 nTotalPageCount *= 2;
1045 bRet = nPageCount > 0;
1047 if ( bRet && bExportPages )
1048 bRet =
ExportSelection( aPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount );
1050 if ( bRet && bExportNotesPages )
1052 rExportNotesValue <<=
true;
1053 bRet =
ExportSelection( aPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount );
1060 if( !rLoc.Language.isEmpty() )
1066 bRet = aPDFWriter.
Emit();
1069 pOut->SetExtOutDevData(
nullptr );
1070 if( bReChangeToNormalView )
1074 xViewProperties->setPropertyValue( sShowOnlineLayout,
uno::Any(
true ) );
1076 catch(
const uno::Exception& )
1080 if( bReHideWhitespace )
1084 xViewProperties->setPropertyValue( sHideWhitespace,
uno::Any(
true ) );
1086 catch(
const uno::Exception& )
1106class PDFErrorRequest :
public PDFErrorRequestBase
1108 task::PDFExportException maExc;
1110 explicit PDFErrorRequest( task::PDFExportException aExc );
1113 virtual uno::Any SAL_CALL getRequest()
override;
1114 virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
getContinuations()
override;
1118PDFErrorRequest::PDFErrorRequest( task::PDFExportException aExc ) :
1119 maExc(
std::move( aExc ))
1124uno::Any SAL_CALL PDFErrorRequest::getRequest()
1126 std::unique_lock guard( m_aMutex );
1134uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL PDFErrorRequest::getContinuations()
1136 return uno::Sequence< uno::Reference< task::XInteractionContinuation > >();
1144 if( ! rErrors.empty() &&
mxIH.is() )
1146 task::PDFExportException aExc;
1147 aExc.ErrorCodes = comphelper::containerToSequence<sal_Int32>( rErrors );
1148 Reference< task::XInteractionRequest > xReq(
new PDFErrorRequest( std::move(aExc) ) );
1149 mxIH->handle( xReq );
1191 rWriter.
PlayMetafile( aMtf, aCtx, &rPDFExtOutDevData );
1216 nTextWidth = rPageSize.
Height();
1227 nTextWidth = rPageSize.
Width();
1251 if( nNewHeight <= 0 )
1261 nTextHeight += nTextHeight/20;
1282 rPageSize.
Height()-(rPageSize.
Height()-nTextHeight)/2 );
1284 (rPageSize.
Height()-nTextHeight)/2 ),
1285 Size(
w, nTextHeight ) );
1289 aTextPoint =
Point( (rPageSize.
Width()-nTextHeight)/2,
1298 aTextPoint = aPageRectangle.
Center();
1309 aTextRect = aPageRectangle;
1325 const int lineLength = 21;
1340 int watermarkcount = ((rPageSize.
Width()) / 200)+1;
1342 OUString oneLineText = watermark;
1344 if(watermark.getLength() > lineLength)
1345 oneLineText = watermark.copy(0, lineLength);
1357 if(watermarkcount > 8)
1376 Point aTextPoint( (rPageSize.
Width()/2) - (((nTextWidth*watermarkcount)+(watermarkcount-1)*nTextWidth)/2),
1379 for(
int i = 0;
i < watermarkcount;
i ++)
1389 rWriter.
DrawText(aTextRect, watermark, DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter|DrawTextFlags::WordBreak|DrawTextFlags::Bottom);
1397 rWriter.
DrawText(aTextRect, watermark, DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter|DrawTextFlags::WordBreak|DrawTextFlags::Bottom);
1404 aTextPoint.
Move( nTextWidth*1.5, 0 );
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
const GDIMetaFile & GetGDIMetaFile() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void SetFont(const vcl::Font &rNewFont)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
bool mbRemoveTransparencies
void ImplExportPage(vcl::PDFWriter &rWriter, vcl::PDFExtOutDevData &rPDFExtOutDevData, const GDIMetaFile &rMtf)
sal_Int32 mnPDFDocumentAction
css::uno::Reference< css::security::XCertificate > GetCertificateFromSubjectName(const std::u16string_view &rSubjectName) const
bool mbExportNotesInMargin
bool mbExportPlaceholders
bool mbDisplayPDFDocumentTitle
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
bool mbUseLosslessCompression
sal_Int32 mnMaxImageResolution
void showErrors(const std::set< vcl::PDFWriter::ErrorCode > &)
css::uno::Reference< css::security::XCertificate > maSignCertificate
bool mbUseTransitionEffects
css::uno::Reference< css::lang::XComponent > mxSrcDoc
void ImplWriteTiledWatermark(vcl::PDFWriter &rWriter, const Size &rPageSize)
css::uno::Reference< css::uno::XComponentContext > mxContext
void ImplWriteWatermark(vcl::PDFWriter &rWriter, const Size &rPageSize)
std::optional< Degree10 > moWatermarkRotateAngle
bool mbOpenInFullScreenMode
bool mbRestrictPermissions
sal_Int32 mnChangesAllowed
css::uno::Reference< css::task::XInteractionHandler > mxIH
bool Export(const OUString &rFile, const css::uno::Sequence< css::beans::PropertyValue > &rFilterData)
sal_Int32 mnOpenBookmarkLevels
bool mbHideViewerWindowControls
PDFExport(const css::uno::Reference< css::lang::XComponent > &rxSrcDoc, const css::uno::Reference< css::task::XStatusIndicator > &xStatusIndicator, const css::uno::Reference< css::task::XInteractionHandler > &xIH, const css::uno::Reference< css::uno::XComponentContext > &xFact)
bool mbExportOnlyNotesPages
bool mbAllowDuplicateFieldNames
sal_Int32 mnPDFPageLayout
OUString msTiledWatermark
std::optional< sal_Int32 > moWatermarkFontHeight
sal_Int32 mnPDFTypeSelection
bool mbUseReferenceXObject
bool mbCanExtractForAccessibility
bool ExportSelection(vcl::PDFWriter &rPDFWriter, css::uno::Reference< css::view::XRenderable > const &rRenderable, const css::uno::Any &rSelection, const StringRangeEnumerator &rRangeEnum, css::uno::Sequence< css::beans::PropertyValue > &rRenderOptions, sal_Int32 nPageCount)
bool mbExportHiddenSlides
sal_Int32 mnProgressValue
bool mbExportRelativeFsysLinks
bool mbConvertOOoTargetToPDFTarget
sal_Int32 mnDefaultLinkAction
sal_Int32 mnPDFDocumentMode
bool mbReduceImageResolution
OUString maWatermarkFontName
void Move(tools::Long nHorzMove, tools::Long nVertMove)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long getX() const
constexpr tools::Long getY() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Iterator end(const o3tl::sorted_vector< sal_Int32 > *i_pPossibleValues=nullptr) const
Iterator begin(const o3tl::sorted_vector< sal_Int32 > *i_pPossibleValues=nullptr) const
void rotate(double fRadiant)
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange const & getB2DRange() const
B2DPoint getCenter() const
static css::uno::Sequence< css::beans::NamedValue > CreatePackageEncryptionData(std::u16string_view aPassword)
static OUString getProductVersion()
static OUString getProductName()
tools::Long GetFontHeight() const
void SetOrientation(Degree10 nLineOrientation)
void SetWidthType(FontWidth)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFontHeight(tools::Long nHeight)
void SetAlignment(TextAlign)
void SetIsExportNamedDestinations(const bool bExportNDests)
void SetIsExportNotes(const bool bExportNotes)
void SetIsExportTaggedPDF(const bool bTaggedPDF)
void SetIsExportNotesPages(const bool bExportNotesPages)
void PlayGlobalActions(PDFWriter &rWriter)
void SetIsLosslessCompression(const bool bLosslessCompression)
void SetIsReduceImageResolution(const bool bReduceImageResolution)
void SetCurrentPageNumber(const sal_Int32 nPage)
void SetIsExportBookmarks(const bool bExportBookmarks)
void SetIsExportHiddenSlides(const bool bExportHiddenSlides)
void SetIsSinglePageSheets(const bool bSinglePageSheets)
void SetIsExportTransitionEffects(const bool bTransitionalEffects)
void SetIsExportFormFields(const bool bExportFormFields)
const css::lang::Locale & GetDocumentLocale() const
void SetCompressionQuality(const sal_Int32 nQuality)
void SetIsExportNotesInMargin(const bool bExportNotesInMargin)
virtual void write(const css::uno::Reference< css::io::XOutputStream > &xStream)=0
void SetFont(const vcl::Font &rNewFont)
void SetTextColor(const Color &rColor)
void InitStructureElement(sal_Int32 id, PDFWriter::StructElement eType, std::u16string_view rAlias)
static css::uno::Reference< css::beans::XMaterialHolder > InitEncryption(const OUString &i_rOwnerPassword, const OUString &i_rUserPassword)
void Push(PushFlags nFlags=PushFlags::ALL)
void DrawPolyLine(const tools::Polygon &rPoly)
void NewPage(double nPageWidth, double nPageHeight, Orientation eOrientation=Orientation::Inherit)
void BeginTransparencyGroup()
void PlayMetafile(const GDIMetaFile &, const PlayMetafileContext &, vcl::PDFExtOutDevData *pDevDat=nullptr)
void DrawText(const Point &rPos, const OUString &rText)
std::set< ErrorCode > const & GetErrors() const
void AddAttachedFile(OUString const &rFileName, OUString const &rMimeType, OUString const &rDescription, std::unique_ptr< PDFOutputStream > pStream)
void SetDocumentLocale(const css::lang::Locale &rDocLocale)
OutputDevice * GetReferenceDevice()
void SetMapMode(const MapMode &rNewMapMode)
void EndTransparencyGroup(const tools::Rectangle &rBoundRect, sal_uInt16 nTransparencePercent)
void BeginStructureElement(sal_Int32 id)
void EndStructureElement()
void SetStructureAttribute(enum StructAttribute eAttr, enum StructAttributeValue eVal)
sal_Int32 EnsureStructureElement()
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
void getContinuations(css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const &rContinuations, css::uno::Reference< t1 > *pContinuation1, css::uno::Reference< t2 > *pContinuation2)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
Shape IDs per cluster in DGG atom.
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
static OUString getMimetypeForDocument(const Reference< XComponentContext > &xContext, const Reference< XComponent > &xDoc) noexcept
bool CanExtractForAccessibility
PDFWriter::PDFLinkDefaultAction DefaultLinkAction
bool AllowDuplicateFieldNames
PDFWriter::ExportDataFormat SubmitFormat
css::uno::Reference< css::security::XCertificate > SignCertificate
bool ConvertOOoTargetToPDFTarget
sal_Int32 OpenBookmarkLevels
bool DisplayPDFDocumentTitle
PDFWriter::PDFViewerPageMode PDFDocumentMode
PDFWriter::PDFViewerAction PDFDocumentAction
bool HideViewerWindowControls
PDFWriter::PDFEncryptionProperties Encryption
bool OpenInFullScreenMode
PDFWriter::PDFDocInfo DocumentInfo
bool UniversalAccessibilityCompliance
int m_nMaxImageResolution
bool m_bTransparenciesWereRemoved
bool m_bOnlyLosslessCompression
Reference< XModel > xModel