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;
75 virtual void write(
const css::uno::Reference< css::io::XOutputStream >& xStream ) = 0;
88 enum JoinType { joinMiter, joinRound, joinBevel };
99 m_fTransparency( 0.0 ),
101 m_eJoin( joinMiter ),
102 m_fMiterLimit( 10.0 )
109 enum class PDFVersion { PDF_1_4, PDF_1_5, PDF_1_6, PDF_1_7, PDF_A_1, PDF_A_2, PDF_A_3 };
192 SplitHorizontalInward, SplitHorizontalOutward,
193 SplitVerticalInward, SplitVerticalOutward,
194 BlindsHorizontal, BlindsVertical,
195 BoxInward, BoxOutward,
196 WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
282 virtual std::shared_ptr<AnyWidget>
Clone()
const = 0;
290 ,Description( rSource.Description )
292 ,TextStyle( rSource.TextStyle )
294 ,Location( rSource.Location )
296 ,BorderColor( rSource.BorderColor )
299 ,TextFont( rSource.TextFont )
301 ,TabOrder( rSource.TabOrder )
338 Dest( -1 ),
Submit( false ), SubmitGet( false )
341 virtual std::shared_ptr<AnyWidget>
Clone()
const override
343 return std::make_shared<PushButtonWidget>( *
this );
358 virtual std::shared_ptr<AnyWidget>
Clone()
const override
360 return std::make_shared<CheckBoxWidget>( *
this );
377 virtual std::shared_ptr<AnyWidget>
Clone()
const override
379 return std::make_shared<RadioButtonWidget>( *
this );
411 DecimalAccuracy ( 0 ),
412 PrependCurrencySymbol( false )
415 virtual std::shared_ptr<AnyWidget>
Clone()
const override
417 return std::make_shared<EditWidget>( *
this );
437 virtual std::shared_ptr<AnyWidget>
Clone()
const override
439 return std::make_shared<ListBoxWidget>( *
this );
453 virtual std::shared_ptr<AnyWidget>
Clone()
const override
455 return std::make_shared<ComboBoxWidget>( *
this );
465 virtual std::shared_ptr<AnyWidget>
Clone()
const override
467 return std::make_shared<SignatureWidget>( *
this );
537 CanPrintTheDocument ( false ),
538 CanModifyTheContent ( false ),
539 CanCopyOrExtract ( false ),
540 CanAddOrModify ( false ),
541 CanFillInteractive ( false ),
542 CanExtractForAccessibility ( true ),
543 CanAssemble ( false ),
544 CanPrintFull ( false )
549 {
return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
643 DefaultLinkAction(
PDFWriter::URIAction ),
644 ConvertOOoTargetToPDFTarget( false ),
645 ForcePDFAction( false ),
647 UniversalAccessibilityCompliance( false ),
650 AllowDuplicateFieldNames( false ),
651 PDFDocumentMode(
PDFWriter::ModeDefault ),
652 PDFDocumentAction(
PDFWriter::ActionDefault ),
654 HideViewerToolbar( false ),
655 HideViewerMenubar( false ),
656 HideViewerWindowControls( false ),
658 OpenInFullScreenMode( false ),
659 CenterWindow( false ),
660 DisplayPDFDocumentTitle( true ),
662 FirstPageLeft( false ),
664 OpenBookmarkLevels( -1 ),
669 UseReferenceXObject( false )
673 PDFWriter(
const PDFWriterContext& rContext,
const css::uno::Reference< css::beans::XMaterialHolder >& );
693 void NewPage(
double nPageWidth,
double nPageHeight,
Orientation eOrientation = Orientation::Inherit );
704 : m_nMaxImageResolution( 0 )
705 , m_bOnlyLosslessCompression( false )
706 , m_nJPEGQuality( 90 )
707 , m_bTransparenciesWereRemoved( false )
716 void SetDocumentLocale(
const css::lang::Locale& rDocLocale );
726 std::set< ErrorCode >
const & GetErrors()
const;
729 static css::uno::Reference< css::beans::XMaterialHolder >
730 InitEncryption(
const OUString& i_rOwnerPassword,
731 const OUString& i_rUserPassword
739 void SetClipRegion();
751 void SetFillColor(
const Color& rColor );
754 void SetFont(
const vcl::Font& rNewFont );
755 void SetTextColor(
const Color& rColor );
756 void SetTextFillColor();
757 void SetTextFillColor(
const Color& rColor );
759 void SetTextLineColor();
760 void SetTextLineColor(
const Color& rColor );
761 void SetOverlineColor();
762 void SetOverlineColor(
const Color& rColor );
765 void SetMapMode(
const MapMode& rNewMapMode );
769 void DrawText(
const Point& rPos,
const OUString& rText );
771 void DrawTextLine(
const Point& rPos,
tools::Long nWidth,
775 void DrawTextArray(
const Point& rStartPt,
const OUString& rStr,
780 void DrawStretchText(
const Point& rStartPt, sal_Int32 nWidth,
781 const OUString& rStr,
782 sal_Int32 nIndex, sal_Int32 nLen );
786 void DrawPixel(
const Point& rPt,
const Color& rColor );
790 void DrawLine(
const Point& rStartPt,
const Point& rEndPt );
791 void DrawLine(
const Point& rStartPt,
const Point& rEndPt,
796 void DrawPolyLine(
const tools::Polygon& rPoly,
const ExtLineInfo& rInfo );
801 sal_uInt32 nHorzRount, sal_uInt32 nVertRound );
804 const Point& rStartPt,
const Point& rEndPt );
806 const Point& rStartPt,
const Point& rEndPt );
808 const Point& rStartPt,
const Point& rEndPt );
810 void DrawBitmap(
const Point& rDestPt,
const Size& rDestSize,
813 void DrawBitmapEx(
const Point& rDestPt,
const Size& rDestSize,
823 sal_uInt16 nTransparencePercent );
843 void BeginTransparencyGroup();
856 void EndTransparencyGroup(
const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
898 sal_Int32 CreateNamedDest(
const OUString& sDestName,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
915 sal_Int32 CreateDest(
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
930 sal_Int32 CreateLink(
const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString
const& rAltText);
933 sal_Int32 CreateScreen(
const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString
const& rAltText, OUString
const& rMimeType);
957 sal_Int32 RegisterDestReference( sal_Int32 nDestId,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
969 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
980 void SetLinkURL( sal_Int32 nLinkId,
const OUString& rURL );
983 void SetScreenURL(sal_Int32 nScreenId,
const OUString& rURL);
985 void SetScreenStream(sal_Int32 nScreenId,
const OUString& rURL);
1013 void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1030 sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1089 sal_Int32 BeginStructureElement(
enum StructElement eType, std::u16string_view rAlias );
1097 void EndStructureElement();
1110 void SetCurrentStructureElement( sal_Int32 nElement );
1125 void SetStructureAttribute(
enum StructAttribute eAttr,
enum StructAttributeValue eVal );
1139 void SetStructureAttributeNumerical(
enum StructAttribute eAttr, sal_Int32 nValue );
1155 void SetStructureAnnotIds(::std::vector<sal_Int32>
const& rAnnotIds);
1167 void SetActualText(
const OUString& rText );
1178 void SetAlternateText(
const OUString& rText );
1193 void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1207 sal_Int32 CreateControl(
const AnyWidget& rControlType );
1226 void AddAttachedFile(OUString
const& rFileName, OUString
const& rMimeType, OUString
const& rDescription, std::unique_ptr<PDFOutputStream> pStream);
1229 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)
void escapeStringXML(const OUString &rStr, OUString &rValue)
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