All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Print.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFPrint
6 #define PDFTRON_H_CPPPDFPrint
7 
8 #include <PDF/PDFDoc.h>
9 #include <C/PDF/TRN_Print.h>
10 #include <SDF/Obj.h>
11 #include <SDF/ObjSet.h>
12 #include <PDF/PageSet.h>
13 
14 namespace pdftron{
15  namespace PDF {
16 
21 class PrinterMode; // forward declaration
22 
23 class Print {
24 public:
25 
26 
48  static void StartPrintJob(
49  PDFDoc & in_pdfdoc,
50  const UString & in_printerName,
51  const UString & in_jobName,
52  const UString & in_outputFileName,
53  PageSet * in_pagesToPrint = NULL,
54  PrinterMode * in_printerMode = NULL,
55  volatile bool * in_cancel = NULL,
56  OCG::Context * in_context = NULL);
57 
81  static void StartPrintJob(
82  PDFDoc & in_pdfdoc,
83  const char * in_printerName,
84  const char * in_jobName,
85  const char * in_outputFileName,
86  PageSet * in_pagesToPrint = NULL,
87  PrinterMode * in_printerMode = NULL,
88  volatile bool * in_cancel = NULL,
89  OCG::Context * in_context = NULL);
90 
91 
92 };
93 
94 
95 
101 {
102 public:
106  enum PaperSize {
107  e_custom = 0,
226  };
227 
229  enum DuplexMode {
234  };
235 
242  };
243 
245  enum OutputColor {
249  };
250 
253  {
256  };
257 
259  enum ScaleType {
263  };
264 
267  enum NUp {
268  e_NUp_1_1 = 0,
269  e_NUp_2_1 = 1,
270  e_NUp_2_2 = 2,
271  e_NUp_3_2 = 3,
272  e_NUp_3_3 = 4,
273  e_NUp_4_4 = 5,
274  };
275 
283  };
284 
290  };
291 
292 
293  PrinterMode();
294  ~PrinterMode();
295 
302  void SetAutoCenter(bool autoCenter);
303 
310  void SetAutoRotate(bool autoRotate);
311 
319  void SetCollation( bool collation );
320 
327  void SetCopyCount( int copyCount );
328 
336  void SetDPI( int dpi );
337 
344  void SetDuplexing( DuplexMode mode );
345 
357 
370  void SetNUp(unsigned int x, unsigned int y, NUpPageOrder pageOrder = e_PageOrder_LeftToRightThenTopToBottom);
371 
378  void SetOrientation(Orientation orientation);
379 
387  void SetOutputAnnot(PrintContentTypes printContent);
388 
399  void SetOutputColor( OutputColor color );
400 
408  void SetOutputQuality( OutputQuality quality );
409 
417  void SetOutputPageBorder(bool printBorder);
418 
425  void SetPaperSize(const Rect & size = Rect(0, 0, 612, 791) );
426 
432 
441  void SetScale(double scale);
442 
449  void SetScaleType(ScaleType scaleType);
450 
458  void SetUseRleImageCompression( bool useRleImageCompression );
459 
460 
461  // @cond PRIVATE_DOC
462 
463  #ifndef SWIGHIDDEN
464  SDF::Obj m_printerMode;
465  #endif
466  // @endcond PRIVATE_DOC
467 
468 private:
469  SDF::ObjSet m_printerModeSet;
470 };
471 
472  }; // namespace PDF
473 }; // namespace pdftron
474 
475 #include <Impl/Print.inl>
476 
477 #endif // PDFTRON_H_CPPPDFPrint
void SetNUp(NUp nup, NUpPageOrder pageOrder=e_PageOrder_LeftToRightThenTopToBottom)
void SetOrientation(Orientation orientation)
1 document page to 1 output page
Definition: Print.h:268
void SetOutputColor(OutputColor color)
void SetCollation(bool collation)
2 by 2 document pages to 1 output page
Definition: Print.h:270
void SetOutputAnnot(PrintContentTypes printContent)
void SetAutoRotate(bool autoRotate)
void SetPaperSize(const Rect &size=Rect(0, 0, 612, 791))
single-sided printing
Definition: Print.h:231
Orientation
Enumerated values for specifying the orientation of output pages.
Definition: Print.h:252
DuplexMode
Enumerated values for specifying how the printed pages are flipped when duplexing.
Definition: Print.h:229
ScaleType
Enumerated values for specifying the scaling of document pages.
Definition: Print.h:259
void SetScale(double scale)
void SetDuplexing(DuplexMode mode)
use the current printer setting
Definition: Print.h:230
printer medium quality mode
Definition: Print.h:240
void SetOutputPageBorder(bool printBorder)
void SetUseRleImageCompression(bool useRleImageCompression)
void SetScaleType(ScaleType scaleType)
3 by 3 document pages to 1 output page
Definition: Print.h:272
3 by 2 document pages to 1 output page
Definition: Print.h:271
flip the paper along the short side
Definition: Print.h:233
void SetOutputQuality(OutputQuality quality)
void SetAutoCenter(bool autoCenter)
void SetCopyCount(int copyCount)
static void StartPrintJob(PDFDoc &in_pdfdoc, const UString &in_printerName, const UString &in_jobName, const UString &in_outputFileName, PageSet *in_pagesToPrint=NULL, PrinterMode *in_printerMode=NULL, volatile bool *in_cancel=NULL, OCG::Context *in_context=NULL)
PrintContentTypes
Enumerated values for specifying the document content to print.
Definition: Print.h:286
OutputQuality
Enumerated values for specifying the quality of the printing.
Definition: Print.h:237
2 document pages to 1 output page
Definition: Print.h:269
OutputColor
Enumerated values for specifying the color mode for printing.
Definition: Print.h:245
flip the paper along the long side
Definition: Print.h:232
4 by 4 document pages to 1 output page
Definition: Print.h:273