19#ifndef INCLUDED_VCL_PDFWRITER_HXX
20#define INCLUDED_VCL_PDFWRITER_HXX
22#include <config_options.h>
27#include <rtl/strbuf.hxx>
34#include <com/sun/star/lang/Locale.hpp>
35#include <com/sun/star/util/DateTime.hpp>
61class PDFExtOutDevData;
79 virtual void write(
const css::uno::Reference< css::io::XOutputStream >& xStream ) = 0;
92 enum JoinType { joinMiter, joinRound, joinBevel };
103 m_fTransparency( 0.0 ),
105 m_eJoin( joinMiter ),
106 m_fMiterLimit( 10.0 )
113 enum class PDFVersion { PDF_1_4, PDF_1_5, PDF_1_6, PDF_1_7, PDF_A_1, PDF_A_2, PDF_A_3 };
196 SplitHorizontalInward, SplitHorizontalOutward,
197 SplitVerticalInward, SplitVerticalOutward,
198 BlindsHorizontal, BlindsVertical,
199 BoxInward, BoxOutward,
200 WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
286 virtual std::shared_ptr<AnyWidget>
Clone()
const = 0;
294 ,Description( rSource.Description )
296 ,TextStyle( rSource.TextStyle )
298 ,Location( rSource.Location )
300 ,BorderColor( rSource.BorderColor )
303 ,TextFont( rSource.TextFont )
305 ,TabOrder( rSource.TabOrder )
342 Dest( -1 ),
Submit( false ), SubmitGet( false )
345 virtual std::shared_ptr<AnyWidget>
Clone()
const override
347 return std::make_shared<PushButtonWidget>( *
this );
362 virtual std::shared_ptr<AnyWidget>
Clone()
const override
364 return std::make_shared<CheckBoxWidget>( *
this );
381 virtual std::shared_ptr<AnyWidget>
Clone()
const override
383 return std::make_shared<RadioButtonWidget>( *
this );
415 DecimalAccuracy ( 0 ),
416 PrependCurrencySymbol( false )
419 virtual std::shared_ptr<AnyWidget>
Clone()
const override
421 return std::make_shared<EditWidget>( *
this );
441 virtual std::shared_ptr<AnyWidget>
Clone()
const override
443 return std::make_shared<ListBoxWidget>( *
this );
457 virtual std::shared_ptr<AnyWidget>
Clone()
const override
459 return std::make_shared<ComboBoxWidget>( *
this );
469 virtual std::shared_ptr<AnyWidget>
Clone()
const override
471 return std::make_shared<SignatureWidget>( *
this );
541 CanPrintTheDocument ( false ),
542 CanModifyTheContent ( false ),
543 CanCopyOrExtract ( false ),
544 CanAddOrModify ( false ),
545 CanFillInteractive ( false ),
546 CanExtractForAccessibility ( true ),
547 CanAssemble ( false ),
548 CanPrintFull ( false )
553 {
return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
647 DefaultLinkAction(
PDFWriter::URIAction ),
648 ConvertOOoTargetToPDFTarget( false ),
649 ForcePDFAction( false ),
651 UniversalAccessibilityCompliance( false ),
654 AllowDuplicateFieldNames( false ),
655 PDFDocumentMode(
PDFWriter::ModeDefault ),
656 PDFDocumentAction(
PDFWriter::ActionDefault ),
658 HideViewerToolbar( false ),
659 HideViewerMenubar( false ),
660 HideViewerWindowControls( false ),
662 OpenInFullScreenMode( false ),
663 CenterWindow( false ),
664 DisplayPDFDocumentTitle( true ),
666 FirstPageLeft( false ),
668 OpenBookmarkLevels( -1 ),
673 UseReferenceXObject( false )
677 PDFWriter(
const PDFWriterContext& rContext,
const css::uno::Reference< css::beans::XMaterialHolder >& );
697 void NewPage(
double nPageWidth,
double nPageHeight,
Orientation eOrientation = Orientation::Inherit );
708 : m_nMaxImageResolution( 0 )
709 , m_bOnlyLosslessCompression( false )
710 , m_nJPEGQuality( 90 )
711 , m_bTransparenciesWereRemoved( false )
720 void SetDocumentLocale(
const css::lang::Locale& rDocLocale );
730 std::set< ErrorCode >
const & GetErrors()
const;
733 static css::uno::Reference< css::beans::XMaterialHolder >
734 InitEncryption(
const OUString& i_rOwnerPassword,
735 const OUString& i_rUserPassword
743 void SetClipRegion();
755 void SetFillColor(
const Color& rColor );
758 void SetFont(
const vcl::Font& rNewFont );
759 void SetTextColor(
const Color& rColor );
760 void SetTextFillColor();
761 void SetTextFillColor(
const Color& rColor );
763 void SetTextLineColor();
764 void SetTextLineColor(
const Color& rColor );
765 void SetOverlineColor();
766 void SetOverlineColor(
const Color& rColor );
769 void SetMapMode(
const MapMode& rNewMapMode );
779 void DrawTextArray(
const Point& rStartPt,
const OUString& rStr,
784 void DrawStretchText(
const Point& rStartPt, sal_Int32 nWidth,
785 const OUString& rStr,
786 sal_Int32 nIndex, sal_Int32 nLen );
790 void DrawPixel(
const Point& rPt,
const Color& rColor );
800 void DrawPolyLine(
const tools::Polygon& rPoly,
const ExtLineInfo& rInfo );
805 sal_uInt32 nHorzRount, sal_uInt32 nVertRound );
814 void DrawBitmap(
const Point& rDestPt,
const Size& rDestSize,
817 void DrawBitmapEx(
const Point& rDestPt,
const Size& rDestSize,
827 sal_uInt16 nTransparencePercent );
847 void BeginTransparencyGroup();
860 void EndTransparencyGroup(
const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
902 sal_Int32 CreateNamedDest(
const OUString& sDestName,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
919 sal_Int32 CreateDest(
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
934 sal_Int32 CreateLink(
const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString
const& rAltText);
937 sal_Int32 CreateScreen(
const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString
const& rAltText, OUString
const& rMimeType);
961 sal_Int32 RegisterDestReference( sal_Int32 nDestId,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
973 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
984 void SetLinkURL( sal_Int32 nLinkId,
const OUString& rURL );
987 void SetScreenURL(sal_Int32 nScreenId,
const OUString& rURL);
989 void SetScreenStream(sal_Int32 nScreenId,
const OUString& rURL);
1017 void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1034 sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1098 void BeginStructureElement(sal_Int32
id);
1099 sal_Int32 EnsureStructureElement();
1109 void EndStructureElement();
1122 void SetCurrentStructureElement( sal_Int32 nElement );
1137 void SetStructureAttribute(
enum StructAttribute eAttr,
enum StructAttributeValue eVal );
1151 void SetStructureAttributeNumerical(
enum StructAttribute eAttr, sal_Int32 nValue );
1167 void SetStructureAnnotIds(::std::vector<sal_Int32>
const& rAnnotIds);
1179 void SetActualText(
const OUString& rText );
1190 void SetAlternateText(
const OUString& rText );
1205 void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1219 sal_Int32 CreateControl(
const AnyWidget& rControlType );
1238 void AddAttachedFile(OUString
const& rFileName, OUString
const& rMimeType, OUString
const& rDescription, std::unique_ptr<PDFOutputStream> pStream);
1241 static void AppendUnicodeTextString(
const OUString& rString, OStringBuffer& rBuffer);
A widget used to choose from a list of items and which has an entry.
A widget used to choose from a list of items and which has no entry.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
virtual void write(const css::uno::Reference< css::io::XOutputStream > &xStream)=0
PDFWriter & operator=(const PDFWriter &)=delete
PDFWriter(const PDFWriter &)=delete
@ Warning_Transparency_Omitted_PDFA
@ Warning_Transparency_Omitted_PDF13
@ Warning_Transparency_Converted
@ Warning_FormAction_Omitted_PDFA
void DrawPixel(const Point &rPt)
ScopedVclPtr< PDFWriterImpl > xImplementation
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
DateTime GetDateTime(const css::util::DateTime &_rDT)
std::vector< basegfx::B2DPolygon > maPolygons
css::util::DateTime maModificationDate
std::vector< double > m_aDashArray
std::vector< sal_uInt8 > UValue
std::vector< sal_uInt8 > DocumentIdentifier
std::vector< sal_uInt8 > EncryptionKey
std::vector< sal_uInt8 > OValue
bool CanExtractForAccessibility
PDFEncryptionProperties()
PDFWriter::PDFLinkDefaultAction DefaultLinkAction
bool AllowDuplicateFieldNames
PDFWriter::ExportDataFormat SubmitFormat
css::uno::Reference< css::security::XCertificate > SignCertificate
bool ConvertOOoTargetToPDFTarget
sal_Int32 OpenBookmarkLevels
bool DisplayPDFDocumentTitle
bool UseReferenceXObject
Use reference XObject markup for PDF images.
PDFWriter::PDFViewerPageMode PDFDocumentMode
PDFWriter::PDFViewerAction PDFDocumentAction
bool HideViewerWindowControls
PDFWriter::PDFEncryptionProperties Encryption
bool OpenInFullScreenMode
PDFWriter::PDFDocInfo DocumentInfo
bool UniversalAccessibilityCompliance
PDFWriter::ColorMode ColorMode
css::lang::Locale DocumentLocale
Play a metafile like an outputdevice would do.
int m_nMaxImageResolution
bool m_bTransparenciesWereRemoved
bool m_bOnlyLosslessCompression