CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
RxPdfToRasterServices.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24// RxPdfToRasterServices.h - interface of module, performing pdf to raster conversion
25
26#ifndef __OD_PDF_TO_RASTER_MODULE__
27#define __OD_PDF_TO_RASTER_MODULE__
28
29#include "RxModule.h"
30#include "OdBinaryData.h"
31#include "StringArray.h"
32#include "Ge/GePoint2d.h"
33#include "Gs/GsDefs.h"
34
35class OdGiRasterImage;
36
41
49{
50 kAnnotations = 1, // Set if annotations are to be rendered.
51 kLCDText = 2, // Set if using text rendering optimized for LCD display.
52 kNoNativeText = 4, // Don't use the native text output available on some platforms.
53 kGrayScale = 8, // Grayscale output.
54 kReverseByteOrder = 16, // Set whether to render in a reverse Byte order.
55 kDebugInfo = 128, // Set if you want to get some debug info.
56 kNoCatch = 256, // Set if you don't want to catch exceptions.
57 kLimitImageCache = 512, // Limit image cache size.
58 kForceHalfTone = 1024, // Always use halftone for image stretching.
59 kPrinting = 2048, // Render for printing.
60 kDisableAAforText = 4096, // Set to disable anti-aliasing on text.
61 kDisableAAforImage = 8192, // Set to disable anti-aliasing on images.
62 kDisableAAforGeom = 16384, // Set to disable anti-aliasing on geometry (pdf paths).
63};
64
69typedef struct {
70 OdString layer_name; //Name of the layer
71 bool is_on; //Flag if the layer is enabled
72} pdf_layer;
73
79
87public:
88
95 bg_color(0xFFFFFFFF) //white background
96 , dpi(72) //default pdf resolution
97 , flags(0) //empty set
98 {
100 };
101
102 OdUInt32 bg_color; //Background color
103 OdUInt16 dpi; //Required resolution
104 int flags; //Set of the PdfConversionFlags
105 OdPdfLayerArray layers; //Layers to be enabled or disabled in resulting image
106 OdGsDCRect cropArea; //Coordinates of the area to be cropped from the whole page
107};
108
109#include "TD_PackPush.h"
110
118{
119public:
120//DOM-IGNORE-BEGIN
122//DOM-IGNORE-END
123
131 virtual OdResult loadPdf(const OdString &filename, const OdString &password = "") = 0;
132
140 virtual OdResult loadPdf(OdStreamBufPtr &pBuf, const OdString &password = "") = 0;
141
147 virtual bool isLoaded() = 0;
148
154 virtual OdString getFilename() = 0;
155
161 virtual OdUInt16 getPagesCount() = 0;
162
172 virtual OdResult setActivePage(OdUInt16 pageNum = 1) = 0;
173
179 virtual OdUInt16 getActivePage() = 0;
180
192 virtual OdResult getLayers(OdPdfLayerArray& layers) = 0;
193
204 virtual OdResult getPageSize(OdGsDCRect& rect) = 0;
205
214};
215
220
227{
228public:
229//DOM-IGNORE-BEGIN
231//DOM-IGNORE-END
232
239};
240
245
246#include "TD_PackPop.h"
247
248#endif // __OD_PDF_TO_RASTER_MODULE__
unsigned int OdUInt32
unsigned short OdUInt16
#define ODRX_ABSTRACT
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
PdfConversionFlags
@ kGrayScale
@ kAnnotations
@ kNoNativeText
@ kForceHalfTone
@ kDebugInfo
@ kLimitImageCache
@ kReverseByteOrder
@ kDisableAAforImage
@ kDisableAAforText
@ kDisableAAforGeom
OdArray< pdf_layer > OdPdfLayerArray
OdSmartPtr< OdRxPdfToRasterServices > OdRxPdfToRasterServicesPtr
OdSmartPtr< OdPdf2ImageConverter > OdPdf2ImageConverterPtr
void set_null()
Definition: GsDefs.h:265
virtual OdResult setActivePage(OdUInt16 pageNum=1)=0
virtual OdString getFilename()=0
virtual bool isLoaded()=0
virtual OdResult loadPdf(const OdString &filename, const OdString &password="")=0
virtual OdResult getLayers(OdPdfLayerArray &layers)=0
virtual OdResult loadPdf(OdStreamBufPtr &pBuf, const OdString &password="")=0
virtual OdUInt16 getPagesCount()=0
ODRX_DECLARE_MEMBERS(OdPdf2ImageConverter)
virtual OdGiRasterImagePtr convertPdf(const OdPdf2ImageConversionParams *params=0)=0
virtual OdResult getPageSize(OdGsDCRect &rect)=0
virtual OdUInt16 getActivePage()=0
ODRX_DECLARE_MEMBERS(OdRxPdfToRasterServices)
virtual OdPdf2ImageConverterPtr createConverter()=0
GLenum GLint * params
Definition: gles2_ext.h:184