LibreOffice Module filter (master) 1
pdfexport.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <tools/multisel.hxx>
23#include <vcl/pdfwriter.hxx>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/lang/XComponent.hpp>
27#include <com/sun/star/task/XInteractionHandler.hpp>
28#include <com/sun/star/task/XStatusIndicator.hpp>
29#include <com/sun/star/uno/Reference.hxx>
30#include <com/sun/star/uno/XComponentContext.hpp>
31#include <com/sun/star/view/XRenderable.hpp>
32
33class GDIMetaFile;
34class Size;
35
36namespace vcl { class PDFWriter; }
37
39{
40private:
41
42 css::uno::Reference< css::lang::XComponent > mxSrcDoc;
43 css::uno::Reference< css::uno::XComponentContext > mxContext;
44 css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator;
45 css::uno::Reference< css::task::XInteractionHandler > mxIH;
46
61
67 sal_Int32 mnQuality;
68 sal_Int32 mnFormsFormat;
71 sal_Int32 mnProgressValue;
73
75
76 OUString msWatermark;
78 std::optional<sal_Int32> moWatermarkFontHeight;
80 std::optional<Degree10> moWatermarkRotateAngle;
82
83 // these variable are here only to have a location in filter/pdf to set the default
84 // to be used by the macro (when the FilterData are set by the macro itself)
94 sal_Int32 mnZoom;
95 sal_Int32 mnInitialPage;
96 sal_Int32 mnPDFPageLayout;
97
100 sal_Int32 mnPrintAllowed;
104
105 // #i56629
110 void ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData,
111 const GDIMetaFile& rMtf );
112
116 OUString msSignReason;
118 css::uno::Reference< css::security::XCertificate > maSignCertificate;
119 OUString msSignTSA;
120
121 void ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
122 void ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
123 css::uno::Reference<css::security::XCertificate> GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const;
124
125
126public:
127
128 PDFExport( const css::uno::Reference< css::lang::XComponent >& rxSrcDoc,
129 const css::uno::Reference< css::task::XStatusIndicator >& xStatusIndicator,
130 const css::uno::Reference< css::task::XInteractionHandler >& xIH,
131 const css::uno::Reference< css::uno::XComponentContext >& xFact );
132 ~PDFExport();
133
134 bool ExportSelection( vcl::PDFWriter& rPDFWriter,
135 css::uno::Reference< css::view::XRenderable > const & rRenderable,
136 const css::uno::Any& rSelection,
137 const StringRangeEnumerator& rRangeEnum,
138 css::uno::Sequence< css::beans::PropertyValue >& rRenderOptions,
139 sal_Int32 nPageCount );
140
141 bool Export( const OUString& rFile, const css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
142
143 void showErrors( const std::set<vcl::PDFWriter::ErrorCode>& );
144};
145
146/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString msSignPassword
Definition: pdfexport.hxx:117
Color maWatermarkColor
Definition: pdfexport.hxx:77
bool mbRemoveTransparencies
Definition: pdfexport.hxx:72
void ImplExportPage(vcl::PDFWriter &rWriter, vcl::PDFExtOutDevData &rPDFExtOutDevData, const GDIMetaFile &rMtf)
Definition: pdfexport.cxx:1154
sal_Int32 mnFormsFormat
Definition: pdfexport.hxx:68
sal_Int32 mnPDFDocumentAction
Definition: pdfexport.hxx:93
css::uno::Reference< css::security::XCertificate > GetCertificateFromSubjectName(const std::u16string_view &rSubjectName) const
Definition: pdfexport.cxx:404
bool mbExportNotesPages
Definition: pdfexport.hxx:54
bool mbExportNotesInMargin
Definition: pdfexport.hxx:51
bool mbExportPlaceholders
Definition: pdfexport.hxx:52
sal_Int32 mnZoom
Definition: pdfexport.hxx:94
bool mbDisplayPDFDocumentTitle
Definition: pdfexport.hxx:91
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
Definition: pdfexport.hxx:44
bool mbUseLosslessCompression
Definition: pdfexport.hxx:62
bool mbFitWindow
Definition: pdfexport.hxx:88
sal_Int32 mnMaxImageResolution
Definition: pdfexport.hxx:66
OUString msSignLocation
Definition: pdfexport.hxx:114
OUString msSignReason
Definition: pdfexport.hxx:116
void showErrors(const std::set< vcl::PDFWriter::ErrorCode > &)
Definition: pdfexport.cxx:1142
css::uno::Reference< css::security::XCertificate > maSignCertificate
Definition: pdfexport.hxx:118
bool mbUseTransitionEffects
Definition: pdfexport.hxx:56
css::uno::Reference< css::lang::XComponent > mxSrcDoc
Definition: pdfexport.hxx:42
bool mbSkipEmptyPages
Definition: pdfexport.hxx:64
void ImplWriteTiledWatermark(vcl::PDFWriter &rWriter, const Size &rPageSize)
Definition: pdfexport.cxx:1320
sal_Int32 mnInitialPage
Definition: pdfexport.hxx:95
css::uno::Reference< css::uno::XComponentContext > mxContext
Definition: pdfexport.hxx:43
void ImplWriteWatermark(vcl::PDFWriter &rWriter, const Size &rPageSize)
Definition: pdfexport.cxx:1206
bool mbExportBookmarks
Definition: pdfexport.hxx:57
std::optional< Degree10 > moWatermarkRotateAngle
Definition: pdfexport.hxx:80
bool mbOpenInFullScreenMode
Definition: pdfexport.hxx:90
bool mbEncrypt
Definition: pdfexport.hxx:98
bool mbRestrictPermissions
Definition: pdfexport.hxx:99
sal_Int32 mnQuality
Definition: pdfexport.hxx:67
bool mbSinglePageSheets
Definition: pdfexport.hxx:59
sal_Int32 mnChangesAllowed
Definition: pdfexport.hxx:101
bool mbAddStream
Definition: pdfexport.hxx:65
bool mbHideViewerToolbar
Definition: pdfexport.hxx:85
css::uno::Reference< css::task::XInteractionHandler > mxIH
Definition: pdfexport.hxx:45
bool mbCanCopyOrExtract
Definition: pdfexport.hxx:102
bool Export(const OUString &rFile, const css::uno::Sequence< css::beans::PropertyValue > &rFilterData)
Definition: pdfexport.cxx:423
sal_Int32 mnOpenBookmarkLevels
Definition: pdfexport.hxx:60
bool mbHideViewerWindowControls
Definition: pdfexport.hxx:87
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)
Definition: pdfexport.cxx:77
OUString msWatermark
Definition: pdfexport.hxx:76
bool mbExportOnlyNotesPages
Definition: pdfexport.hxx:55
bool mbAllowDuplicateFieldNames
Definition: pdfexport.hxx:70
bool mbSignPDF
Definition: pdfexport.hxx:113
sal_Int32 mnPDFPageLayout
Definition: pdfexport.hxx:96
OUString msTiledWatermark
Definition: pdfexport.hxx:81
OUString msSignContact
Definition: pdfexport.hxx:115
bool mbExportNotes
Definition: pdfexport.hxx:50
std::optional< sal_Int32 > moWatermarkFontHeight
Definition: pdfexport.hxx:78
bool mbExportFormFields
Definition: pdfexport.hxx:69
sal_Int32 mnPDFTypeSelection
Definition: pdfexport.hxx:48
bool mbUseReferenceXObject
Definition: pdfexport.hxx:53
sal_Int32 mnPrintAllowed
Definition: pdfexport.hxx:100
bool mbPDFUACompliance
Definition: pdfexport.hxx:49
bool mbExportBmkToDest
Definition: pdfexport.hxx:109
bool mbCanExtractForAccessibility
Definition: pdfexport.hxx:103
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)
Definition: pdfexport.cxx:150
bool mbExportHiddenSlides
Definition: pdfexport.hxx:58
sal_Int32 mnProgressValue
Definition: pdfexport.hxx:71
bool mbExportRelativeFsysLinks
Definition: pdfexport.hxx:106
bool mbConvertOOoTargetToPDFTarget
Definition: pdfexport.hxx:108
sal_Int32 mnDefaultLinkAction
Definition: pdfexport.hxx:107
bool mbUseTaggedPDF
Definition: pdfexport.hxx:47
sal_Int32 mnPDFDocumentMode
Definition: pdfexport.hxx:92
bool mbReduceImageResolution
Definition: pdfexport.hxx:63
OUString msSignTSA
Definition: pdfexport.hxx:119
bool mbCenterWindow
Definition: pdfexport.hxx:89
OUString maWatermarkFontName
Definition: pdfexport.hxx:79
bool mbIsRedactMode
Definition: pdfexport.hxx:74
bool mbHideViewerMenubar
Definition: pdfexport.hxx:86