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_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_1_6, PDF_A_1, PDF_A_2, PDF_A_3 };
184 SplitHorizontalInward, SplitHorizontalOutward,
185 SplitVerticalInward, SplitVerticalOutward,
186 BlindsHorizontal, BlindsVertical,
187 BoxInward, BoxOutward,
188 WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
274 virtual std::shared_ptr<AnyWidget>
Clone()
const = 0;
282 ,Description( rSource.Description )
284 ,TextStyle( rSource.TextStyle )
286 ,Location( rSource.Location )
288 ,BorderColor( rSource.BorderColor )
290 ,BackgroundColor( rSource.BackgroundColor )
291 ,TextFont( rSource.TextFont )
292 ,TextColor( rSource.TextColor )
293 ,TabOrder( rSource.TabOrder )
330 Dest( -1 ),
Submit( false ), SubmitGet( false )
333 virtual std::shared_ptr<AnyWidget>
Clone()
const override
335 return std::make_shared<PushButtonWidget>( *
this );
350 virtual std::shared_ptr<AnyWidget>
Clone()
const override
352 return std::make_shared<CheckBoxWidget>( *
this );
369 virtual std::shared_ptr<AnyWidget>
Clone()
const override
371 return std::make_shared<RadioButtonWidget>( *
this );
403 DecimalAccuracy ( 0 ),
404 PrependCurrencySymbol( false )
407 virtual std::shared_ptr<AnyWidget>
Clone()
const override
409 return std::make_shared<EditWidget>( *
this );
429 virtual std::shared_ptr<AnyWidget>
Clone()
const override
431 return std::make_shared<ListBoxWidget>( *
this );
445 virtual std::shared_ptr<AnyWidget>
Clone()
const override
447 return std::make_shared<ComboBoxWidget>( *
this );
457 virtual std::shared_ptr<AnyWidget>
Clone()
const override
459 return std::make_shared<SignatureWidget>( *
this );
529 CanPrintTheDocument ( false ),
530 CanModifyTheContent ( false ),
531 CanCopyOrExtract ( false ),
532 CanAddOrModify ( false ),
533 CanFillInteractive ( false ),
534 CanExtractForAccessibility ( true ),
535 CanAssemble ( false ),
536 CanPrintFull ( false )
541 {
return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
635 DefaultLinkAction(
PDFWriter::URIAction ),
636 ConvertOOoTargetToPDFTarget( false ),
637 ForcePDFAction( false ),
639 UniversalAccessibilityCompliance( false ),
642 AllowDuplicateFieldNames( false ),
643 PDFDocumentMode(
PDFWriter::ModeDefault ),
644 PDFDocumentAction(
PDFWriter::ActionDefault ),
646 HideViewerToolbar( false ),
647 HideViewerMenubar( false ),
648 HideViewerWindowControls( false ),
650 OpenInFullScreenMode( false ),
651 CenterWindow( false ),
652 DisplayPDFDocumentTitle( true ),
654 FirstPageLeft( false ),
656 OpenBookmarkLevels( -1 ),
661 UseReferenceXObject( false )
665 PDFWriter(
const PDFWriterContext& rContext,
const css::uno::Reference< css::beans::XMaterialHolder >& );
685 void NewPage(
double nPageWidth,
double nPageHeight,
Orientation eOrientation = Orientation::Inherit );
696 : m_nMaxImageResolution( 0 )
697 , m_bOnlyLosslessCompression( false )
698 , m_nJPEGQuality( 90 )
699 , m_bTransparenciesWereRemoved( false )
708 void SetDocumentLocale(
const css::lang::Locale& rDocLocale );
718 std::set< ErrorCode >
const & GetErrors()
const;
721 static css::uno::Reference< css::beans::XMaterialHolder >
722 InitEncryption(
const OUString& i_rOwnerPassword,
723 const OUString& i_rUserPassword
731 void SetClipRegion();
743 void SetFillColor(
const Color& rColor );
746 void SetFont(
const vcl::Font& rNewFont );
747 void SetTextColor(
const Color& rColor );
748 void SetTextFillColor();
749 void SetTextFillColor(
const Color& rColor );
751 void SetTextLineColor();
752 void SetTextLineColor(
const Color& rColor );
753 void SetOverlineColor();
754 void SetOverlineColor(
const Color& rColor );
757 void SetMapMode(
const MapMode& rNewMapMode );
761 void DrawText(
const Point& rPos,
const OUString& rText );
763 void DrawTextLine(
const Point& rPos,
tools::Long nWidth,
767 void DrawTextArray(
const Point& rStartPt,
const OUString& rStr,
772 void DrawStretchText(
const Point& rStartPt, sal_Int32 nWidth,
773 const OUString& rStr,
774 sal_Int32 nIndex, sal_Int32 nLen );
778 void DrawPixel(
const Point& rPt,
const Color& rColor );
782 void DrawLine(
const Point& rStartPt,
const Point& rEndPt );
783 void DrawLine(
const Point& rStartPt,
const Point& rEndPt,
788 void DrawPolyLine(
const tools::Polygon& rPoly,
const ExtLineInfo& rInfo );
796 const Point& rStartPt,
const Point& rEndPt );
798 const Point& rStartPt,
const Point& rEndPt );
800 const Point& rStartPt,
const Point& rEndPt );
802 void DrawBitmap(
const Point& rDestPt,
const Size& rDestSize,
805 void DrawBitmapEx(
const Point& rDestPt,
const Size& rDestSize,
815 sal_uInt16 nTransparencePercent );
835 void BeginTransparencyGroup();
848 void EndTransparencyGroup(
const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
890 sal_Int32 CreateNamedDest(
const OUString& sDestName,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
907 sal_Int32 CreateDest(
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
922 sal_Int32 CreateLink(
const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString
const& rAltText);
949 sal_Int32 RegisterDestReference( sal_Int32 nDestId,
const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
961 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
972 void SetLinkURL( sal_Int32 nLinkId,
const OUString& rURL );
975 void SetScreenURL(sal_Int32 nScreenId,
const OUString& rURL);
977 void SetScreenStream(sal_Int32 nScreenId,
const OUString& rURL);
1005 void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1022 sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1081 sal_Int32 BeginStructureElement(
enum StructElement eType, std::u16string_view rAlias );
1089 void EndStructureElement();
1102 void SetCurrentStructureElement( sal_Int32 nElement );
1117 void SetStructureAttribute(
enum StructAttribute eAttr,
enum StructAttributeValue eVal );
1131 void SetStructureAttributeNumerical(
enum StructAttribute eAttr, sal_Int32 nValue );
1154 void SetActualText(
const OUString& rText );
1165 void SetAlternateText(
const OUString& rText );
1180 void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1194 sal_Int32 CreateControl(
const AnyWidget& rControlType );
1213 void AddAttachedFile(OUString
const& rFileName,
const OUString& rMimeType, std::unique_ptr<PDFOutputStream> pStream);
1216 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