CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
RxPdfToRasterServices.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
73} pdf_layer;
74
80
88public:
89
96 bg_color(0xFFFFFFFF) //white background
97 , dpi(72) //default pdf resolution
98 , flags(0) //empty set
99 {
100 cropArea.set_null();
101 };
102
103 OdUInt32 bg_color; //Background color
104 OdUInt16 dpi; //Required resolution
105 int flags; //Set of the PdfConversionFlags
106 OdPdfLayerArray layers; //Layers to be enabled or disabled in resulting image
107 OdGsDCRect cropArea; //Coordinates of the area to be cropped from the whole page
108};
109
110#include "TD_PackPush.h"
111
119{
120public:
121//DOM-IGNORE-BEGIN
123//DOM-IGNORE-END
124
132 virtual OdResult loadPdf(const OdString &filename, const OdString &password = "") = 0;
133
141 virtual OdResult loadPdf(OdStreamBufPtr &pBuf, const OdString &password = "") = 0;
142
148 virtual bool isLoaded() = 0;
149
155 virtual OdString getFilename() = 0;
156
162 virtual OdUInt16 getPagesCount() = 0;
163
173 virtual OdResult setActivePage(OdUInt16 pageNum = 1) = 0;
174
180 virtual OdUInt16 getActivePage() = 0;
181
193 virtual OdResult getLayers(OdPdfLayerArray& layers) = 0;
194
205 virtual OdResult getPageSize(OdGsDCRect& rect) = 0;
206
215};
216
221
228{
229public:
230//DOM-IGNORE-BEGIN
232//DOM-IGNORE-END
233
240};
241
246
247#include "TD_PackPop.h"
248
249#endif // __OD_PDF_TO_RASTER_MODULE__
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
Definition DbLayout.h:36
OdSmartPtr< OdStreamBuf > OdStreamBufPtr
unsigned int OdUInt32
unsigned short OdUInt16
#define ODRX_ABSTRACT
OdResult
Definition OdResult.h:29
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
@ kNoNativeText
@ kForceHalfTone
@ kLimitImageCache
@ kReverseByteOrder
@ kDisableAAforImage
@ kDisableAAforText
@ kDisableAAforGeom
OdArray< pdf_layer > OdPdfLayerArray
OdSmartPtr< OdRxPdfToRasterServices > OdRxPdfToRasterServicesPtr
OdSmartPtr< OdPdf2ImageConverter > OdPdf2ImageConverterPtr
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