Line data Source code
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 _VCL_PDFWRITER_HXX
20 : #define _VCL_PDFWRITER_HXX
21 :
22 : #include <sal/types.h>
23 :
24 : #include <tools/gen.hxx>
25 : #include <tools/string.hxx>
26 : #include <tools/color.hxx>
27 :
28 : #include <vcl/dllapi.h>
29 : #include <vcl/vclenum.hxx>
30 : #include <vcl/font.hxx>
31 : #include <vcl/graphictools.hxx>
32 :
33 : #include "com/sun/star/io/XOutputStream.hpp"
34 : #include "com/sun/star/beans/XMaterialHolder.hpp"
35 : #include "com/sun/star/security/XCertificate.hpp"
36 : #include "com/sun/star/lang/Locale.hpp"
37 :
38 : #include <boost/scoped_ptr.hpp>
39 :
40 : #include <list>
41 : #include <vector>
42 : #include <set>
43 :
44 : class Font;
45 : class Point;
46 : class OutputDevice;
47 : class GDIMetaFile;
48 : class MapMode;
49 : class Polygon;
50 : class LineInfo;
51 : class PolyPolygon;
52 : class Bitmap;
53 : class BitmapEx;
54 : class Image;
55 : class Gradient;
56 : class Hatch;
57 : class Wallpaper;
58 :
59 : namespace vcl
60 : {
61 :
62 : class PDFExtOutDevData;
63 : class PDFWriterImpl;
64 :
65 0 : struct PDFNote
66 : {
67 : String Title; // optional title for the popup containing the note
68 : String Contents; // contents of the note
69 : };
70 :
71 0 : class VCL_DLLPUBLIC PDFOutputStream
72 : {
73 : public:
74 : virtual ~PDFOutputStream();
75 : virtual void write( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xStream ) = 0;
76 : };
77 :
78 : class VCL_DLLPUBLIC PDFWriter
79 : {
80 : boost::scoped_ptr<PDFWriterImpl> pImplementation;
81 : public:
82 : // extended line info
83 : enum CapType { capButt, capRound, capSquare };
84 : enum JoinType { joinMiter, joinRound, joinBevel };
85 0 : struct ExtLineInfo
86 : {
87 : double m_fLineWidth;
88 : double m_fTransparency;
89 : CapType m_eCap;
90 : JoinType m_eJoin;
91 : double m_fMiterLimit;
92 : std::vector< double > m_aDashArray;
93 :
94 0 : ExtLineInfo() : m_fLineWidth( 0.0 ),
95 : m_fTransparency( 0.0 ),
96 : m_eCap( capButt ),
97 : m_eJoin( joinMiter ),
98 0 : m_fMiterLimit( 10.0 )
99 0 : {}
100 : };
101 :
102 : enum Orientation { Portrait, Landscape, Seascape, Inherit };
103 :
104 : // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
105 : enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
106 : // for the meaning of DestAreaType please look at PDF Reference Manual
107 : // version 1.4 section 8.2.1, page 475
108 : enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
109 : FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
110 : FitPageBoundingBoxVertical
111 : };
112 :
113 : // for a definition of structural element types please refer to
114 : // PDF Reference, 3rd ed. section 9.7.4
115 : enum StructElement
116 : {
117 : // special element to place outside the structure hierarchy
118 : NonStructElement,
119 : // Grouping elements
120 : Document, Part, Article, Section, Division, BlockQuote,
121 : Caption, TOC, TOCI, Index,
122 :
123 : // block level elements
124 : Paragraph, Heading, H1, H2, H3, H4, H5, H6,
125 : List, ListItem, LILabel, LIBody,
126 : Table, TableRow, TableHeader, TableData,
127 :
128 : // inline level elements
129 : Span, Quote, Note, Reference, BibEntry, Code, Link,
130 :
131 : // illustration elements
132 : Figure, Formula, Form
133 : };
134 :
135 : enum StructAttribute
136 : {
137 : Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
138 : TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
139 : LineHeight, BaselineShift, TextDecorationType, ListNumbering,
140 : RowSpan, ColSpan,
141 :
142 : // link destination is an artificial attribute that sets
143 : // the link annotation ID of a Link element
144 : // further note: since structure attributes can only be
145 : // set during content creation, but links can be
146 : // created after the fact, it is possible to set
147 : // an arbitrary id as structure attribute here. In this
148 : // case the arbitrary id has to be passed again when the
149 : // actual link annotation is created via SetLinkPropertyID
150 : LinkAnnotation,
151 : // Language currently sets a LanguageType (see i18nlangtag/lang.h)
152 : // which will be internally changed to a corresponding locale
153 : Language
154 : };
155 :
156 : enum StructAttributeValue
157 : {
158 : Invalid,
159 : NONE,
160 : // Placement
161 : Block, Inline, Before, After, Start, End,
162 : // WritingMode
163 : LrTb, RlTb, TbRl,
164 : // TextAlign
165 : Center, Justify,
166 : // Width, Height,
167 : Auto,
168 : // BlockAlign
169 : Middle,
170 : // LineHeight
171 : Normal,
172 : // TextDecorationType
173 : Underline, Overline, LineThrough,
174 : // ListNumbering
175 : Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
176 : };
177 :
178 : enum PageTransition
179 : {
180 : Regular,
181 : SplitHorizontalInward, SplitHorizontalOutward,
182 : SplitVerticalInward, SplitVerticalOutward,
183 : BlindsHorizontal, BlindsVertical,
184 : BoxInward, BoxOutward,
185 : WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
186 : Dissolve,
187 : GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
188 : };
189 :
190 : enum WidgetType
191 : {
192 : PushButton, RadioButton, CheckBox, Edit, ListBox, ComboBox, Hierarchy,
193 : Signature
194 : };
195 :
196 : enum WidgetState
197 : {
198 : // PushButton, RadioButton, CheckBox; Down means selected for
199 : // RadioButton and CheckBox
200 : Up, Down
201 : };
202 :
203 : enum ErrorCode
204 : {
205 : // transparent object occurred and was draw opaque because
206 : // PDF/A does not allow transparency
207 : Warning_Transparency_Omitted_PDFA,
208 :
209 : // transparent object occurred but is only supported since
210 : // PDF 1.4
211 : Warning_Transparency_Omitted_PDF13,
212 :
213 : // a form action was exported that is not suitable for PDF/A
214 : // the action was skipped
215 : Warning_FormAction_Omitted_PDFA,
216 :
217 : // transparent objects were converted to a bitmap in order
218 : // to removetransparencies from the output
219 : Warning_Transparency_Converted
220 : };
221 :
222 : struct VCL_DLLPUBLIC AnyWidget
223 : {
224 : protected:
225 : WidgetType Type; // primitive RTTI
226 : public:
227 : OUString Name; // a distinct name to identify the control
228 : OUString Description;// descriptive text for the contro (e.g. for tool tip)
229 : OUString Text; // user text to appear on the control
230 : sal_uInt16 TextStyle; // style flags
231 : bool ReadOnly;
232 : Rectangle Location; // describes the area filled by the control
233 : bool Border; // true: widget should have a border, false: no border
234 : Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
235 : bool Background; // true: widget shall draw its background, false: no background
236 : Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
237 : Font TextFont; // an empty font will be replaced by the
238 : // appropriate font from the user settings
239 : Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
240 : sal_Int32 TabOrder; // lowest number is first in tab order
241 :
242 : /* style flags for text are those for OutputDevice::DrawText
243 : allowed values are:
244 : TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
245 : TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
246 : TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
247 :
248 : if TextStyle is 0, then each control will fill in default values
249 : */
250 :
251 : // note: the Name member comprises the field name of the resulting
252 : // PDF field names need to be globally unique. Therefore if any
253 : // Widget with an already used name is created, the name will be
254 : // made unique by adding an underscore ('_') and an ascending number
255 : // to the name.
256 :
257 0 : AnyWidget( WidgetType eType ) :
258 : Type( eType ),
259 : TextStyle( 0 ),
260 : ReadOnly( false ),
261 : Border( false ),
262 : BorderColor( COL_TRANSPARENT ),
263 : Background( false ),
264 : BackgroundColor( COL_TRANSPARENT ),
265 : TextColor( COL_TRANSPARENT ),
266 0 : TabOrder( -1 )
267 0 : {}
268 : virtual ~AnyWidget();
269 :
270 0 : WidgetType getType() const { return Type; }
271 :
272 : virtual AnyWidget* Clone() const = 0;
273 :
274 : protected:
275 : // note that this equals the default compiler-generated copy-ctor, but we want to have it
276 : // protected, to only allow sub classes to access it
277 0 : AnyWidget( const AnyWidget& rSource )
278 : :Type( rSource.Type )
279 : ,Name( rSource.Name )
280 : ,Description( rSource.Description )
281 : ,Text( rSource.Text )
282 : ,TextStyle( rSource.TextStyle )
283 : ,ReadOnly( rSource.ReadOnly )
284 : ,Location( rSource.Location )
285 : ,Border( rSource.Border )
286 : ,BorderColor( rSource.BorderColor )
287 : ,Background( rSource.Background )
288 : ,BackgroundColor( rSource.BackgroundColor )
289 : ,TextFont( rSource.TextFont )
290 : ,TextColor( rSource.TextColor )
291 0 : ,TabOrder( rSource.TabOrder )
292 : {
293 0 : }
294 : AnyWidget& operator=( const AnyWidget& ); // never implemented
295 : };
296 :
297 0 : struct PushButtonWidget : public AnyWidget
298 : {
299 : /* If Dest is set to a valid link destination,
300 : Then pressing the button will act as a goto
301 : action within the document.
302 :
303 : Else:
304 : An empty URL means this button will reset the form.
305 :
306 : If URL is not empty and Submit is set, then the URL
307 : contained will be set as the URL to submit the
308 : form to. In this case the submit method will be
309 : either GET if SubmitGet is true or POST if
310 : SubmitGet is false.
311 :
312 : If URL is not empty and Submit is clear, then
313 : the URL contained will be interpreted as a
314 : hyperlink to be executed on pushing the button.
315 :
316 : There will be no error checking or any kind of
317 : conversion done to the URL parameter execept this:
318 : it will be output as 7bit Ascii. The URL
319 : will appear literally in the PDF file produced
320 : */
321 : sal_Int32 Dest;
322 : OUString URL;
323 : bool Submit;
324 : bool SubmitGet;
325 :
326 0 : PushButtonWidget()
327 : : AnyWidget( vcl::PDFWriter::PushButton ),
328 0 : Dest( -1 ), Submit( false ), SubmitGet( false )
329 0 : {}
330 :
331 0 : virtual AnyWidget* Clone() const
332 : {
333 0 : return new PushButtonWidget( *this );
334 : }
335 : };
336 :
337 0 : struct CheckBoxWidget : public AnyWidget
338 : {
339 : bool Checked;
340 : bool ButtonIsLeft;
341 :
342 0 : CheckBoxWidget()
343 : : AnyWidget( vcl::PDFWriter::CheckBox ),
344 : Checked( false ),
345 0 : ButtonIsLeft( true )
346 0 : {}
347 :
348 0 : virtual AnyWidget* Clone() const
349 : {
350 0 : return new CheckBoxWidget( *this );
351 : }
352 : };
353 :
354 0 : struct RadioButtonWidget : public AnyWidget
355 : {
356 : bool Selected;
357 : sal_Int32 RadioGroup;
358 : bool ButtonIsLeft;
359 : OUString OnValue; // the value of the radio button if it is selected
360 :
361 0 : RadioButtonWidget()
362 : : AnyWidget( vcl::PDFWriter::RadioButton ),
363 : Selected( false ),
364 : RadioGroup( 0 ),
365 0 : ButtonIsLeft( true )
366 0 : {}
367 :
368 0 : virtual AnyWidget* Clone() const
369 : {
370 0 : return new RadioButtonWidget( *this );
371 : }
372 : // radio buttons having the same RadioGroup id comprise one
373 : // logical radio button group, that is at most one of the RadioButtons
374 : // in a group can be checked at any time
375 : //
376 : // note: a PDF radio button field consists of a named field
377 : // containing unnamed checkbox child fields. The name of the
378 : // radio button field is taken from the first RadioButtonWidget created
379 : // in the group
380 : };
381 :
382 0 : struct EditWidget : public AnyWidget
383 : {
384 : bool MultiLine; // whether multiple lines are allowed
385 : bool Password; // visible echo off
386 : bool FileSelect; // field is a file selector
387 : sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
388 :
389 0 : EditWidget()
390 : : AnyWidget( vcl::PDFWriter::Edit ),
391 : MultiLine( false ),
392 : Password( false ),
393 : FileSelect( false ),
394 0 : MaxLen( 0 )
395 0 : {}
396 :
397 0 : virtual AnyWidget* Clone() const
398 : {
399 0 : return new EditWidget( *this );
400 : }
401 : };
402 :
403 0 : struct ListBoxWidget : public AnyWidget
404 : {
405 : bool DropDown;
406 : bool Sort;
407 : bool MultiSelect;
408 : std::vector<OUString> Entries;
409 : std::vector<sal_Int32> SelectedEntries;
410 : // if MultiSelect is false only the first entry of SelectedEntries
411 : // will be taken into account. the same is implicit for PDF < 1.4
412 : // since multiselect is a 1.4+ feature
413 :
414 0 : ListBoxWidget()
415 : : AnyWidget( vcl::PDFWriter::ListBox ),
416 : DropDown( false ),
417 : Sort( false ),
418 0 : MultiSelect( false )
419 0 : {}
420 :
421 0 : virtual AnyWidget* Clone() const
422 : {
423 0 : return new ListBoxWidget( *this );
424 : }
425 : };
426 :
427 : // note: PDF only supports dropdown comboboxes
428 0 : struct ComboBoxWidget : public AnyWidget
429 : {
430 : bool Sort;
431 : std::vector<OUString> Entries;
432 : // set the current value in AnyWidget::Text
433 :
434 0 : ComboBoxWidget()
435 : : AnyWidget( vcl::PDFWriter::ComboBox ),
436 0 : Sort( false )
437 0 : {}
438 :
439 0 : virtual AnyWidget* Clone() const
440 : {
441 0 : return new ComboBoxWidget( *this );
442 : }
443 : };
444 :
445 0 : struct SignatureWidget: public AnyWidget
446 : {
447 : // Use Sig prefix for members to avoid conflict with
448 : // the Location member of the AnyWidget which spcifies the coordinates
449 : // of the signature
450 :
451 : OUString SigLocation;
452 : OUString SigReason;
453 : OUString SigContactInfo;
454 : bool SigHidden;
455 :
456 0 : SignatureWidget()
457 : : AnyWidget( vcl::PDFWriter::Signature ),
458 0 : SigHidden( true )
459 0 : {}
460 :
461 0 : virtual AnyWidget* Clone() const
462 : {
463 0 : return new SignatureWidget( *this );
464 : }
465 : };
466 :
467 : enum ExportDataFormat { HTML, XML, FDF, PDF };
468 : // see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
469 : // These emuns are treated as integer while reading/writing to configuration
470 : enum PDFViewerPageMode
471 : {
472 : ModeDefault,
473 : UseOutlines,
474 : UseThumbs
475 : };
476 : // These emuns are treated as integer while reading/writing to configuration
477 : enum PDFViewerAction
478 : {
479 : ActionDefault,
480 : FitInWindow,
481 : FitWidth,
482 : FitVisible,
483 : ActionZoom
484 : };
485 : // These enums are treated as integer while reading/writing to configuration
486 : enum PDFPageLayout
487 : {
488 : DefaultLayout,
489 : SinglePage,
490 : Continuous,
491 : ContinuousFacing
492 : };
493 :
494 : // These emuns are treated as integer while reading/writing to configuration
495 : //what default action to generate in a PDF hyperlink to external document/site
496 : enum PDFLinkDefaultAction
497 : {
498 : URIAction,
499 : URIActionDestination,
500 : LaunchAction
501 : };
502 :
503 : /*
504 : The following structure describes the permissions used in PDF security
505 : */
506 0 : struct PDFEncryptionProperties
507 : {
508 :
509 : bool Security128bit; // true to select 128 bit encryption, false for 40 bit
510 : //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.
511 : bool CanPrintTheDocument;
512 : bool CanModifyTheContent;
513 : bool CanCopyOrExtract;
514 : bool CanAddOrModify;
515 : //for revision 3 (bit 128 security) only
516 : bool CanFillInteractive;
517 : bool CanExtractForAccessibility;
518 : bool CanAssemble;
519 : bool CanPrintFull;
520 :
521 : // encryption will only happen if EncryptionKey is not empty
522 : // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
523 : // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
524 : // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
525 : // PDFDocInfo, Owner password and User password used the InitEncryption method which
526 : // implements the algorithms described in the PDF reference chapter 3.5: Encryption
527 : std::vector<sal_uInt8> OValue;
528 : std::vector<sal_uInt8> UValue;
529 : std::vector<sal_uInt8> EncryptionKey;
530 : std::vector<sal_uInt8> DocumentIdentifier;
531 :
532 : //permission default set for 128 bit, accessibility only
533 0 : PDFEncryptionProperties() :
534 : Security128bit ( true ),
535 : CanPrintTheDocument ( false ),
536 : CanModifyTheContent ( false ),
537 : CanCopyOrExtract ( false ),
538 : CanAddOrModify ( false ),
539 : CanFillInteractive ( false ),
540 : CanExtractForAccessibility ( true ),
541 : CanAssemble ( false ),
542 0 : CanPrintFull ( false )
543 0 : {}
544 :
545 :
546 0 : bool Encrypt() const
547 0 : { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
548 : };
549 :
550 0 : struct PDFDocInfo
551 : {
552 : String Title; // document title
553 : String Author; // document author
554 : String Subject; // subject
555 : String Keywords; // keywords
556 : String Creator; // application that created the original document
557 : String Producer; // OpenOffice
558 : };
559 :
560 : enum ColorMode
561 : {
562 : DrawColor, DrawGreyscale
563 : };
564 :
565 0 : struct PDFWriterContext
566 : {
567 : /* must be a valid file: URL usable by osl */
568 : OUString URL;
569 : /* the URL of the document being exported, used for relative links*/
570 : OUString BaseURL;
571 : /*if relative to file system should be formed*/
572 : bool RelFsys;//i56629, i49415?, i64585?
573 : /*the action to set the PDF hyperlink to*/
574 : PDFWriter::PDFLinkDefaultAction DefaultLinkAction;
575 : //convert the .od? target file type in a link to a .pdf type
576 : //this is examined before doing anything else
577 : bool ConvertOOoTargetToPDFTarget;
578 : //when the file type is .pdf, force the GoToR action
579 : bool ForcePDFAction;
580 :
581 : /* decides the PDF language level to be produced */
582 : PDFVersion Version;
583 : /* valid for PDF >= 1.4
584 : causes the MarkInfo entry in the document catalog to be set
585 : */
586 : bool Tagged;
587 : /* determines in which format a form
588 : will be submitted.
589 : */
590 : PDFWriter::ExportDataFormat SubmitFormat;
591 : bool AllowDuplicateFieldNames;
592 : bool FieldsUseSystemFonts;
593 : /* the following data members are used to customize the PDF viewer
594 : preferences
595 : */
596 : /* see 3.6.1 PDF v 1.4 ref*/
597 : PDFWriter::PDFViewerPageMode PDFDocumentMode;
598 : PDFWriter::PDFViewerAction PDFDocumentAction;
599 : // in percent, valid only if PDFDocumentAction == ActionZoom
600 : sal_Int32 Zoom;
601 :
602 : /* see 8.6 PDF v 1.4 ref
603 : specifies whether to hide the viewer tool
604 : bars when the document is active.
605 : */
606 : bool HideViewerToolbar;
607 : bool HideViewerMenubar;
608 : bool HideViewerWindowControls;
609 : bool FitWindow;
610 : bool OpenInFullScreenMode;
611 : bool CenterWindow;
612 : bool DisplayPDFDocumentTitle;
613 : PDFPageLayout PageLayout;
614 : bool FirstPageLeft;
615 : // intially visible page in viewer (starting with 0 for first page)
616 : sal_Int32 InitialPage;
617 : sal_Int32 OpenBookmarkLevels; // -1 means all levels
618 :
619 : PDFWriter::PDFEncryptionProperties Encryption;
620 : PDFWriter::PDFDocInfo DocumentInfo;
621 :
622 : bool SignPDF;
623 : OUString SignLocation;
624 : OUString SignPassword;
625 : OUString SignReason;
626 : OUString SignContact;
627 : com::sun::star::lang::Locale DocumentLocale; // defines the document default language
628 : sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
629 : // 0 here specifies a default handling
630 : PDFWriter::ColorMode ColorMode;
631 : com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate;
632 :
633 0 : PDFWriterContext() :
634 : RelFsys( false ), //i56629, i49415?, i64585?
635 : DefaultLinkAction( PDFWriter::URIAction ),
636 : ConvertOOoTargetToPDFTarget( false ),
637 : ForcePDFAction( false ),
638 : Version( PDFWriter::PDF_1_4 ),
639 : Tagged( false ),
640 : SubmitFormat( PDFWriter::FDF ),
641 : AllowDuplicateFieldNames( false ),
642 : FieldsUseSystemFonts( true ),
643 : PDFDocumentMode( PDFWriter::ModeDefault ),
644 : PDFDocumentAction( PDFWriter::ActionDefault ),
645 : Zoom( 100 ),
646 : HideViewerToolbar( false ),
647 : HideViewerMenubar( false ),
648 : HideViewerWindowControls( false ),
649 : FitWindow( false ),
650 : OpenInFullScreenMode( false ),
651 : CenterWindow( false ),
652 : DisplayPDFDocumentTitle( true ),
653 : PageLayout( PDFWriter::DefaultLayout ),
654 : FirstPageLeft( false ),
655 : InitialPage( 1 ),
656 : OpenBookmarkLevels( -1 ),
657 : Encryption(),
658 : SignPDF( false ),
659 : DPIx( 0 ),
660 : DPIy( 0 ),
661 : ColorMode( PDFWriter::DrawColor ),
662 0 : SignCertificate( 0 )
663 0 : {}
664 : };
665 :
666 : PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
667 : ~PDFWriter();
668 :
669 : /** Returns an OutputDevice for formatting
670 : <p>This Output device is guaranteed to use the same
671 : font metrics as the resulting PDF file.</p>
672 :
673 : @returns
674 : the reference output device
675 : */
676 : OutputDevice* GetReferenceDevice();
677 :
678 : /** Creates a new page to fill
679 : <p>If width and height are not set the page size
680 : is inherited from the page tree</p>
681 : <p>other effects:
682 : resets the graphics state: MapMode, Font
683 : Colors and other state information MUST
684 : be set again or are undefined.
685 : </p>
686 :
687 : @returns
688 : returns the page id of the new page
689 : */
690 : sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
691 : /** Play a metafile like an outputdevice would do
692 : */
693 : struct PlayMetafileContext
694 : {
695 : int m_nMaxImageResolution;
696 : bool m_bOnlyLosslessCompression;
697 : int m_nJPEGQuality;
698 : bool m_bTransparenciesWereRemoved;
699 :
700 0 : PlayMetafileContext()
701 : : m_nMaxImageResolution( 0 )
702 : , m_bOnlyLosslessCompression( false )
703 : , m_nJPEGQuality( 90 )
704 0 : , m_bTransparenciesWereRemoved( false )
705 0 : {}
706 :
707 : };
708 : void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
709 :
710 : /* sets the document locale originally passed with the context to a new value
711 : * only affects the output if used before calling <code>Emit/code>.
712 : */
713 : void SetDocumentLocale( const com::sun::star::lang::Locale& rDocLocale );
714 :
715 : /* finishes the file */
716 : bool Emit();
717 :
718 : /*
719 : * Get a list of errors that occurred during processing
720 : * this should enable the producer to give feedback about
721 : * any anomalies that might have occurred
722 : */
723 : std::set< ErrorCode > GetErrors();
724 :
725 : static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
726 : InitEncryption( const OUString& i_rOwnerPassword,
727 : const OUString& i_rUserPassword,
728 : bool b128Bit
729 : );
730 :
731 : /* functions for graphics state */
732 : /* flag values: see vcl/outdev.hxx */
733 : void Push( sal_uInt16 nFlags = 0xffff );
734 : void Pop();
735 :
736 : void SetClipRegion();
737 : void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
738 : void MoveClipRegion( long nHorzMove, long nVertMove );
739 : void IntersectClipRegion( const Rectangle& rRect );
740 : void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
741 :
742 : void SetLayoutMode( sal_uLong nMode );
743 : void SetDigitLanguage( LanguageType eLang );
744 :
745 : void SetLineColor( const Color& rColor );
746 0 : void SetLineColor() { SetLineColor( Color( COL_TRANSPARENT ) ); }
747 :
748 : void SetFillColor( const Color& rColor );
749 0 : void SetFillColor() { SetFillColor( Color( COL_TRANSPARENT ) ); }
750 :
751 : void SetFont( const Font& rNewFont );
752 : void SetTextColor( const Color& rColor );
753 : void SetTextFillColor();
754 : void SetTextFillColor( const Color& rColor );
755 :
756 : void SetTextLineColor();
757 : void SetTextLineColor( const Color& rColor );
758 : void SetOverlineColor();
759 : void SetOverlineColor( const Color& rColor );
760 : void SetTextAlign( ::TextAlign eAlign );
761 :
762 : void SetMapMode( const MapMode& rNewMapMode );
763 :
764 :
765 : /* actual drawing functions */
766 : void DrawText( const Point& rPos, const String& rText );
767 :
768 : void DrawTextLine( const Point& rPos, long nWidth,
769 : FontStrikeout eStrikeout,
770 : FontUnderline eUnderline,
771 : FontUnderline eOverline,
772 : sal_Bool bUnderlineAbove = sal_False );
773 : void DrawTextArray( const Point& rStartPt, const XubString& rStr,
774 : const sal_Int32* pDXAry = NULL,
775 : xub_StrLen nIndex = 0,
776 : xub_StrLen nLen = STRING_LEN );
777 : void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
778 : const XubString& rStr,
779 : xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
780 : void DrawText( const Rectangle& rRect,
781 : const XubString& rStr, sal_uInt16 nStyle = 0 );
782 :
783 : void DrawPixel( const Point& rPt, const Color& rColor );
784 0 : void DrawPixel( const Point& rPt )
785 0 : { DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
786 :
787 : void DrawLine( const Point& rStartPt, const Point& rEndPt );
788 : void DrawLine( const Point& rStartPt, const Point& rEndPt,
789 : const LineInfo& rLineInfo );
790 : void DrawPolyLine( const Polygon& rPoly );
791 : void DrawPolyLine( const Polygon& rPoly,
792 : const LineInfo& rLineInfo );
793 : void DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
794 : void DrawPolygon( const Polygon& rPoly );
795 : void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
796 : void DrawRect( const Rectangle& rRect );
797 : void DrawRect( const Rectangle& rRect,
798 : sal_uLong nHorzRount, sal_uLong nVertRound );
799 : void DrawEllipse( const Rectangle& rRect );
800 : void DrawArc( const Rectangle& rRect,
801 : const Point& rStartPt, const Point& rEndPt );
802 : void DrawPie( const Rectangle& rRect,
803 : const Point& rStartPt, const Point& rEndPt );
804 : void DrawChord( const Rectangle& rRect,
805 : const Point& rStartPt, const Point& rEndPt );
806 :
807 : void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
808 : const Bitmap& rBitmap );
809 :
810 : void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
811 : const BitmapEx& rBitmapEx );
812 :
813 : void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
814 : void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
815 :
816 : void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
817 :
818 : void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
819 : void DrawTransparent( const PolyPolygon& rPolyPoly,
820 : sal_uInt16 nTransparencePercent );
821 :
822 : /** Start a transparency group
823 :
824 : Drawing operations can be grouped together to acquire a common transparency
825 : behaviour; after calling <code>BeginTransparencyGroup</code> all drawing
826 : operations will be grouped together into a transparent object.
827 :
828 : The transparency behaviour is set with ond of the <code>EndTransparencyGroup</code>
829 : calls and can be either a constant transparency factor or a transparent
830 : soft mask in form of an 8 bit gray scale bitmap.
831 :
832 : It is permissible to nest transparency group.
833 :
834 : Transparency groups MUST NOT span multiple pages
835 :
836 : Transparency is a feature introduced in PDF1.4, so transparency group
837 : will be ignored if the produced PDF has a lower version. The drawing
838 : operations will be emitted normally.
839 : */
840 : void BeginTransparencyGroup();
841 :
842 : /** End a transparency group with constant transparency factor
843 :
844 : This ends a transparency group and inserts it on the current page. The
845 : coordinates of the group result out of the grouped drawing operations.
846 :
847 : @param rBoundRect
848 : The bounding rectangle of the group
849 :
850 : @param nTransparencePercent
851 : The transparency factor
852 : */
853 : void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
854 :
855 : /** Insert a JPG encoded image (optionally with mask)
856 :
857 : @param rJPGData
858 : a Stream containing the encoded image
859 :
860 : @param bIsTrueColor
861 : true: jpeg is 24 bit true color, false: jpeg is 8 bit greyscale
862 :
863 : @param rSrcSizePixel
864 : size in pixel of the image
865 :
866 : @param rTargetArea
867 : where to put the image
868 :
869 : @param rMask
870 : optional mask; if not empty it must have
871 : the same pixel size as the image and
872 : be either 1 bit black&white or 8 bit grey
873 : */
874 : void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
875 :
876 : /** Create a new named destination to be used in a link from another PDF document
877 :
878 : @parm sDestName
879 : the name (label) of the bookmark, to be used to jump to
880 :
881 : @param rRect
882 : target rectangle on page to be displayed if dest is jumped to
883 :
884 : @param nPageNr
885 : number of page the dest is on (as returned by NewPage)
886 : or -1 in which case the current page is used
887 :
888 : @param eType
889 : what dest type to use
890 :
891 : @returns
892 : the destination id (to be used in SetLinkDest) or
893 : -1 if page id does not exist
894 : */
895 : sal_Int32 CreateNamedDest( const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
896 : /** Create a new destination to be used in a link
897 :
898 : @param rRect
899 : target rectangle on page to be displayed if dest is jumped to
900 :
901 : @param nPageNr
902 : number of page the dest is on (as returned by NewPage)
903 : or -1 in which case the current page is used
904 :
905 : @param eType
906 : what dest type to use
907 :
908 : @returns
909 : the destination id (to be used in SetLinkDest) or
910 : -1 if page id does not exist
911 : */
912 : sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
913 : /** Create a new link on a page
914 :
915 : @param rRect
916 : active rectangle of the link (that is the area that has to be
917 : hit to activate the link)
918 :
919 : @param nPageNr
920 : number of page the link is on (as returned by NewPage)
921 : or -1 in which case the current page is used
922 :
923 : @returns
924 : the link id (to be used in SetLinkDest, SetLinkURL) or
925 : -1 if page id does not exist
926 : */
927 : sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
928 :
929 : /** creates a destination which is not intended to be referred to by a link, but by a public destination Id.
930 :
931 : Form widgets, for instance, might refer to a destination, without ever actually creating a source link to
932 : point to this destination. In such cases, a public destination Id will be assigned to the form widget,
933 : and later on, the concrete destination data for this public Id will be registered using RegisterDestReference.
934 :
935 : @param rRect
936 : target rectangle on page to be displayed if dest is jumped to
937 :
938 : @param nPageNr
939 : number of page the dest is on (as returned by NewPage)
940 : or -1 in which case the current page is used
941 :
942 : @param eType
943 : what dest type to use
944 :
945 : @returns
946 : the internal destination Id.
947 : */
948 : sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
949 :
950 :
951 : /** Set the destination for a link
952 : <p>will change a URL type link to a dest link if necessary</p>
953 :
954 : @param nLinkId
955 : the link to be changed
956 :
957 : @param nDestId
958 : the dest the link shall point to
959 : @returns
960 : 0 for success
961 : -1 in case the link id does not exist
962 : -2 in case the dest id does not exist
963 : */
964 : sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
965 : /** Set the URL for a link
966 : <p>will change a dest type link to an URL type link if necessary</p>
967 : @param nLinkId
968 : the link to be changed
969 :
970 : @param rURL
971 : the URL the link shall point to.
972 : The URL will be parsed (and corrected) by the <code>com.sun.star.util.URLTransformer</code>
973 : service; the result will then appear literally in the PDF file produced
974 :
975 : @returns
976 : 0 for success
977 : -1 in case the link id does not exist
978 : */
979 : sal_Int32 SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
980 : /** Resolve link in logical structure
981 : <p>
982 : If a link is created after the corresponding visual appearance was drawn
983 : it is not possible to set the link id as a property attribute to the
984 : link structure item that should be created in tagged PDF around the
985 : visual appearance of a link.
986 : </p>
987 : <p>
988 : For this reason an arbitrary id can be given to
989 : <code>SetStructureAttributeNumerical</code> at the time the text for
990 : the link is drawn. To resolve this arbitrary id again when the actual
991 : link annotation is created use SetLinkPropertyID. When <code>Emit</code>
992 : finally gets called all <code>LinkAnnotation</code> type structure attributes
993 : will be replaced with the correct link id.
994 : </p>
995 : <p>
996 : CAUTION: this technique must be used either for all or none of the links
997 : in a document since the link id space and arbitrary property id space
998 : could overlap and it would be impossible to resolve whether a <code>Link</code>
999 : structure attribute value was arbitrary or already a real id.
1000 : </p>
1001 :
1002 : @param nLinkId
1003 : the link to be mapped
1004 :
1005 : @param nPropertyID
1006 : the arbitrary id set in a <code>Link</code> structure element to address
1007 : the link with real id <code>nLinkId</code>
1008 : */
1009 : void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1010 : /** Create a new outline item
1011 :
1012 : @param nParent
1013 : declares the parent of the new item in the outline hierarchy.
1014 : An invalid value will result in a new toplevel item.
1015 :
1016 : @param rText
1017 : sets the title text of the item
1018 :
1019 : @param nDestId
1020 : declares which Dest (created with CreateDest) the outline item
1021 : will point to
1022 :
1023 : @returns
1024 : the outline item id of the new item
1025 : */
1026 : sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const OUString& rText = OUString(), sal_Int32 nDestID = -1 );
1027 :
1028 : /** Set an outline item's parent
1029 :
1030 : @param nItem
1031 : specififies which item should be reparented.
1032 :
1033 : @param nNewParent
1034 : specifies which outline item will be the item's new parent.
1035 : Use 0 for reparenting to top level.
1036 :
1037 : @returns
1038 : -1 if the item does not exist
1039 : -2 if the new parent does not exist, item will be reparented to top level.
1040 : */
1041 : sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
1042 :
1043 : /** Set an outline item's title text
1044 :
1045 : @param nItem
1046 : specififies which item should get a new text
1047 :
1048 : @param rText
1049 : sets the title text of the item
1050 :
1051 : @returns
1052 : 0 if the item exists and the text was changed
1053 : -1 if the item does not exist
1054 : */
1055 : sal_Int32 SetOutlineItemText( sal_Int32 nItem, const OUString& rText );
1056 :
1057 : /** Set an outline item's destination
1058 :
1059 : @param nItem
1060 : specififies which item should get a new dest
1061 :
1062 : @param nDestID
1063 : specifies the item's new destination
1064 :
1065 : @returns
1066 : -1 if the item does not exist
1067 : -2 if the new dest does not exist, dest will remain unchanged
1068 : */
1069 : sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
1070 :
1071 : /** Create a new note on a page
1072 :
1073 : @param rRect
1074 : active rectangle of the note (that is the area that has to be
1075 : hit to popup the annotation)
1076 :
1077 : @param rNote
1078 : specifies the contents of the note
1079 :
1080 : @param nPageNr
1081 : number of page the note is on (as returned by NewPage)
1082 : or -1 in which case the current page is used
1083 : */
1084 : void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
1085 :
1086 : /** begin a new logical structure element
1087 :
1088 : <p>
1089 : BeginStructureElement/EndStructureElement calls build the logical structure
1090 : of the PDF - the basis for tagged PDF. Structural elements are implemented
1091 : using marked content tags. Each structural element can contain sub elements
1092 : (e.g. a section can contain a heading and a paragraph). The structure hierarchy
1093 : is build automatically from the Begin/EndStructureElement calls.
1094 :
1095 : A structural element need not be contained on one page; e.g. paragraphs often
1096 : run from one page to the next. In this case the corresponding EndStructureElement
1097 : must be called while drawing the next page.
1098 : </p>
1099 :
1100 : <p>
1101 : BeginStructureElement and EndStructureElement must be called only after
1102 : <member scope="vcl">PDFWriter::NewPage</member> has been called and before
1103 : <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
1104 : number is an implicit context parameter for Begin/EndStructureElement.
1105 : </p>
1106 :
1107 : <p>
1108 : For pagination artifacts that are not part of the logical structure
1109 : of the document (like header, footer or page number) the special
1110 : StructElement <code>NonStructElement</code> exists. To place content
1111 : outside of the struture tree simply call
1112 : <code>BeginStructureElement( NonStructElement )</code> then draw your
1113 : content and then call <code>EndStructureElement()</code>. All children
1114 : of a <code>NonStructElement</code> will not be part of the structure.
1115 : Nonetheless if you add a child structural element to a
1116 : <code>NonStructElement</code> you will still have to call
1117 : <code>EndStructureElement</code> for it. Best think of the structure
1118 : tree as a stack.
1119 : </p>
1120 :
1121 : <p>
1122 : Note: there is always one structural element in existance without having
1123 : called <code>BeginStructureElement</code>; this is the root of the structure
1124 : tree (called StructTreeRoot). The StructTreeRoot has always the id 0.
1125 : </p>
1126 :
1127 : @param eType
1128 : denotes what kind of element to begin (e.g. a heading or paragraph)
1129 :
1130 : @param rAlias
1131 : the specified alias will be used as structure tag. Also an entry in the PDF's
1132 : role map will be created mapping alias to regular structure type.
1133 :
1134 : @returns
1135 : the new structure element's id for use in <code>SetCurrentStructureElement</code>
1136 : */
1137 : sal_Int32 BeginStructureElement( enum StructElement eType, const OUString& rAlias = OUString() );
1138 : /** end the current logical structure element
1139 :
1140 : <p>
1141 : Close the current structure element. The current element's
1142 : parent becomes the current structure element again.
1143 : </p>
1144 :
1145 : @see BeginStructureElement
1146 : */
1147 : void EndStructureElement();
1148 : /** set the current structure element
1149 :
1150 : <p>
1151 : For different purposes it may be useful to paint a structure element's
1152 : content discontinously. In that case an already existing structure element
1153 : can be appended to by using <code>SetCurrentStructureElement</code>. The
1154 : refenrenced structure element becomes the current structure element with
1155 : all consequences: all following structure elements are appended as children
1156 : of the current element.
1157 : </p>
1158 :
1159 : @param nElement
1160 : the id of the new current structure element
1161 :
1162 : @returns
1163 : <true/> if the current structure element could be set successfully
1164 : <false/> if the current structure element could not be changed
1165 : (e.g. if the passed element id is invalid)
1166 : */
1167 : bool SetCurrentStructureElement( sal_Int32 nElement );
1168 :
1169 : /** set a structure attribute on the current structural element
1170 :
1171 : SetStructureAttribute sets an attribute of the current structural element to a
1172 : new value. A consistency check is performed before actually setting the value;
1173 : if the check fails, the function returns <FALSE/> and the attribute remains
1174 : unchanged.
1175 :
1176 : @param eAttr
1177 : denotes what attribute to change
1178 :
1179 : @param eVal
1180 : the value to set the attribute to
1181 :
1182 : @returns
1183 : <TRUE/> if the value was valid and the change has been performed,
1184 : <FALSE/> if the attribute or value was invalid; attribute remains unchanged
1185 : */
1186 : bool SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
1187 : /** set a structure attribute on the current structural element
1188 :
1189 : SetStructureAttributeNumerical sets an attribute of the current structural element
1190 : to a new numerical value. A consistency check is performed before actually setting
1191 : the value; if the check fails, the function returns <FALSE/> and the attribute
1192 : remains unchanged.
1193 :
1194 : @param eAttr
1195 : denotes what attribute to change
1196 :
1197 : @param nValue
1198 : the value to set the attribute to
1199 :
1200 : @returns
1201 : <TRUE/> if the value was valid and the change has been performed,
1202 : <FALSE/> if the attribute or value was invalid; attribute remains unchanged
1203 : */
1204 : bool SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
1205 : /** set the bounding box of a structural element
1206 :
1207 : SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
1208 : attribute can only be applied to <code>Table</code>, <code>Figure</code>,
1209 : <code>Form</code> and <code>Formula</code> elements, a call of this function
1210 : for other element types will be ignored and the BBox attribute not be set.
1211 :
1212 : @param rRect
1213 : the new bounding box for the structural element
1214 : */
1215 : void SetStructureBoundingBox( const Rectangle& rRect );
1216 :
1217 : /** set the ActualText attribute of a structural element
1218 :
1219 : ActualText contains the Unicode text without layout artifacts that is shown by
1220 : a structural element. For example if a line is ended prematurely with a break in
1221 : a word and continued on the next line (e.g. "happen-<newline>stance") the
1222 : corresponding ActualText would contain the unbroken line (e.g. "happenstance").
1223 :
1224 : @param rText
1225 : contains the complete logical text the structural element displays.
1226 : */
1227 : void SetActualText( const String& rText );
1228 :
1229 : /** set the Alt attribute of a strutural element
1230 :
1231 : Alt is s replacement text describing the contents of a structural element. This
1232 : is mainly used by accessibility applications; e.g. a screen reader would read
1233 : the Alt replacement text for an image to a visually impaired user.
1234 :
1235 : @param rText
1236 : contains the replacement text for the structural element
1237 : */
1238 : void SetAlternateText( const String& rText );
1239 :
1240 : /** Sets the time in seconds a page will appear before the next
1241 : page is shown automatically
1242 :
1243 : @param nSeconds
1244 : time in seconds the current page will be shown; pass 0 for manual advancement
1245 :
1246 : @param nPageNr
1247 : the page number to apply the autoadvance time to; -1 denotes the current page
1248 : */
1249 : void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
1250 :
1251 : /** Sets the transitional effect to be applied when the current page gets shown.
1252 :
1253 : @param eType
1254 : the kind of effect to be used; use Regular to disable transitional effects
1255 : for this page
1256 :
1257 : @param nMilliSec
1258 : the duration of the transitional effect in milliseconds;
1259 : set 0 to disable transitional effects
1260 :
1261 : @param nPageNr
1262 : the page number to apply the effect to; -1 denotes the current page
1263 : */
1264 : void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
1265 :
1266 : /** create a new form control
1267 :
1268 : This function creates a new form control in the PDF and sets its various
1269 : properties. Do not pass an actual AnyWidget as <code>rControlType</code>
1270 : will be cast to the type described by the type member.
1271 :
1272 : @param rControlType
1273 : a descendant of <code>AnyWidget</code> determing the control's properties
1274 :
1275 : @returns
1276 : the new control's id for reference purposes
1277 : */
1278 : sal_Int32 CreateControl( const AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
1279 :
1280 : /** Inserts an additional stream to the PDF file
1281 :
1282 : This function adds an arbitrary stream to the produced PDF file. May be called
1283 : any time before <code>Emit()</code>. The stream will be written during
1284 : <code>Emit</code> by calling the <code>PDFOutputStream</code> Object's <code>write</code>
1285 : method. After the call the <code>PDFOutputStream</code> will be deleted.
1286 :
1287 : All additional streams and their mimetypes will be entered into an array
1288 : in the trailer dictionary.
1289 :
1290 : @param rMimeType
1291 : the mimetype of the stream
1292 :
1293 : @param rStream
1294 : the interface to the additional stream
1295 :
1296 : @param bCompress
1297 : specifies whether the stream should be flate encoded by PDFWriter or not
1298 : */
1299 : void AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress );
1300 :
1301 : };
1302 :
1303 : }
1304 :
1305 : #endif // _VCL_PDFWRITER_HXX
1306 :
1307 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|