LibreOffice Module vcl (master) 1
pdfwriter.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#ifndef INCLUDED_VCL_PDFWRITER_HXX
20#define INCLUDED_VCL_PDFWRITER_HXX
21
22#include <config_options.h>
23#include <sal/types.h>
24
25#include <tools/gen.hxx>
26#include <tools/color.hxx>
27#include <rtl/strbuf.hxx>
28
29#include <vcl/dllapi.h>
30#include <vcl/font.hxx>
31#include <vcl/outdev.hxx>
32#include <vcl/graph.hxx>
33
34#include <com/sun/star/lang/Locale.hpp>
35#include <com/sun/star/util/DateTime.hpp>
36
37#include <memory>
38#include <vector>
39#include <set>
40
41namespace com::sun::star::beans { class XMaterialHolder; }
42namespace com::sun::star::io { class XOutputStream; }
43namespace com::sun::star::security { class XCertificate; }
44
45class GDIMetaFile;
46class MapMode;
47class LineInfo;
48namespace tools {
49 class Polygon;
50 class PolyPolygon;
51}
52class Bitmap;
53class BitmapEx;
54class Gradient;
55class Hatch;
56class Wallpaper;
57
58namespace vcl
59{
60
61class PDFExtOutDevData;
62class PDFWriterImpl;
63
64struct PDFNote
65{
66 OUString Title; // optional title for the popup containing the note
67 OUString Contents; // contents of the note
68 css::util::DateTime maModificationDate;
69};
70
72{
73 public:
74 virtual ~PDFOutputStream();
75 virtual void write( const css::uno::Reference< css::io::XOutputStream >& xStream ) = 0;
76};
77
79{
81
82 PDFWriter(const PDFWriter&) = delete;
83 PDFWriter& operator=(const PDFWriter&) = delete;
84
85public:
86 // extended line info
87 enum CapType { capButt, capRound, capSquare };
88 enum JoinType { joinMiter, joinRound, joinBevel };
90 {
96 std::vector< double > m_aDashArray;
97
98 ExtLineInfo() : m_fLineWidth( 0.0 ),
99 m_fTransparency( 0.0 ),
100 m_eCap( capButt ),
101 m_eJoin( joinMiter ),
102 m_fMiterLimit( 10.0 )
103 {}
104 };
105
106 enum class Orientation { Portrait, Inherit };
107
108 // in case the below enum is added PDF_2_0, please add just after PDF_1_7
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 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
110 // for the meaning of DestAreaType please look at PDF Reference Manual
111 // version 1.4 section 8.2.1, page 475
112 enum class DestAreaType { XYZ, FitRectangle };
113
114 // for a definition of structural element types please refer to
115 // PDF Reference, 3rd ed. section 9.7.4
117 {
118 // special element to place outside the structure hierarchy
120 // Grouping elements
121 Document, Part, Article, Section, Division, BlockQuote,
122 Caption, TOC, TOCI, Index,
123
124 // block level elements
125 Paragraph, Heading, H1, H2, H3, H4, H5, H6,
126 List, ListItem, LILabel, LIBody,
127 Table, TableRow, TableHeader, TableData,
128
129 // inline level elements
130 Span, Quote, Note, Reference, BibEntry, Code, Link, Annot,
131
132 // illustration elements
134 };
135
137 {
138 // Artifacts
140
141 Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
142 TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
143 LineHeight, BaselineShift, TextDecorationType, ListNumbering,
144 RowSpan, ColSpan, Scope, Role,
145
146 // link destination is an artificial attribute that sets
147 // the link annotation ID of a Link element
148 // further note: since structure attributes can only be
149 // set during content creation, but links can be
150 // created after the fact, it is possible to set
151 // an arbitrary id as structure attribute here. In this
152 // case the arbitrary id has to be passed again when the
153 // actual link annotation is created via SetLinkPropertyID
155 // Language currently sets a LanguageType (see i18nlangtag/lang.h)
156 // which will be internally changed to a corresponding locale
157 Language
158 };
159
161 {
164 // Artifacts
165 Pagination, Layout, Page, Background,
167 // Placement
169 // WritingMode
170 LrTb, RlTb, TbRl,
171 // TextAlign
172 Center, Justify,
173 // Width, Height,
175 // BlockAlign
177 // LineHeight
179 // TextDecorationType
181 // Scope
183 // Role
184 Rb, Cb, Pb, Tv,
185 // ListNumbering
186 Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
187 };
188
189 enum class PageTransition
190 {
191 Regular,
192 SplitHorizontalInward, SplitHorizontalOutward,
193 SplitVerticalInward, SplitVerticalOutward,
194 BlindsHorizontal, BlindsVertical,
195 BoxInward, BoxOutward,
196 WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
197 Dissolve
198 };
199
201 {
204 };
205
207 {
209 };
210
212 {
213 // transparent object occurred and was draw opaque because
214 // PDF/A does not allow transparency
216
217 // transparent object occurred but is only supported since
218 // PDF 1.4
220
221 // a form action was exported that is not suitable for PDF/A
222 // the action was skipped
224
225 // transparent objects were converted to a bitmap in order
226 // to removetransparencies from the output
228
229 // signature generation failed
231 };
232
234 {
235 WidgetType Type; // primitive RTTI
236 public:
237 OUString Name; // a distinct name to identify the control
238 OUString Description;// descriptive text for the control (e.g. for tool tip)
239 OUString Text; // user text to appear on the control
240 DrawTextFlags TextStyle; // style flags
242 tools::Rectangle Location; // describes the area filled by the control
243 bool Border; // true: widget should have a border, false: no border
244 Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
245 bool Background; // true: widget shall draw its background, false: no background
246 Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
247 vcl::Font TextFont; // an empty font will be replaced by the
248 // appropriate font from the user settings
249 Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
250 sal_Int32 TabOrder; // lowest number is first in tab order
251
252 /* style flags for text are those for OutputDevice::DrawText
253 allowed values are:
254 DrawTextFlags::Left, DrawTextFlags::Center, DrawTextFlags::Right, DrawTextFlags::Top,
255 DrawTextFlags::VCenter, DrawTextFlags::Bottom,
256 DrawTextFlags::MultiLine, DrawTextFlags::WordBreak
257
258 if TextStyle is 0, then each control will fill in default values
259 */
260
261 // note: the Name member comprises the field name of the resulting
262 // PDF field names need to be globally unique. Therefore if any
263 // Widget with an already used name is created, the name will be
264 // made unique by adding an underscore ('_') and an ascending number
265 // to the name.
266
268 Type( eType ),
269 TextStyle( DrawTextFlags::NONE ),
270 ReadOnly( false ),
271 Border( false ),
272 BorderColor( COL_TRANSPARENT ),
273 Background( false ),
276 TabOrder( -1 )
277 {}
278 virtual ~AnyWidget();
279
280 WidgetType getType() const { return Type; }
281
282 virtual std::shared_ptr<AnyWidget> Clone() const = 0;
283
284 protected:
285 // note that this equals the default compiler-generated copy-ctor, but we want to have it
286 // protected, to only allow sub classes to access it
287 AnyWidget( const AnyWidget& rSource )
288 :Type( rSource.Type )
289 ,Name( rSource.Name )
290 ,Description( rSource.Description )
291 ,Text( rSource.Text )
292 ,TextStyle( rSource.TextStyle )
293 ,ReadOnly( rSource.ReadOnly )
294 ,Location( rSource.Location )
295 ,Border( rSource.Border )
296 ,BorderColor( rSource.BorderColor )
297 ,Background( rSource.Background )
299 ,TextFont( rSource.TextFont )
300 ,TextColor( rSource.TextColor )
301 ,TabOrder( rSource.TabOrder )
302 {
303 }
304 AnyWidget& operator=( const AnyWidget& ) = delete; // never implemented
305 };
306
307 struct PushButtonWidget final : public AnyWidget
308 {
309 /* If Dest is set to a valid link destination,
310 Then pressing the button will act as a goto
311 action within the document.
312
313 Else:
314 An empty URL means this button will reset the form.
315
316 If URL is not empty and Submit is set, then the URL
317 contained will be set as the URL to submit the
318 form to. In this case the submit method will be
319 either GET if SubmitGet is true or POST if
320 SubmitGet is false.
321
322 If URL is not empty and Submit is clear, then
323 the URL contained will be interpreted as a
324 hyperlink to be executed on pushing the button.
325
326 There will be no error checking or any kind of
327 conversion done to the URL parameter execept this:
328 it will be output as 7bit Ascii. The URL
329 will appear literally in the PDF file produced
330 */
331 sal_Int32 Dest;
332 OUString URL;
333 bool Submit;
335
338 Dest( -1 ), Submit( false ), SubmitGet( false )
339 {}
340
341 virtual std::shared_ptr<AnyWidget> Clone() const override
342 {
343 return std::make_shared<PushButtonWidget>( *this );
344 }
345 };
346
348 {
350 OUString OnValue; // the value of the checkbox if it is selected
351 OUString OffValue; // the value of the checkbox if it is not selected
352
355 Checked( false )
356 {}
357
358 virtual std::shared_ptr<AnyWidget> Clone() const override
359 {
360 return std::make_shared<CheckBoxWidget>( *this );
361 }
362 };
363
364 struct RadioButtonWidget final : public AnyWidget
365 {
367 sal_Int32 RadioGroup;
368 OUString OnValue; // the value of the radio button if it is selected
369 OUString OffValue; // the value of the radio button if it is not selected
370
373 Selected( false ),
374 RadioGroup( 0 )
375 {}
376
377 virtual std::shared_ptr<AnyWidget> Clone() const override
378 {
379 return std::make_shared<RadioButtonWidget>( *this );
380 }
381 // radio buttons having the same RadioGroup id comprise one
382 // logical radio button group, that is at most one of the RadioButtons
383 // in a group can be checked at any time
384 //
385 // note: a PDF radio button field consists of a named field
386 // containing unnamed checkbox child fields. The name of the
387 // radio button field is taken from the first RadioButtonWidget created
388 // in the group
389 };
390
391 struct VCL_DLLPUBLIC EditWidget final : public AnyWidget
392 {
393 bool MultiLine; // whether multiple lines are allowed
394 bool Password; // visible echo off
395 bool FileSelect; // field is a file selector
396 sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
401 OUString TimeFormat;
402 OUString DateFormat;
403
406 MultiLine( false ),
407 Password( false ),
408 FileSelect( false ),
409 MaxLen( 0 ),
411 DecimalAccuracy ( 0 ),
412 PrependCurrencySymbol( false )
413 {}
414
415 virtual std::shared_ptr<AnyWidget> Clone() const override
416 {
417 return std::make_shared<EditWidget>( *this );
418 }
419 };
420
422 {
425 std::vector<OUString> Entries;
426 std::vector<sal_Int32> SelectedEntries;
427 // if MultiSelect is false only the first entry of SelectedEntries
428 // will be taken into account. the same is implicit for PDF < 1.4
429 // since multiselect is a 1.4+ feature
430
433 DropDown( false ),
434 MultiSelect( false )
435 {}
436
437 virtual std::shared_ptr<AnyWidget> Clone() const override
438 {
439 return std::make_shared<ListBoxWidget>( *this );
440 }
441 };
442
443 // note: PDF only supports dropdown comboboxes
444 struct ComboBoxWidget final : public AnyWidget
445 {
446 std::vector<OUString> Entries;
447 // set the current value in AnyWidget::Text
448
451 {}
452
453 virtual std::shared_ptr<AnyWidget> Clone() const override
454 {
455 return std::make_shared<ComboBoxWidget>( *this );
456 }
457 };
458
459 struct SignatureWidget final : public AnyWidget
460 {
463 {}
464
465 virtual std::shared_ptr<AnyWidget> Clone() const override
466 {
467 return std::make_shared<SignatureWidget>( *this );
468 }
469 };
470
471 enum ExportDataFormat { HTML, XML, FDF, PDF };
472// see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
473// These emuns are treated as integer while reading/writing to configuration
475 {
478 UseThumbs
479 };
480// These emuns are treated as integer while reading/writing to configuration
482 {
487 ActionZoom
488 };
489// These enums are treated as integer while reading/writing to configuration
491 {
495 ContinuousFacing
496 };
497
498 // These emuns are treated as integer while reading/writing to configuration
499 //what default action to generate in a PDF hyperlink to external document/site
501 {
504 LaunchAction
505 };
506
507/*
508The following structure describes the permissions used in PDF security
509 */
511 {
512
513 //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
518 //for revision 3 (bit 128 security) only
523
524 // encryption will only happen if EncryptionKey is not empty
525 // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
526 // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
527 // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
528 // PDFDocInfo, Owner password and User password used the InitEncryption method which
529 // implements the algorithms described in the PDF reference chapter 3.5: Encryption
530 std::vector<sal_uInt8> OValue;
531 std::vector<sal_uInt8> UValue;
532 std::vector<sal_uInt8> EncryptionKey;
533 std::vector<sal_uInt8> DocumentIdentifier;
534
535 //permission default set for 128 bit, accessibility only
537 CanPrintTheDocument ( false ),
538 CanModifyTheContent ( false ),
539 CanCopyOrExtract ( false ),
540 CanAddOrModify ( false ),
541 CanFillInteractive ( false ),
542 CanExtractForAccessibility ( true ),
543 CanAssemble ( false ),
544 CanPrintFull ( false )
545 {}
546
547
548 bool Encrypt() const
549 { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
550 };
551
553 {
554 OUString Title; // document title
555 OUString Author; // document author
556 OUString Subject; // subject
557 OUString Keywords; // keywords
558 OUString Creator; // application that created the original document
559 OUString Producer; // OpenOffice
560 };
561
563 {
564 DrawColor, DrawGreyscale
565 };
566
568 {
569 /* must be a valid file: URL usable by osl */
570 OUString URL;
571 /* the URL of the document being exported, used for relative links*/
572 OUString BaseURL;
573 /*if relative to file system should be formed*/
574 bool RelFsys;//i56629, i49415?, i64585?
575 /*the action to set the PDF hyperlink to*/
577 //convert the .od? target file type in a link to a .pdf type
578 //this is examined before doing anything else
580 //when the file type is .pdf, force the GoToR action
582
583 /* decides the PDF language level to be produced */
585
586 /* PDF/UA compliance */
588
589 /* valid for PDF >= 1.4
590 causes the MarkInfo entry in the document catalog to be set
591 */
592 bool Tagged;
593 /* determines in which format a form
594 will be submitted.
595 */
598 /* the following data members are used to customize the PDF viewer
599 preferences
600 */
601 /* see 3.6.1 PDF v 1.4 ref*/
604 // in percent, valid only if PDFDocumentAction == ActionZoom
605 sal_Int32 Zoom;
606
607 /* see 8.6 PDF v 1.4 ref
608 specifies whether to hide the viewer tool
609 bars when the document is active.
610 */
620 // initially visible page in viewer (starting with 0 for first page)
621 sal_Int32 InitialPage;
622 sal_Int32 OpenBookmarkLevels; // -1 means all levels
623
626
628 OUString SignLocation;
629 OUString SignPassword;
630 OUString SignReason;
631 OUString SignContact;
632 css::lang::Locale DocumentLocale; // defines the document default language
633 sal_uInt32 DPIx, DPIy; // how to handle MapMode( MapUnit::MapPixel )
634 // 0 here specifies a default handling
636 css::uno::Reference< css::security::XCertificate> SignCertificate;
637 OUString SignTSA;
640
642 RelFsys( false ), //i56629, i49415?, i64585?
643 DefaultLinkAction( PDFWriter::URIAction ),
644 ConvertOOoTargetToPDFTarget( false ),
645 ForcePDFAction( false ),
646 Version(PDFWriter::PDFVersion::PDF_1_7),
647 UniversalAccessibilityCompliance( false ),
648 Tagged( false ),
649 SubmitFormat( PDFWriter::FDF ),
650 AllowDuplicateFieldNames( false ),
651 PDFDocumentMode( PDFWriter::ModeDefault ),
652 PDFDocumentAction( PDFWriter::ActionDefault ),
653 Zoom( 100 ),
654 HideViewerToolbar( false ),
655 HideViewerMenubar( false ),
656 HideViewerWindowControls( false ),
657 FitWindow( false ),
658 OpenInFullScreenMode( false ),
659 CenterWindow( false ),
660 DisplayPDFDocumentTitle( true ),
661 PageLayout( PDFWriter::DefaultLayout ),
662 FirstPageLeft( false ),
663 InitialPage( 1 ),
664 OpenBookmarkLevels( -1 ),
665 SignPDF( false ),
666 DPIx( 0 ),
667 DPIy( 0 ),
668 ColorMode( PDFWriter::DrawColor ),
669 UseReferenceXObject( false )
670 {}
671 };
672
673 PDFWriter( const PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >& );
674 ~PDFWriter();
675
683 OutputDevice* GetReferenceDevice();
684
693 void NewPage( double nPageWidth, double nPageHeight, Orientation eOrientation = Orientation::Inherit );
697 {
702
704 : m_nMaxImageResolution( 0 )
705 , m_bOnlyLosslessCompression( false )
706 , m_nJPEGQuality( 90 )
707 , m_bTransparenciesWereRemoved( false )
708 {}
709
710 };
711 void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = nullptr );
712
713 /* sets the document locale originally passed with the context to a new value
714 * only affects the output if used before calling Emit.
715 */
716 void SetDocumentLocale( const css::lang::Locale& rDocLocale );
717
718 /* finishes the file */
719 bool Emit();
720
721 /*
722 * Get a list of errors that occurred during processing
723 * this should enable the producer to give feedback about
724 * any anomalies that might have occurred
725 */
726 std::set< ErrorCode > const & GetErrors() const;
727
728 // uses 128bit encryption
729 static css::uno::Reference< css::beans::XMaterialHolder >
730 InitEncryption( const OUString& i_rOwnerPassword,
731 const OUString& i_rUserPassword
732 );
733
734 /* functions for graphics state */
735 /* flag values: see vcl/outdev.hxx */
736 void Push( PushFlags nFlags = PushFlags::ALL );
737 void Pop();
738
739 void SetClipRegion();
740 void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
741 void MoveClipRegion( tools::Long nHorzMove, tools::Long nVertMove );
742 void IntersectClipRegion( const tools::Rectangle& rRect );
743 void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
744
745 void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nMode );
746 void SetDigitLanguage( LanguageType eLang );
747
748 void SetLineColor( const Color& rColor );
750
751 void SetFillColor( const Color& rColor );
753
754 void SetFont( const vcl::Font& rNewFont );
755 void SetTextColor( const Color& rColor );
756 void SetTextFillColor();
757 void SetTextFillColor( const Color& rColor );
758
759 void SetTextLineColor();
760 void SetTextLineColor( const Color& rColor );
761 void SetOverlineColor();
762 void SetOverlineColor( const Color& rColor );
763 void SetTextAlign( ::TextAlign eAlign );
764
765 void SetMapMode( const MapMode& rNewMapMode );
766
767
768 /* actual drawing functions */
769 void DrawText( const Point& rPos, const OUString& rText );
770
771 void DrawTextLine( const Point& rPos, tools::Long nWidth,
772 FontStrikeout eStrikeout,
773 FontLineStyle eUnderline,
774 FontLineStyle eOverline );
775 void DrawTextArray( const Point& rStartPt, const OUString& rStr,
776 KernArraySpan aKernArray,
777 o3tl::span<const sal_Bool> pKashidaAry,
778 sal_Int32 nIndex,
779 sal_Int32 nLen );
780 void DrawStretchText( const Point& rStartPt, sal_Int32 nWidth,
781 const OUString& rStr,
782 sal_Int32 nIndex, sal_Int32 nLen );
783 void DrawText( const tools::Rectangle& rRect,
784 const OUString& rStr, DrawTextFlags nStyle );
785
786 void DrawPixel( const Point& rPt, const Color& rColor );
787 void DrawPixel( const Point& rPt )
788 { DrawPixel( rPt, COL_TRANSPARENT ); }
789
790 void DrawLine( const Point& rStartPt, const Point& rEndPt );
791 void DrawLine( const Point& rStartPt, const Point& rEndPt,
792 const LineInfo& rLineInfo );
793 void DrawPolyLine( const tools::Polygon& rPoly );
794 void DrawPolyLine( const tools::Polygon& rPoly,
795 const LineInfo& rLineInfo );
796 void DrawPolyLine( const tools::Polygon& rPoly, const ExtLineInfo& rInfo );
797 void DrawPolygon( const tools::Polygon& rPoly );
798 void DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
799 void DrawRect( const tools::Rectangle& rRect );
800 void DrawRect( const tools::Rectangle& rRect,
801 sal_uInt32 nHorzRount, sal_uInt32 nVertRound );
802 void DrawEllipse( const tools::Rectangle& rRect );
803 void DrawArc( const tools::Rectangle& rRect,
804 const Point& rStartPt, const Point& rEndPt );
805 void DrawPie( const tools::Rectangle& rRect,
806 const Point& rStartPt, const Point& rEndPt );
807 void DrawChord( const tools::Rectangle& rRect,
808 const Point& rStartPt, const Point& rEndPt );
809
810 void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
811 const Bitmap& rBitmap, const Graphic& rGraphic );
812
813 void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
814 const BitmapEx& rBitmapEx );
815
816 void DrawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
817 void DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient );
818
819 void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
820
821 void DrawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWallpaper );
822 void DrawTransparent( const tools::PolyPolygon& rPolyPoly,
823 sal_uInt16 nTransparencePercent );
824
843 void BeginTransparencyGroup();
844
856 void EndTransparencyGroup( const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
857
877 void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
878
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);
931
933 sal_Int32 CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText, OUString const& rMimeType);
934
957 sal_Int32 RegisterDestReference( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
958
959
969 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
980 void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
981
983 void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
985 void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
986
1013 void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1030 sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1031
1045 void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr );
1046
1089 sal_Int32 BeginStructureElement( enum StructElement eType, std::u16string_view rAlias );
1097 void EndStructureElement();
1110 void SetCurrentStructureElement( sal_Int32 nElement );
1111
1125 void SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
1139 void SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
1150 void SetStructureBoundingBox( const tools::Rectangle& rRect );
1151
1155 void SetStructureAnnotIds(::std::vector<sal_Int32> const& rAnnotIds);
1156
1167 void SetActualText( const OUString& rText );
1168
1178 void SetAlternateText( const OUString& rText );
1179
1193 void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1194
1207 sal_Int32 CreateControl( const AnyWidget& rControlType );
1208
1226 void AddAttachedFile(OUString const& rFileName, OUString const& rMimeType, OUString const& rDescription, std::unique_ptr<PDFOutputStream> pStream);
1227
1229 static void AppendUnicodeTextString(const OUString& rString, OStringBuffer& rBuffer);
1230
1232 static OString GetDateTime();
1233};
1234
1235VCL_DLLPUBLIC void escapeStringXML( const OUString& rStr, OUString &rValue);
1236
1237}
1238
1239#endif // INCLUDED_VCL_PDFWRITER_HXX
1240
1241/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOColumn Column
struct _ADOIndex Index
DrawTextFlags
Page
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:39
Definition: edit.hxx:56
Definition: hatch.hxx:47
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
virtual void write(const css::uno::Reference< css::io::XOutputStream > &xStream)=0
void SetLineColor()
Definition: pdfwriter.hxx:749
PDFWriter & operator=(const PDFWriter &)=delete
PDFWriter(const PDFWriter &)=delete
@ Warning_Transparency_Omitted_PDFA
Definition: pdfwriter.hxx:215
@ Warning_Transparency_Omitted_PDF13
Definition: pdfwriter.hxx:219
@ Warning_Transparency_Converted
Definition: pdfwriter.hxx:227
@ Warning_FormAction_Omitted_PDFA
Definition: pdfwriter.hxx:223
void SetFillColor()
Definition: pdfwriter.hxx:752
void DrawPixel(const Point &rPt)
Definition: pdfwriter.hxx:787
ScopedVclPtr< PDFWriterImpl > xImplementation
Definition: pdfwriter.hxx:80
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
DocumentType eType
FontLineStyle
FontStrikeout
NONE
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
Type
Reference
Header
Layout
Regular
TextAlign
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
long Long
DateTime GetDateTime(const css::util::DateTime &_rDT)
ComplexTextLayoutFlags
Definition: State.hxx:76
PushFlags
Definition: State.hxx:40
void escapeStringXML(const OUString &rStr, OUString &rValue)
Placement
Definition: weld.hxx:2372
Orientation
Definition: prntypes.hxx:31
OUString Contents
Definition: pdfwriter.hxx:67
OUString Title
Definition: pdfwriter.hxx:66
css::util::DateTime maModificationDate
Definition: pdfwriter.hxx:68
virtual std::shared_ptr< AnyWidget > Clone() const =0
tools::Rectangle Location
Definition: pdfwriter.hxx:242
WidgetType getType() const
Definition: pdfwriter.hxx:280
AnyWidget & operator=(const AnyWidget &)=delete
AnyWidget(const AnyWidget &rSource)
Definition: pdfwriter.hxx:287
AnyWidget(WidgetType eType)
Definition: pdfwriter.hxx:267
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:358
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:453
std::vector< OUString > Entries
Definition: pdfwriter.hxx:446
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:415
std::vector< double > m_aDashArray
Definition: pdfwriter.hxx:96
std::vector< OUString > Entries
Definition: pdfwriter.hxx:425
std::vector< sal_Int32 > SelectedEntries
Definition: pdfwriter.hxx:426
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:437
std::vector< sal_uInt8 > UValue
Definition: pdfwriter.hxx:531
std::vector< sal_uInt8 > DocumentIdentifier
Definition: pdfwriter.hxx:533
std::vector< sal_uInt8 > EncryptionKey
Definition: pdfwriter.hxx:532
std::vector< sal_uInt8 > OValue
Definition: pdfwriter.hxx:530
PDFWriter::PDFLinkDefaultAction DefaultLinkAction
Definition: pdfwriter.hxx:576
PDFWriter::ExportDataFormat SubmitFormat
Definition: pdfwriter.hxx:596
css::uno::Reference< css::security::XCertificate > SignCertificate
Definition: pdfwriter.hxx:636
bool UseReferenceXObject
Use reference XObject markup for PDF images.
Definition: pdfwriter.hxx:639
PDFWriter::PDFViewerPageMode PDFDocumentMode
Definition: pdfwriter.hxx:602
PDFWriter::PDFViewerAction PDFDocumentAction
Definition: pdfwriter.hxx:603
PDFWriter::PDFEncryptionProperties Encryption
Definition: pdfwriter.hxx:624
PDFWriter::PDFDocInfo DocumentInfo
Definition: pdfwriter.hxx:625
PDFWriter::ColorMode ColorMode
Definition: pdfwriter.hxx:635
css::lang::Locale DocumentLocale
Definition: pdfwriter.hxx:632
Play a metafile like an outputdevice would do.
Definition: pdfwriter.hxx:697
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:341
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:377
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:465
OUString Name