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-2026 by Apryse Software 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 
49  static void StartPrintJob(
50  PDFDoc & in_pdfdoc,
51  const UString & in_printerName,
52  const UString & in_jobName,
53  const UString & in_outputFileName,
54  PageSet * in_pagesToPrint = NULL,
55  PrinterMode * in_printerMode = NULL,
56  volatile bool * in_cancel = NULL,
57  OCG::Context * in_context = NULL);
58 
82  static void StartPrintJob(
83  PDFDoc & in_pdfdoc,
84  const char * in_printerName,
85  const char * in_jobName,
86  const char * in_outputFileName,
87  PageSet * in_pagesToPrint = NULL,
88  PrinterMode * in_printerMode = NULL,
89  volatile bool * in_cancel = NULL,
90  OCG::Context * in_context = NULL);
91 
119  static void StartPrintJob(
120  PDFDoc& in_pdfdoc,
121  const UString& in_printerName,
122  const UString& in_jobName,
123  const UString& in_outputFileName,
124  const std::vector<UChar>& in_devmode_data,
125  PageSet* in_pagesToPrint = NULL,
126  PrinterMode* in_printerMode = NULL,
127  volatile bool* in_cancel = NULL,
128  OCG::Context* in_context = NULL);
129 
158  static void StartPrintJob(
159  PDFDoc& in_pdfdoc,
160  const char* in_printerName,
161  const char* in_jobName,
162  const char* in_outputFileName,
163  const std::vector<UChar>& in_devmode_data,
164  PageSet* in_pagesToPrint = NULL,
165  PrinterMode* in_printerMode = NULL,
166  volatile bool* in_cancel = NULL,
167  OCG::Context* in_context = NULL);
168 };
169 
170 
171 
177 {
178 public:
182  enum PaperSize {
184  e_custom = 0,
303  };
304 
306  enum DuplexMode {
312  };
313 
322  };
323 
325  enum OutputColor {
330  };
331 
334  {
338  };
339 
341  enum ScaleType {
348  };
349 
352  enum NUp {
355  e_NUp_1_1 = 0,
356  e_NUp_2_1 = 1,
357  e_NUp_2_2 = 2,
358  e_NUp_3_2 = 3,
359  e_NUp_3_3 = 4,
360  e_NUp_4_4 = 5,
361  };
362 
371  };
372 
378  };
379 
380 
381  PrinterMode();
382  ~PrinterMode();
383 
390  void SetAutoCenter(bool autoCenter);
391 
398  void SetAutoRotate(bool autoRotate);
399 
407  void SetCollation( bool collation );
408 
415  void SetCopyCount( int copyCount );
416 
424  void SetDPI( int dpi );
425 
432  void SetDuplexing( DuplexMode mode );
433 
445 
458  void SetNUp(unsigned int x, unsigned int y, NUpPageOrder pageOrder = e_PageOrder_LeftToRightThenTopToBottom);
459 
466  void SetOrientation(Orientation orientation);
467 
475  void SetOutputAnnot(PrintContentTypes printContent);
476 
487  void SetOutputColor( OutputColor color );
488 
496  void SetOutputQuality( OutputQuality quality );
497 
505  void SetOutputPageBorder(bool printBorder);
506 
513  void SetPaperSize(const Rect & size = Rect(0, 0, 612, 791) );
514 
520 
529  void SetScale(double scale);
530 
537  void SetScaleType(ScaleType scaleType);
538 
546  void SetUseRleImageCompression( bool useRleImageCompression );
547 
548 
549  // @cond PRIVATE_DOC
550 
551  #ifndef SWIGHIDDEN
552  SDF::Obj m_printerMode;
553  #endif
554  // @endcond PRIVATE_DOC
555 
556 private:
557  SDF::ObjSet m_printerModeSet;
558 };
559 
560  }; // namespace PDF
561 }; // namespace pdftron
562 
563 #include <Impl/Print.inl>
564 
565 #endif // PDFTRON_H_CPPPDFPrint
void SetNUp(NUp nup, NUpPageOrder pageOrder=e_PageOrder_LeftToRightThenTopToBottom)
void SetOrientation(Orientation orientation)
use the current printer setting
Definition: Print.h:307
1 document page to 1 output page
Definition: Print.h:355
void SetOutputColor(OutputColor color)
void SetCollation(bool collation)
2 by 2 document pages to 1 output page
Definition: Print.h:357
void SetOutputAnnot(PrintContentTypes printContent)
void SetAutoRotate(bool autoRotate)
void SetPaperSize(const Rect &size=Rect(0, 0, 612, 791))
single-sided printing
Definition: Print.h:309
Orientation
Enumerated values for specifying the orientation of output pages.
Definition: Print.h:333
DuplexMode
Enumerated values for specifying how the printed pages are flipped when duplexing.
Definition: Print.h:306
ScaleType
Enumerated values for specifying the scaling of document pages.
Definition: Print.h:341
use the current printer setting
Definition: Print.h:335
void SetScale(double scale)
void SetDuplexing(DuplexMode mode)
use the current printer setting
Definition: Print.h:308
printer medium quality mode
Definition: Print.h:320
use the current printer setting
Definition: Print.h:366
void SetOutputPageBorder(bool printBorder)
void SetUseRleImageCompression(bool useRleImageCompression)
void SetScaleType(ScaleType scaleType)
3 by 3 document pages to 1 output page
Definition: Print.h:359
3 by 2 document pages to 1 output page
Definition: Print.h:358
flip the paper along the short side
Definition: Print.h:311
custom layout (use x and y)
Definition: Print.h:354
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:374
use the current printer setting
Definition: Print.h:353
OutputQuality
Enumerated values for specifying the quality of the printing.
Definition: Print.h:315
2 document pages to 1 output page
Definition: Print.h:356
use Dots Per Inch (DPI) to specify quality
Definition: Print.h:317
OutputColor
Enumerated values for specifying the color mode for printing.
Definition: Print.h:325
flip the paper along the long side
Definition: Print.h:310
use the current printer setting
Definition: Print.h:326
4 by 4 document pages to 1 output page
Definition: Print.h:360
use the current printer setting
Definition: Print.h:342