RasterMaster SDK Imaging SDK for.net V19.4 Programmer s Reference Guide

RasterMaster® SDK Imaging SDK for .NET V19.4 Programmer’s Reference Guide Note: An online version of this manual contains information on the latest u...
Author: Marcus Atkins
19 downloads 4 Views 4MB Size
RasterMaster® SDK Imaging SDK for .NET V19.4 Programmer’s Reference Guide

Note: An online version of this manual contains information on the latest updates to RasterMaster. To find the most recent version of this manual, please visit the online version at www.rastermaster.com or download the most recent version from our website at www.snowbound.com/support/manuals.html.

DOC-0150-09

Copyright Information While Snowbound® Software believes the information included in this publication is correct as of the publication date, information in this document is subject to change without notice. UNLESS EXPRESSLY SET FORTH IN A WRITTEN AGREEMENT SIGNED BY AN AUTHORIZED REPRESENTATIVE OF SNOWBOUND SOFTWARE CORPORATION MAKES NO WARRANTY OR REPRESENTATION OF ANY KIND WITH RESPECT TO THE INFORMATION CONTAINED HEREIN, INCLUDING WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PURPOSE. Snowbound Software Corporation assumes no responsibility or obligation of any kind for any errors contained herein or in connection with the furnishing, performance, or use of this document. Software described in Snowbound documents (a) is the property of Snowbound Software Corporation or the third party, (b) isfurnished only under license, and (c) may be copied or used only as expressly permitted under the terms of the license. All contents of this manual are copyrighted by Snowbound Software Corporation. The information contained herein is the exclusive property of Snowbound Software Corporation and shall not be copied, transferred, photocopied, translated on paper, film, electronic media, or computer-readable form, or otherwise reproduced in any way, without the express written permission of Snowbound Software Corporation. Microsoft, MS, MS-DOS, Windows, Windows NT, and SQL Server are either trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Adobe, the Adobe logo, Acrobat, and the Acrobat logo are trademarks of Adobe Systems Incorporated. Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. iText, the Initial Developers of the Original Code are Bruno Lowagie and Paolo Soares. Portions created by Bruno Lowagie are Copyright (C) 1999-2009 by Bruno Lowagie. Kakadu JPEG2000© , is copyrighted by Dr. David Taubman, and is proprietary to NewSouth Innovations, Pty. Ltd, Australia. Aspose™, Aspose.Cells© (copyrighted 2003), Aspose.Words© (copyrighted 2003), and Aspose.Slides© (copyrighted 2004), are all proprietary to Aspose Software, Pty. Ltd, Australia. United States Government Restricted Rights The Software is provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause of DFARS 252.227 –19 or subparagraphs (c)(i) and (2) of the Commercial Computer SoftwareRestricted Rights at 48 CFR 52.227 – 19 as applicable. The Manufacturer is Snowbound Software Corporation, 309 Waverley Oaks Rd., Suite 401, Waltham, MA 02452, USA. All other trademarks and registered trademarks are the property of their respective holders. Manual Title: Snowbound RasterMaster® Imaging SDK for the .NET Platform Programmer’s Reference Guide Part Number: DOC-0150-09 Revision: 9 RasterMaster .NET Release Number: 19.4 RasterMaster® SDK Release Number: 19.4 Printing Date: June 2016 Published by Snowbound Software Corporation. 309 Waverley Oaks Road Suite 401 Waltham, MA 02452 USA phone: 617-607-2000 fax: 617-607-2002 ©1996 - 2016 by Snowbound Software Corporation. All rights reserved.

Table of Contents Chapter 1 - Saving and Reading Multi-page Images Multi-page Images

38 38

Supported Multi-page Formats

38

Decompressing a Multi-page Image

38

Determining Multi-page Page Count

38

Saving Multi-page File Formats

38

Multi-page Format Functions

39

Chapter 2 - Printing Images

40

Printing Overview

40

Printing Functions

40

Normal Printing

40

Fast Printing

40

CIMG_print_bitmap()

41

CIMG_print_bitmap_fast()

41

Printing Large Documents

42

Servers

42

Clients

43

Solution

43

Chapter 3 - Aspect Ratio Correction Function Aspect Ratio Correction Function Chapter 4 - Display Quality Achieving the Best Display Quality

44 44 45 45

3

24-Bit Images Displayed on a 256 Color Adapter

45

Bi-Level and 1-Bit Per Pixel Images

45

Chapter 5 - Image Compression Preferred Formats

46

24-Bit Color Images

46

8-Bit Gray Scale Images

46

1-bit Bi-Level Images

46

Chapter 6 - File Format Conversion Converting File Formats

47 47

Automatically Detecting File Formats

47

Input Document Quality: Resolution/DPI

48

Input Document Quality: Color/bit-depth/Pixel Depth

48

Making Sure Input is Compatible with Output

48

Getting a Pixel_Depth_Unsupported Error

48

Adjusting Low Output Quality

48

Chapter 7 - Class Snow.Snowbnd Methods

50

Snowbnd()

50

Snowbnd(int, int, int)

51

Chapter 8 - SDK Class Specific Methods

53

isValidImage()

53

clearImage()

53

ToErrorMessage()

54

Chapter 9 - SnowPanel Class Specific Methods Properties

4

46

55 55

CustomPaint()

55

OnPaint()

56

OnPaintBackground()

56

OnSizeChanged()

56

Chapter 10 - Scanning Functions

58

Scanning Constants

58

CIMG_scan_acquire()

58

CIMG_scan_acquire_feeder()

59

CIMG_scan_acquire_feeder_fast()

60

CIMG_scan_feeder_close()

60

CIMG_scan_get_cap()

61

CIMG_scan_open_source()

61

CIMG_scan_pages()

62

CIMG_scan_pages_fast()

63

CIMG_scan_set_cap()

64

CIMG_scan_set_caps()

64

CIMG_scan_setup()

65

Chapter 11 - Scrollbar Default Functions

66

Properties

66

SnowbndCNet_HScrollBar()

66

SnowbndCNet_VScrollBar()

66

Chapter 12 - Image Decompression Functions

68

CIMG_decompress_bitmap()

68

CIMG_decompress_bitmap_display()

70

5

CIMG_decompress_bitmap_fd()

71

CIMG_decompress_bitmap_FlexSnap()

71

CIMG_decompress_bitmap_mem()

72

CIMG_decompress_bitmap_page()

73

CIMG_decompress_bitmap_url()

74

CIMG_decompress_bitmap_xps()

74

CIMG_decompress_fax()

75

CIMG_decompress_fax_mem()

76

CIMG_decompress_tiled_bitmap()

76

Chapter 13 - Image Decompression Option Functions CIMGLOW_set_auto_detect()

78

CIMGLOW_set_decomp_rect()

78

CIMGLOW_set_decomp_reduction()

79

CIMGLOW_set_decompsize()

80

CIMGLOW_set_jpeg_decompression

80

CIMGLOW_set_overlay_path()

81

CIMGLOW_set_pdf_input()

81

CIMGLOW_set_pdf_password()

82

CIMGLOW_unset_auto_detect()

83

Chapter 14 - Image Creation Functions

6

78

84

CIMG_create_bitmap_class()

84

CIMG_create_handle()

84

CIMG_create_handle_ddb()

85

CIMG_create_handle_keep()

85

Chapter 15 - HTML Functions

87

CIMGLOW_set_html_input()

87

CIMGLOW_set_html_page_size()

87

Functions Available in RasterMaster .NET V18.1 and Earlier

88

CIMGLOW_set_html_capabilities()

88

CIMGLOW_set_html_home_dir()

89

CIMGLOW_set_html_image_capability()

90

CIMGLOW_set_html_javascript_capability()

90

CIMGLOW_set_html_page_size_ratio()

91

CIMGLOW_set_html_page_size_ratio_capability()

91

CIMGLOW_set_html_screen_dpi()

92

CIMGLOW_set_html_use_page_breaks_exclusively()

92

CIMGLOW_set_html_utf_bom()

93

Chapter 16 - Open Office 2007 XML (OOXML) Functions

96

CIMGLOW_set_ooxml_license()

96

CIMGLOW_ooxml_license_enable()

96

Chapter 17 - Image Saving Functions

98

CIMG_save_bitmap()

98

CIMG_save_bitmap_fd()

99

CIMG_save_bitmap_mem()

100

CIMGLOW_write_tiff_stream()

101

Chapter 18 - Image Saving Option Functions

102

CIMG_set_encrypt()

102

CIMGLOW_set_comp_quality()

102

7

CIMGLOW_set_image_orientation()

103

CIMGLOW_set_jpeg2000_comp_ratio()

104

CIMGLOW_set_jpg_interleave()

104

CIMGLOW_set_pdf_output()

105

CIMGLOW_set_tiff_save_strips

105

CIMGLOW_set_tiff_tag()

106

Chapter 19 - Image Display Functions bool repaintBackground()

108

CIMG_display_bitmap()

108

CIMG_display_bitmap_aspect()

110

CIMG_display_bitmap_transp()

111

CIMG_display_ddb()

111

CIMG_display_fit_to_height()

112

CIMG_display_fit_to_width()

113

CIMG_set_croprect()

113

CIMG_set_croprect_scroll()

114

CIMG_zoom_bitmap()

115

CIMG_zoom_bitmap_1_to_1()

115

CIMG_zoom_bitmap_rect()

116

CIMGLOW_map_image_to_wnd()

116

CIMGLOW_map_wnd_to_image()

117

double calcAspectZoom()

117

removeScrollbars()

118

Chapter 20 - Image Display Option Functions

8

108

120

CIMG_animate()

120

CIMG_bitmap_palette()

120

CIMG_display_ddb_effect()

121

CIMG_set_gamma()

122

CIMG_set_lut()

123

CIMG_window_level()

123

CIMGLOW_autocolor()

124

CIMGLOW_set_alias()

125

CIMGLOW_set_alias_quality()

125

CIMGLOW_set_dithermode()

126

CIMGLOW_set_imnet_page_size()

127

CIMGLOW_set_rop()

127

CIMGLOW_set_transp_color()

129

CIMGLOW_set_wipedelay()

129

Chapter 21 - Information Query Functions

131

CIMG_bitmap_info()

131

CIMG_get_bitmap_palette()

132

CIMG_get_croprect()

133

CIMG_get_display_rect()

133

CIMG_get_version(int, int, int, int)

134

CIMG_get_version(String)

134

CIMG_ifl_version()

135

CIMGLOW_delete_page()

136

CIMGLOW_delete_page_mem()

136

9

10

CIMGLOW_get_anim_delay()

137

CIMGLOW_get_auto_detect()

137

CIMGLOW_get_bitmap_header()

138

CIMGLOW_get_bitmap_name()

138

CIMGLOW_get_custstring()

139

CIMGLOW_get_fileinfo()

139

CIMGLOW_get_fileinfo_fd()

140

CIMGLOW_get_fileinfo_page()

141

CIMGLOW_get_fileinfo_fd()

141

CIMGLOW_get_filetype()

142

CIMGLOW_get_filetype_fd()

142

CIMGLOW_get_filetype_mem()

143

CIMGLOW_get_filetype_url()

143

CIMGLOW_get_image_orientation_page()

144

CIMGLOW_get_pages()

144

CIMGLOW_get_pages_fd()

145

CIMGLOW_get_pages_mem()

146

CIMGLOW_get_pages_url()

146

CIMGLOW_get_tiff_tag()

147

CIMGLOW_get_tiff_tag_page()

148

CIMGLOW_get_tiff_tag_page_fd()

149

CIMGLOW_get_tiff_tag_page_mem()

149

CIMGLOW_get_tile_info()

150

CIMGLOW_get_transp_color()

151

CIMGLOW_is_tiled_image()

151

CIMGLOW_read_pixel()

152

CIMGLOW_redact_text()

152

CIMGLOW_redact_rects()

153

CIMGLOW_rotate_page_mem()

153

CIMGLOW_set_bitmap_header()

154

CIMGLOW_set_document()

155

CIMGLOW_set_document_input(int, int)

155

CIMGLOW_set_document_input(int, int, int)

157

CIMGLOW_set_document_page_size(int, int, int)

158

Chapter 22 - Text Search Functions

159

CIMG_save_document()

159

CIMG_save_mem()

161

CIMG_save_mem_page()

161

CIMGLOW_append_page()

162

CIMGLOW_extract_text()

162

CIMGLOW_extract_text_mem_pointer()

164

CIMGLOW_extract_page()

165

CIMGLOW_extract_page_mem()

165

CIMGLOW_search_text()

166

CIMGLOW_set_document_input()

167

Chapter 23 - AFP Font Mapping Functions

168

AFP Font Mapping

168

Format of Font Mapping Data

168

11

Color Documents Rendered as Black and White

169

CIMGLOW_set_fontmap_path()

169

CIMGLOW_set_fontmap()

170

CIMGLOW_set_pdf_flags()

171

CIMGLOW_set_pdf_fontpath()

171

CIMGLOW_set_pdfa_fontpath()

172

CIMGLOW_set_pdfa_fontmap()

172

Chapter 24 - Housekeeping Functions

12

174

CIMG_delete_bitmap()

174

CIMG_delete_bitmap_keep()

175

CIMG_unload_plugins()

175

CIMGLOW_set_bitmap_name()

175

CIMGLOW_set_tiff_indexing()

176

Chapter 25 - DocClean Functions

177

CIMG_auto_orient()

177

CIMG_deskew_bitmap()

177

CIMG_despeckle_bitmap()

178

CIMGLOW_auto_invert()

179

CIMGLOW_detect_blank_page()

180

CIMGLOW_image_dilation()

181

CIMGLOW_image_erosion()

182

CIMGLOW_remove_halftone()

182

CIMGLOW_remove_lines()

183

CIMGLOW_remove_holepunch()

183

Chapter 26 - Image Processing Functions

186

CIMG_antique_effect()

186

CIMG_apply_profile()

186

CIMG_auto_orient()

187

CIMG_autocrop_bitmap()

187

CIMG_create_thumbnail()

188

CIMG_deskew_bitmap()

189

CIMG_despeckle_bitmap()

189

CIMG_dib_to_ddb()

190

CIMG_dib_to_runs()

191

CIMG_erase_rect()

191

CIMG_flip_bitmapx()

191

CIMG_flip_bitmapy()

192

CIMG_get_deskew_angle()

192

CIMG_get_profile()

193

CIMG_histogram_equalize()

193

CIMG_invert_bitmap()

194

CIMG_merge_annotation()

194

CIMG_merge_bitmap()

195

CIMG_merge_bitmap()

196

CIMG_merge_bitmap_alpha()

198

CIMG_process_bitmap()

199

CIMG_remove_red_eye()

200

CIMG_resize_bitmap()

201

13

CIMG_resize_bitmap_bicubic()

202

CIMG_resize_bitmap_interp()

202

CIMG_rotate_bitmap()

203

CIMG_runs_to_dib()

204

CIMG_set_display_angle()

204

CIMG_sharpen_bitmap()

205

CIMGLOW_get_palette()

205

CIMGLOW_get_raster()

206

CIMGLOW_put_palette()

206

CIMGLOW_put_raster()

207

CIMGLOW_set_fast_convert()

207

Chapter 27 - Document Conversion and Text Extraction Functions Document Conversion and Text Extraction

209

CIMGLOW_extract_text()

209

CIMGLOW_extract_text_mem()

211

CIMG_save_document()

212

CIMG_save_document_mem()

214

Chapter 28 - Color Promotion Functions

14

209

216

CIMG_promote_8()

216

CIMG_promote_24()

217

CIMG_promote_32()

217

Changing Color Spaces Functions

217

CIMG_rgb_to_cmyk()

217

CIMG_cmyk_to_rgb()

218

CIMG_color_combine()

218

CIMG_color_separate()

219

CIMGLOW_get_tiff_tag()

220

Chapter 29 - Color Reduction Functions

222

CIMG_color_gray()

222

CIMG_resize_to_gray()

222

CIMG_popularity_color()

223

CIMG_mediancut_color()

224

CIMG_octree_color()

224

CIMG_bayer_color()

225

CIMG_bayer_mono()

225

CIMG_diffusion_mono()

226

CIMG_thresh_mono()

226

CIMG_halftone_mono()

227

CIMGLOW_detect_color()

228

Chapter 30 - ASCII Formats and Functions

230

ASCII Attribute Structure

230

CIMG_import_ascii()

234

CIMGLOW_get_ascii_attributes()

234

CIMGLOW_get_ascii_page_width()

235

CIMGLOW_set_ascii_attributes()

235

Chapter 31 - Format For Decompressed Images

237

Overview of Data Formats

237

RasterMaster Plus Options

237

15

MS_Windows DIB Header Format

238

MS_Windows DIB Palette Format

238

MS_Windows DIB Image Data Format

239

Chapter 32 - Annotation and Redlining Toolkit

16

240

public class CANN_GRAPHIC_STRUCT Structure

240

CSANN_activate_all_objects()

241

CSANN_activate_object()

242

CSANN_add_object()

242

CSANN_choose_color()

243

CSANN_choose_font()

243

CSANN_choose_line_style()

244

CSANN_choose_line_width()

244

CSANN_create_ann()

245

CSANN_deactivate_all_objects()

245

CSANN_deactivate_object()

246

CSANN_delete_all_objects()

246

CSANN_delete_non_text_objects()

246

CSANN_delete_object()

247

CSANN_delete_text_objects()

247

CSANN_display_annotations()

247

CSANN_draw_object()

248

CSANN_FlipX()

249

CSANN_FlipY()

249

CSANN_get_croprect()

249

CSANN_get_disprect()

249

CSANN_get_object_bounds()

250

CSANN_get_object_data()

250

CSANN_get_object_info()

251

CSANN_get_object_num()

251

CSANN_highlight_object()

252

CSANN_map_image_to_wnd()

252

CSANN_map_wnd_to_image()

253

CSANN_mouse()

253

CSANN_move_object()

254

CSANN_print_annotations()

254

CSANN_read_ann()

255

CSANN_read_ann_FlexSnap()

255

CSANN_read_ann_mem()

256

CSANN_read_ann_mem_page()

256

CSANN_read_ann_page()

257

CSANN_resize_object()

257

CSANN_rotate()

257

CSANN_set_bcolor()

258

CSANN_set_croprect()

258

CSANN_set_disprect()

259

CSANN_set_fcolor()

259

CSANN_set_font()

260

CSANN_set_line_style()

260

17

CSANN_set_line_width()

261

CSANN_set_size()

261

CSANN_write_ann()

262

CSANN_write_ann_FlexSnap()

263

CSANN_write_ann_mem()

263

CSANN_write_ann_mem_page()

263

CSANN_write_ann_page()

264

Annotation Constants

264

Chapter 33 - WPF and Microsoft .NET Framework 4.0 Support Functions Working with .NET Bitmapsource for the WPF Image Control

267

CIMG_create_bitmapsource_class()

267

CIMG_create_bitmapsource_class()

267

CIMG_create_bitmapsource_annotation()

268

CIMG_scan_acquire_WPF()

268

CIMG_scan_acquire_feeder_WPF()

269

CIMG_scan_acquire_feeder_fast_WPF()

269

CIMG_scan_open_source_WPF()

270

CIMG_scan_pages_fast_WPF()

270

CIMG_scan_pages_WPF()

271

CIMG_scan_get_cap_WPF()

272

CIMG_scan_set_cap_WPF()

272

CIMG_scan_setup_WPF()

273

Annotating with .NET WPF controls CSANN_create_ann_WPF()

18

266

274 274

CSANN_get_object_num_WPF()

274

CSANN_highlight_object_WPF()

275

CSANN_read_ann_WPF()

275

CSANN_read_ann_page_WPF()

276

CSANN_read_ann_mem_page_WPF()

276

CSANN_read_ann_mem_WPF()

277

Working with XML Paper Specification (XPS) Documents

277

CIMG_get_pages_xps()

277

CIMG_get_pages_xps_mem()

278

CIMG_decompress_bitmap_xps()

279

CIMG_decompress_bitmap_xps_mem()

279

Chapter 34 - Working with PDF and Other Document File Formats Working with Document File Formats Saving

281 281 282

Reading and Writing Support for PDF File Formats

282

Reading or Decompressing a PDF Document

282

Saving to a PDF Document

283

Working with Black and White Images

283

Working with Color Images

283

Changing Output Page Size

283

Performance

284

Appendix A - Classes and Support Values

285

Type Property Define Values

285

General Error Define Values Retrieved from Status Property

286

19

public class CIMG_RECT

287

public class CIMG_SEARCH_RESULT

287

public class CASCIITEXTATTR

288

public class CSEARCH_TEXT

290

public class CDIB_HEADER

290

public class CTIFF_TAG

290

public class CSNBDTILESTRUCT

291

Appendix B - Supported File Formats

292

Descriptions of Supported File Formats

292

File Type Constants Listed by File Type Number

304

Appendix C - Software Installation

20

307

Overview of the Installation Process

307

Redistributing Snowbound Files

308

What to Expect When Installing an Evaluation Version

308

What to Expect in a Production Version

308

Installing the Production Version of RasterMaster .NET

308

Installing the Software

309

Directory Structure

314

Installed Files

314

Main Directory Files

315

Strong Name Support

315

Docs Directory Files

316

Marketing Directory Files

316

Sample Directory Files

317

Chapter D - Set Up for ASP .NET Samples

321

Overview of the Set Up Process

321

Setting Up the Environment to Run Web Applications

322

Setting Up Samples on a Web Server

323

Running ASP.NET Samples

327

Chapter E - Set Up for the Web Image Viewer Component Introduction to the Web Image Viewer

329 329

Steps to Run the Web Image Viewer Control in Internet Explorer

329

Troubleshooting

330

Appendix F - .NET Samples

332

Overview of the .NET Samples

333

Running a Sample

333

Building 32-bit Application Running on a 64-bit Operating System

333

Building for a 64-bit Operating System

334

Building a RasterMaster .NET x64 sample with .NET 4.0

334

Building a RasterMaster .NET x32 sample with .NET 2.0

334

Alpha

335

Animate

335

Annaction

336

Annotation

336

ASP Conversion

338

ASP Image View

338

ASP Memory Copy

338

ASP Multiple Pages

339

21

22

Batch_XPS_Convert

339

BatchConvert

339

ConsoleApp

340

Contrast

340

Conversion

341

Convert_Doc

341

DDB Effect

342

DocClean

342

Encryption

343

FileMem

343

Image Processing

343

Memory Copy

344

Merge Image

344

Page

345

Panning

345

Print

345

Scan

346

Split to Multiple Pages

346

Text Search

347

Thumbnail

347

Tiff Tag

348

Web Image Viewer Component

348

WPFAnnotation_CSHARP

349

WPFConversion_CSHARP

349

WPFScanning_CSHARP

350

WPF Image

350

VectorConvertMem_CSHARP

351

XPSMem_CSHARP

351

Appendix G - Snowbound Error Codes

352

Detailed Status/Error Codes

352

General Error Define Values Retrieved from Status Property

355

General Status/Error Codes

356

Appendix H - Troubleshooting

357

Receiving an Error Code When Loading, Saving or Converting a Document

357

Output Document Differs from Original Document

357

Output Document Has Much Larger File Size than the Original Document

357

Output Document Has Much Lower Quality than the Original Document

358

Output Document Displays Incorrect or Missing Characters

359

Improving Performance

359

Identifying an Unknown File Format

360

Receiving a -3 Corrupted File Error code

360

XLS or XLSX Page Content Truncated

360

Overlay Resources Not Pulled into APF or MODCA Document

360

Searching for Text in a Snowbound Software Generated PDF

361

Some TIFF_JPEG Files Produced By RasterMaster .NET Do Not Open In Third Party Image Viewers

361

RasterMaster .NET 4.0 Compatability

361

Color Documents Rendered as Black and White

362

23

Upgrading to the RasterMaster .NET 18.0 Library

362

Getting RasterMaster .NET x32 to work with IIS 7.5

363

Appendix I - TIFF Tags

24

364

Sources for Tag Specifications

364

Descriptions of Tags in Numerical Order

365

List of Tables Table 1.1: Supported Multi-page Functions

39

Table 2.1: CIMG_print_bitmap Function Variables

41

Table 2.2: CIMG_print_bitmap_fast Function Variables

42

Table 3.1: Aspect Ratio Function Description

44

Table 7.1: Snowbnd(int width, int height, int bitsperpixel) Method Variables

52

Table 8.1: ToErrorMessage Variable

54

Table 9.1: SnowPanel Class Specific Method Properties

55

Table 9.2: CustomPaint Variable

55

Table 9.3: OnPaint Variable

56

Table 9.4: OnPaintBackground Variable

56

Table 9.5: OnSizeChanged Variable

57

Table 10.1: CSCAN_CAPS Variables

58

Table 10.2: CIMG_scan_acquire Function Variable

59

Table 10.3: CIMG_scan_acquire_feeder Function Variables

60

Table 10.4: CIMG_scan_acquire_feeder_fast Function Variables

60

Table 10.5: CIMG_scan_get_cap Function Variables

61

Table 10.6: CIMG_scan_open_source Function Variable

62

Table 10.7: CIMG_scan_pages Function Variables

62

Table 10.8: CIMG_scan_page_fast Function Variables

63

Table 10.9: CIMG_scan_set_cap Function Variables

64

Table 10.10: CIMG_scan_set_caps Function Variable

64

Table 10.11: CIMG_scan_setup Function Variable

65

25

26

Table 11.1: Scrollbar Default Function Properties

66

Table 11.2: SnowbndCNet _HScrollBar Variables

66

Table 11.3: SnowbndCNet _VScrollBar Variables

67

Table 12.1: : CIMG_decompress_bitmap Function Variable

69

Table 12.2: CIMG_decompress_bitmap_display Function Variables

70

Table 12.3: CIMG_decompress_bitmap_fd Function Variables

71

Table 12.4: CIMG_decompress_bitmap_FlexSnap Function Variables

71

Table 12.5: CIMG_decompress_bitmap_mem Function Variables

72

Table 12.6: CIMG_decompress_bitmap_page Function Variables

73

Table 12.7: CIMG_decompress_bitmap_url Function Variables

74

Table 12.8: CIMG_decompress_bitmap_xps Function Variables

75

Table 12.9: CIMG_decompress_fax Function Variables

75

Table 12.10: CIMG_decompress_fax_mem Function Variables

76

Table 12.11: CIMG_decompress_tiled_bitmap Function Variables

77

Table 13.1: CIMGLOW_set_auto_detect Function Variable

78

Table 13.2: CIMGLOW_set_decomp_rect Function Variables

79

Table 13.3: CIMGLOW_set_decomp_reduction Function Variable

79

Table 13.4: CIMGLOW_set_decompsize Function Variables

80

Table 13.5: CIMGLOW_set_jpeg_decompression Function Variable

80

Table 13.6: CIMGLOW_set_pdf_input Function Variables

82

Table 13.7: CIMGLOW_set_pdf_password Function Variables

82

Table 13.8: CIMGLOW_unset_auto_detect Function Variable

83

Table 14.1: CIMG_create_bitmap_class Function Variable

84

Table 14.2: CIMG_create_handle Function Variable

84

Table 14.3: CIMG_create_handle_ddb Function Variables

85

Table 14.4: CIMG_create_handle_keep Function Variable

85

Table 15.1: CIMGLOW_set_html_input function variable descriptions.

87

Table 15.2: CIMGLOW_set_html_page_size function variable descriptions .

87

Table 15.3: CIMGLOW_set_html_capabilities Function Variables

88

Table 15.4: CIMGLOW_set_html_home_dir function variable descriptions.

89

Table 15.5: CIMGLOW_set_html_image_capability function variable descriptions.

90

Table 15.6: CIMGLOW_set_html_javascript_capability function variable descriptions.

91

Table 15.7: CIMGLOW_set_html_page_size_ratio function variable descriptions .

91

Table 15.8: CIMGLOW_set_html_page_size_ratio_capability function variable descriptions .

92

Table 15.9: CIMGLOW_set_html_screen_dpi function variable descriptions .

92

Table 15.10: CIMGLOW_set_html_use_page_breaks_exclusively function variable descriptions.

93

Table 15.11: CIMGLOW_set_html_utf_bom Function Variables

93

Table 15.12: Representations of byte order marks by encoding

94

Table 16.1: CIMGLOW_set_ooxml_license function variable descriptions.

96

Table 16.2: CIMGLOW_ooxml_license_enable  Function Variable

97

Table 17.1: CIMG_save_bitmap Function Variables

99

Table 17.2: CIMG_save_bitmap_fd Function Variables

99

Table 17.3: CIMG_save_bitmap_mem Function Variables

100

Table 17.4: CIMGLOW_write_tiff_stream Function Variables

101

Table 18.1: CIMG_set_encrypt Function Variables

102

Table 18.2: CIMGLOW_set_comp_quality Function Variable

103

27

28

Table 18.3: CIMGLOW_set_image_orientation Function Variable

103

Table 18.4: CIMGLOW_set_jpeg2000_comp_ratio Function Variable

104

Table 18.5: CIMGLOW_set_jpg_interleave Function Variables

104

Table 18.6: CIMGLOW_set_pdf_output Function Variables

105

Table 18.7: CIMGLOW_set_tiff_save_strips Function Variable

106

Table 18.8: CIMGLOW_set_tiff_tag Function Variable

106

Table 19.1: bool repaintBackground Variables

108

Table 19.2: CIMG_display_bitmap Function Variables

109

Table 19.3: CIMG_display_bitmap_aspect Variables

110

Table 19.4: CIMG_display_bitmap_transp Function Variables

111

Table 19.5: CIMG_display_ddb Function Variables

111

Table 19.6: CIMG_display_fit_to_height Function Variables

112

Table 19.7: CIMG_display_fit_to_width Function Variables

113

Table 19.8: CIMG_set_croprect Function Variables

114

Table 19.9: CIMG_set_croprect_scroll Function Variables

114

Table 19.10: CIMG_zoom_bitmap Function Variables

115

Table 19.11: CIMG_zoom_bitmap_1_to_1 Function Variables

115

Table 19.12: CIMG_zoom_bitmap_rect Function Variables

116

Table 19.13: CIMGLOW_map_image_to_wnd Function Variables

117

Table 19.14: CIMGLOW_map_wnd_to_image Function Variables

117

Table 19.15: double calcAspectZoom Variables

118

Table 19.16: RemoveScrollbars Variables

119

Table 20.1: CIMG_animate Function Variables

120

Table 20.2: CIMG_bitmap_palette Function Variable

121

Table 20.3: CIMG_display_ddb_effect Function Variables

121

Table 20.4: CIMG_set_gamma Function Variable

122

Table 20.5: CIMG_set_lut Function Variables

123

Table 20.6: CIMG_window_level Function Variables

124

Table 20.7: CIMGLOW_autocolor Function Variable

124

Table 20.8: CIMGLOW_set_alias_img Function Variable

125

Table 20.9: CIMGLOW_set_alias_quality Function Variable

126

Table 20.10: CIMGLOW_set_dithermode Function Variable

126

Table 20.11: CIMGLOW_set_imnet_page_size Function Variables

127

Table 20.12: CIMGLOW_set_rop Function Variables

128

Table 20.13: CIMGLOW_set_transp_color Function Variable

129

Table 20.14: CIMGLOW_set_wipedelay Function Variable

129

Table 21.1: CIMG_bitmap_info Function Variable

132

Table 21.2: CIMG_get_croprect Function Variable

133

Table 21.3: CIMG_get_display_rect Function Variables

133

Table 21.4: CIMG_get_version Function Variable

134

Table 21.5: CIMG_get_version Function Variable

135

Table 21.6: CIMG_ifl_version Function Variable

135

Table 21.7: CIMGLOW_delete_page Function Variables

136

Table 21.8: CIMGLOW_delete_page_mem Function Variables

136

Table 21.9: CIMGLOW_get_anim_delay Function Variable

137

Table 21.10: CIMGLOW_get_auto_detect Function Variable

137

Table 21.11: CIMGLOW_get_bitmap_header Function Variables

138

Table 21.12: CIMGLOW_get_bitmap_name Function Variables

138

29

30

Table 21.13: CIMGLOW_get_custstring Function Variable

139

Table 21.14: CIMGLOW_get_fileinfo Function Variables

140

Table 21.15: CIMGLOW_get_fileinfo_fd Function Variables

140

Table 21.16: CIMGLOW_get_fileinfo_page Function Variables

141

Table 21.17: CIMGLOW_get_fileinfo_fd Function Variables

141

Table 21.18: CIMGLOW_get_filetype Function Variable

142

Table 21.19: CIMGLOW_get_filetype_fd Function Variable

142

Table 21.20: CIMGLOW_get_filetype_mem Function Variable

143

Table 21.21: CIMGLOW_get_filetype_url Function Variable

143

Table 21.22: CIMGLOW_get_image_orientation_page Function Variables

144

Table 21.23: CIMGLOW_get_pages Function Variable

145

Table 21.24: CIMGLOW_get_pages_fd Function Variable

145

Table 21.25: CIMGLOW_get_pages_mem Function Variable

146

Table 21.26: CIMGLOW_get_pages_url Function Variable

146

Table 21.27: CIMGLOW_get_tiff_tag Function Variables

147

Table 21.28: CIMGLOW_get_tiff_tag_page Function Variables

148

Table 21.29: CIMGLOW_get_tiff_tag_page_fd Function Variables

149

Table 21.30: CIMGLOW_get_tiff_tag_page_mem Function Variables

149

Table 21.31: CIMGLOW_get_tile_info Function Variables

150

Table 21.32: CIMGLOW_is_tiled_image Function Variable

151

Table 21.33: CIMGLOW_read_pixel Function Variables

152

Table 21.34: CIMGLOW_redact_text Function Variables

152

Table 21.35: CIMGLOW_redact_rects Function Variables

153

Table 21.36: CIMGLOW_rotate_page_mem Function Variables

154

Table 21.37: CIMGLOW_set_bitmap_header Function Variables

154

Table 21.38: CIMGLOW_set_document Function Variables

155

Table 21.39: CIMGLOW_set_document_input Function Variables

156

Table 21.40: CIMGLOW_set_document_input Function Variable

157

Table 21.41: CIMGLOW_set_document_page_size Function Variable

158

Table 22.1: CIMG_save_document Function Variables

159

Table 22.2: CIMG_save_mem Function Variables

161

Table 22.3: CIMG_save_mem_page Function Variables

161

Table 22.4: CIMGLOW_append_page Function Variables

162

Table 22.5: CIMGLOW_extract_text Function Variables

163

Table 22.6: Extracted Text Variables

163

Table 22.7: CIMGLOW_extract_text_mem_pointer Function Variables

164

Table 22.8: CIMGLOW_extract_page Function Variables

165

Table 22.9: CIMGLOW_extract_page_mem Function Variables

165

Table 22.10: CIMGLOW_search_text Function Variables

166

Table 22.11: CIMGLOW_set_document_input Function Variables

167

Table 23.1: Description of a sample entry in the snbd_map.fnt file

169

Table 23.2: CIMGLOW_set_fontmap_path Function Variables

170

Table 23.3: CIMGLOW_set_fontmap Function Variables

170

Table 23.4: CIMGLOW_set_pdf_flags Function Variables

171

Table 23.5: CIMGLOW_set_pdf_fontpath Function Variables

171

Table 23.6: CIMGLOW_set_pdfa_fontpath Function Variables

172

Table 23.7: CIMGLOW_set_pdfa_fontmap Function Variables

172

Table 24.1: CIMGLOW_set_bitmap_name Function Variables

175

31

32

Table 24.2: CIMGLOW_set_tiff_indexing Function Variables

176

Table 25.1: CIMG_auto_orient Function Variables

177

Table 25.2: CIMG_deskew_bitmap Function Variable

178

Table 25.3: CIMG_despeckle_bitmap Function Variable

178

Table 25.4: CIMGLOW_auto_invert Function Variables

179

Table 25.5: CIMGLOW_detect_blank_page Function Variables

180

Table 25.6: CIMGLOW_image_dilation Function Variable

181

Table 25.7: CIMGLOW_image_erosion Function Variable

182

Table 25.8: CIMGLOW_remove_halftone Function Variables

182

Table 25.9: CIMGLOW_remove_lines Function Variables

183

Table 25.10: CIMGLOW_remove_holepunch Function Variables

184

Table 26.1: CIMG_apply_profile Function Variables

186

Table 26.2: CIMG_apply_profile Variable Modes

186

Table 26.3: CIMG_auto_orient Function Variable

187

Table 26.4: CIMG_autocrop_bitmap Function Variable

188

Table 26.5: CIMG_create_thumbnail Function Variables

188

Table 26.6: CIMG_deskew_bitmap Function Variable

189

Table 26.7: CIMG_despeckle_bitmap Function Variable

190

Table 26.8: CIMG_dib_to_ddb Function Variables

190

Table 26.9: CIMG_erase_rect Function Variables

191

Table 26.10: CIMG_get_deskew_angle Function Variables

192

Table 26.11: CIMG_get_profile Function Variables 

193

Table 26.12: CIMG_merge_annotation Function Variables

194

Table 26.13: CIMG_merge_bitmap Function Variables

195

Table 26.14: CIMG_merge_bitmap Function Variables

197

Table 26.15: CIMG_merge_bitmap_alpha Function Variables

199

Table 26.16: CIMG_process_bitmap Function Variables

199

Table 26.17: CIMG_remove_red_eye Function Variables

200

Table 26.18: CIMG_resize_bitmap Function Variables

201

Table 26.19: CIMG_resize_bitmap_bicubic Function Variables

202

Table 26.20: CIMG_resize_bitmap_interp Function Variables

202

Table 26.21: CIMG_rotate_bitmap Function Variable

203

Table 26.22: CIMG_set_display_angle Function Variable

204

Table 26.23: CIMG_sharpen_bitmap Function Variable

205

Table 26.24: CIMGLOW_get_palette Function Variables

205

Table 26.25: CIMGLOW_get_raster Function Variables

206

Table 26.26: CIMGLOW_put_palette Function Variables

206

Table 26.27: CIMGLOW_put_raster Function Variables

207

Table 26.28: CIMGLOW_set_fast_convert Function Variables

208

Table 27.1: CIMGLOW_extract_text Function Variables 

210

Table 27.2: Extracted Text Variable 

210

Table 27.3: CIMGLOW_extract_text_mem Function Variables

211

Table 27.4: Extracted Text Variable 

211

Table 27.5: CIMG_save_document Function Variables

213

Table 27.6: CIMG_save_document_mem Function Variables

214

Table 28.1: CIMG_color_combine Function Variables

218

Table 28.2: CIMG_color_separate Function Variables

219

Table 28.3: CIMGLOW_get_tiff_tag Function Variables

220

33

34

Table 29.1: CIMG_resize_to_gray Function Variables

223

Table 29.2: CIMG_octree_color Function Variables

224

Table 29.3: CIMG_thresh_mono Function Variable

227

Table 30.1: public class CASCIITEXTATTR Variables

231

Table 30.2: ASCIITEXTATTR Function Flags

232

Table 30.3: Standard Page Sizes

233

Table 30.4: CIMG_import_ascii Function Variables 

234

Table 30.5: CIMGLOW_get_ascii_attributes Function Variable

234

Table 30.6: CIMGLOW_get_ascii_page_width Function Variable

235

Table 30.7: CIMGLOW_set_ascii_attributes Function Variable

235

Table 31.1: MS_Windows DIB Palette Format

239

Table 31.2: MS_Windows DIB Image Data Format

239

Table 32.1: CANN_GRAPHIC_STRUCT Class Variables

241

Table 32.2: CSANN_activate_objectFunction Variables

242

Table 32.3: CSANN_add_object Function Variables

243

Table 32.4: CSANN_choose_color Function Variable

243

Table 32.5: CSANN_choose_line_style Function Variable

244

Table 32.6: CSANN_choose_line_width Function Variable

245

Table 32.7: CSANN_create_ann Function Variables

245

Table 32.8: CSANN_deactivate_object Function Variables

246

Table 32.9: CSANN_delete_object Function Variables

247

Table 32.10: CSANN_display_annotations Function Variables

248

Table 32.11: CSANN_draw_object Function Variables

248

Table 32.12: CSANN_get_croprect Function Variables

249

Table 32.13: CSANN_get_disprect Function Variables

250

Table 32.14: CSANN_get_object_bounds Function Variables

250

Table 32.15: CSANN_get_object_dataFunction Variables

250

Table 32.16: CSANN_get_object_info Function Variables

251

Table 32.17: CSANN_get_object_num Function Variables

251

Table 32.18: CSANN_highlight_object Function Variables

252

Table 32.19: CSANN_map_image_to_wnd Function Variables

252

Table 32.20: CSANN_map_wnd_to_image Function Variables

253

Table 32.21: CSANN_mouse Function Variables

253

Table 32.22: Table 34-22: CSANN_move_object Function Variables

254

Table 32.23: CSANN_print_annotations Function Variables

255

Table 32.24: CSANN_read_ann Function Variables

255

Table 32.25: CSANN_read_ann_FlexSnap Function Variables

256

Table 32.26: CSANN_read_ann_mem Function Variables

256

Table 32.27: CSANN_read_ann_mem_page Function Variables

256

Table 32.28: CSANN_read_ann_page Function Variables

257

Table 32.29: CSANN_resize_object Function Variables

257

Table 32.30: CSANN_rotate Function Variables

258

Table 32.31: CSANN_set_bcolor Function Variables

258

Table 32.32: CSANN_set_croprect Function Variables

259

Table 32.33: CSANN_set_disprect Function Variables

259

Table 32.34: CSANN_set_fcolor Function Variables

260

Table 32.35: CSANN_set_font Function Variables

260

Table 32.36: CSANN_set_line_style Function Variables

261

35

36

Table 32.37: CSANN_set_line_width Function Variables

261

Table 32.38: CSANN_set_size Function Variables

262

Table 32.39: CSANN_write_ann Function Variables

262

Table 32.40: CSANN_write_ann_FlexSnap Function Variables

263

Table 32.41: CSANN_write_ann_mem Function Variables

263

Table 32.42: CSANN_write_ann_mem_page Function Variables

264

Table 32.43: CSANN_write_ann_page Function Variables

264

Table 32.44: Annotation Constants

264

Table 33.1: CIMG_create_bitmapsource_class Function Variable

267

Table 33.2: CIMG_create_bitmapsource_class Function Variable

267

Table 33.3: CIMG_create_bitmapsource_annotation Function Variables

268

Table 33.4: CIMG_scan_acquire_WPF Function Variables

268

Table 33.5: CIMG_scan_acquire_feeder_WPF Function Variables

269

Table 33.6: CIMG_scan_acquire_feeder_fast_WPF Function Variables

270

Table 33.7: CIMG_scan_open_source_WPF Function Variable

270

Table 33.8: CIMG_scan_pages_fast_WPF Function Variable

271

Table 33.9: CIMG_scan_pages_WPF Function Variables

271

Table 33.10: CIMG_scan_get_cap_WPF Function Variables

272

Table 33.11: CIMG_scan_set_cap_WPF Function Variables

273

Table 33.12: CSANN_create_ann_WPF Function Variables

274

Table 33.13: CSANN_get_object_num_WPF Function Variables

274

Table 33.14: CSANN_highlight_object_WPF Function Variables

275

Table 33.15: CSANN_read_ann_WPF Function Variables

276

Table 33.16: CSANN_read_ann_page_WPF Function Variables

276

Table 33.17: CSANN_read_ann_mem_page_WPF Function Variables

277

Table 33.18: CSANN_read_ann_mem_WPF Function Variables

277

Table 33.19: CIMG_get_pages_xps Function Variable

278

Table 33.20: CIMG_get_pages_xps_mem Function Variable

278

Table 33.21: CIMG_decompress_bitmap_xps Function Variables

279

Table 33.22: CIMG_decompress_bitmap_xps_mem Function Variables

279

Table 34.1: CIMGLOW_set_document Function Variables

281

Table 34.2: CIMGLOW_set_pdf_output Function Variables

282

Table A.1: Type Property Define Values

285

Table A.2: General Error Define Values Retrieved from Status Property

286

Table A.3: public class CIMG_RECT Variables

287

Table A.4: public class CIMG_SEARCH_RESULT Variables

288

Table A.5: public class CASCIITEXTATTR Variables

289

Table A.6: public class CTIFF_TAG Variables

291

Table B.1: File Format Key

292

Table B.2: File Type Constants listed by File Type Number

304

Table C.1: RasterMaster .NET Default Directory File

315

Table C.2: RasterMaster .NET Docs Directory Files

316

Table C.3: RasterMaster .NET Samples Directory

317

Table G.1: Error Codes

352

Table G.2: General Error Define Values Retrieved from Status Property

355

Table G.3: General Status/Error Codes

356

Table I.1: TIFF Tags in Numerical Order1

365

37

Chapter 1 - Saving and Reading Multi-page Images

Chapter 1 - Saving and Reading Multi-page Images This chapter describes how to decompress, determine page counts, save, and convert multipage images in the RasterMaster .NET.

Multi-page Images All Snowbound libraries decompress a single page at a time. This section describes the multipage formats and how to decompress, determine page count, and save multi-page images.

Supported Multi-page Formats RasterMaster .NET currently supports the following multi-page formats: l

TIFF

l

DCX

l

MO:DCA/IOCA

l

PDF

l

PCL

l

MS Word - Reading

l

MS Excel - Reading

l

PowerPoint - Reading

l

RTF - Reading

Decompressing a Multi-page Image Each page must be decompressed then saved separately. In other words, a decompress then save must be performed for each page.

Determining Multi-page Page Count You can keep decompressing pages until a PAGE NOT FOUND or -11 error is returned from the decompress function or method, or you can query the number of pages with the CIMGLOW_ get_pages function. See CIMGLOW_get_pages() for more information.

Saving Multi-page File Formats When saving to a multi-page file format, keep in mind that all RasterMaster products append or add new pages to an image file if the file already exists. If you do not want to keep saving to the same file, you must save each page to a unique file name.

38

Chapter 1 - Saving and Reading Multi-page Images

Multi-page Format Functions Table 1.1: Supported Multi-page Functions Properties CIMGLOW_get_pages()

CIMG_decompress_bitmap_page()

Description Detects the number of pages in a file. See CIMGLOW_get_pages() for more information. Reads pages. Specify the specific page to import. See CIMG_decompress_ bitmap_page() for more information about this function. Saves multi-page images. For an existing file, new pages are appended. For new files, new pages with the specified name are created as necessary.

CIMG_save_bitmap()

Note: Use a unique filename when saving to multi-page formats; otherwise, images are automatically appended to any file with the same name. See CIMG_save_bitmap() for more informa-tion on these functions.

39

Chapter 2 - Printing Images

Chapter 2 - Printing Images This chapter describes how to print images using the RasterMaster .NET.

Printing Overview All Snowbound products for Windows print to any device with a valid Windows printer driver installed. If a color or gray scale image is printed to a 1-bit or bi-level printer such as an HP-LASERJET type printer, the image is dithered or reduced to 1-bit per pixel automatically. The capabilities of the printer are detected by the Snowbound libraries to determine if the image must be dithered. The technique employed is Stucky error diffusion. This technique simulates grayscale by the placement of dots. The higher the resolution of the printer, the better the effect. Note: For color or grayscale images, the CIMG_print_bitmap_fast() command is the quickest.

Printing Functions There are two printing functions available.

Normal Printing Normally, to print an image, use the function below. CIMG_print_bitmap(Graphics *g, int x, int y, int width, int height) See CIMG_print_bitmap() for more information on normal printing.

Fast Printing To print an image using fast printing, use the function below. CIMG_print_bitmap_fast(Graphics *g, int x, int y, int width, int height) Fast printing is used with Postscript printers. It does a nice job of scaling and dithering images. The whole image in its original size is sent to the printer with no preprocessing. A lot of processing is done within the library when doing normal printing. See CIMG_print_bitmap_fast() for more information on fast printing. Note: This may not work with all printers.

40

Chapter 2 - Printing Images

CIMG_print_bitmap() This function is a standard image print routine. This function detects whether or not the printer is in color mode or black and white. If a black and white printer is detected when printing a color or gray scale image, the image is reduced to black and white using an error diffusion algorithm. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Print sample. Note: A negative value indicates an error. See the imgerr.h file or Appendix H, Snowbound Error Codes. Syntax int SNBDAPI CIMG_print_bitmap(Graphics *g, int x, int y, int width, int height); Remark Table 2.1: CIMG_print_bitmap Function Variables Variable

Description

g x y width height

Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image

Returns Returns the status of the print bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_print_bitmap_fast() This function is a special image print routine. This function is different from CIMG_print_bitmap() because it sends the current Windows DIB specified by the image object directly to the printer. The printer is required to do the scaling and color reduction if necessary. Postscript printers will be much faster.

41

Chapter 2 - Printing Images

Notes: This call may fail on some printers. If you have any problems with this function, use the standard CIMG_print_bitmap (). See CIMG_print_bitmap() for more information. The SNOWBND_ERROR value indicates a problem. See the SNOWBND_ERROR or Appendix H, Snowbound Error Codes for more information. Syntax int SNBDAPI CIMG_print_bitmap_fast(Graphics *g, int x, int y, int width, int height); Remark Table 2.2: CIMG_print_bitmap_fast Function Variables Variable

Description

g x y width height

Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image

Returns Returns the status of the print bitmap fast operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

Printing Large Documents Printing large documents, such as documents approaching or exceeding 100 pages, or documents set to a resolution of 300 DPI or above, requires additional memory resources. These additional resource requirements can affect the performance of both servers and clients.

Servers Depending on the current Java Virtual Machine memory configuration for the Imaging server, the need for additional resources may cause an out of memory error. Increasing the Java Virtual Machine maximum heap size to the Imaging server during start up can help avoid memory errors. Specify the minimum and maximum heap size by passing the parameter -Xms and -Xmx to the Imaging server during start up, where the amount of memory is in megabytes or gigabytes you want to allocate to the Imaging server.

42

Chapter 2 - Printing Images

Clients Each of the different browsers handles the increased resource demands uniquely. In some cases, when printing documents that require additional resources, the document may print with blank pages, fail to respond, or require the browser or computer to be restarted.

Solution A workaround for this problem may be to download the document locally and then print it. If the document does not have any annotations or the document is to be printed without annotations, the original document can be downloaded and printed. However, if a document is to be printed with annotations, a TIFF version of the document can be downloaded and printed.

43

Chapter 3 - Aspect Ratio Correction Function

Chapter 3 - Aspect Ratio Correction Function This chapter describes the function used for aspect ratio correction within the RasterMaster .NET.

Aspect Ratio Correction Function Table 3.1: Aspect Ratio Function Description Function

Description

Handles correction of aspect ratio but preserves the width and height of images when its window is resCIMG_display_bitmap_aspect() ized. See CIMG_display_bitmap_aspect() for more information.

44

Chapter 4 - Display Quality

Chapter 4 - Display Quality This chapter describes how to achieve the best display quality for an image using RasterMaster .NET.

Achieving the Best Display Quality Achieving the best display quality of any image depends on the type of image being viewed.

24-Bit Images Displayed on a 256 Color Adapter To achieve the best display quality for 24-bit images displayed on a 256 color adapter, the default behavior is to convert the image at display time to 256 colors using a simple bayer matrix dither. You can change this to a better quality diffusion dithering by using the following call: CIMGLOW_set_dithermode(); This will, however, take a little longer to display the image. Use 256 for the number of colors to optimize to. This call permanently changes the image to an 8-bit image so you need only call the function once. The image contains an optimized palette; allowing one quality image to be displayed at a time. See CIMGLOW_set_dithermode() and CIMG_remove_red_eye() for more information on displaying 24-bit images.

Bi-Level and 1-Bit Per Pixel Images To achieve the best display quality for bi-level or 1-bit per pixel images, set the CIMGLOW_set_ alias() function to: l

2 for scale to gray

l

1 for preserve black

Large images at 200 DPI or larger must be scaled to fit on a standard resolution monitor. The default scaling skips pixels so small lines or details may be ignored. Aliasing When the aliasing function is turned on, the scaling algorithm looks at neighboring pixels to preserve details that might normally be lost. Scale to Gray The scale to gray function converts the neighboring pixels to a 8-bit gray scale value. Best results are obtained on text type documents. Preserve Black The preserve black function creates a 1-bit pixel based on neighboring pixels. This has been found to work well on large engineering type drawings. It is suggested to try both to see which yields the best results on the type of images you are using.

45

Chapter 5 - Image Compression

Chapter 5 - Image Compression This chapter describes how to select the best compression for an image using RasterMaster .NET.

Preferred Formats Most of the compression algorithms only compress a specific type of image data. Compression techniques for 24-bit color images usually do not work well on 1-bit or bi-level images. Similarly, compression for 1-bit images do not compress well for 24-bit color images.

24-Bit Color Images For 24-bit color images, use the JPEG format in RasterMaster .NET for the best conversion results.

8-Bit Gray Scale Images For 8-bit gray scale images, use the JPEG format in RasterMaster .NET for the best conversion results.

1-bit Bi-Level Images For 1-bit bi-level images, use the TIFF G4 in RasterMaster .NET for the best conversion results. The JBIG format works about twenty percent better than the TIFF G4 format, but it can be much slower.

46

Chapter 6 - File Format Conversion

Chapter 6 - File Format Conversion This chapter describes how to convert an image to a different file format.

Converting File Formats RasterMaster .NET supports over 100 file formats. Many formats such as TIFF are very broad in the internal support of compression and bit depths. Not all formats can support all bit depths. All RasterMaster products import and convert file formats to Snowbound’s internal formats at decompress time. The format is a simple uncompressed DIB format stored in memory. This format is decompressed or imported and can be saved out to any supported format. See Appendix B, Supported File Formats for a complete list of supported file formats. In general, RasterMaster .NET handles details like file format, bit-depth, bit ordering, and compression formats automatically. You will need only a few RasterMaster .NET calls to handle a wide variety of input and output file types.

Automatically Detecting File Formats In most cases, you do not need to know the file format you wish to convert since RasterMaster .NET products automatically detect the file format regardless of the file extension. File extensions are not mandatory. RasterMaster .NET supports automatic promotion of images to destination files. For example, JPEG images can only be written out at 8 and 24-bits per pixel. In order to save a 1-bit TIFF image as JPEG, the developer must promote the TIFF to 8 or 24-bits per pixel. In our other libraries, this is accomplished by calling one of the promote functions. In RasterMaster .NET, however, the library automatically determines the bits per pixel for the destination format and promotes accordingly. The data type CIMG_IMAGE_TYPE in .NET library includes all current image types defined in the library. When we use .NET library, instead of giving the format number such as 59, use CIMG_ IMAGE_TYPE.pdf. For example: status = simage.CIMGLOW_set_auto_detect((int)CIMG_IMAGE_TYPE.ascii); You can read in almost any type of image or document using the CIMGLOW_set_document_ input(int, int, int) method. RasterMaster .NET examines the content of the document and not the file type extension to determine the file type If a file does not have a file extension or has the wrong file name extension, RasterMaster .NET will still identify the format correctly.

47

Chapter 6 - File Format Conversion

Input Document Quality: Resolution/DPI Before you read a document in, you have the option of adjusting the input quality. Reading in at a high resolution DPI (dots per inch) will result in a higher quality document. This will give you the option of producing higher quality output. However there is a trade-off. Higher quality documents take longer to process and take up more space in memory and when stored. You can adjust the quality using one of the CIMGLOW_set_document_input(int, int, int) methods.

Input Document Quality: Color/bit-depth/Pixel Depth RasterMaster .NET will automatically read in black and white, grayscale, and color documents at the appropriate bit-depth (1, 8 and 24 respectively). The bit-depths RasterMaster .NET uses automatically vary by input format. For more information on file formats, please see Appendix B, Supported File Format. You can tell RasterMaster .NET to read in color documents as black and white to increase performance. You do this by calling CIMGLOW_set_document_input(int, int, int) with a bit-depth of 1. You can tell RasterMaster .NET to read in black and white documents as color. However, that is not recommended because it will hurt performance for no gain in quality.

Making Sure Input is Compatible with Output Most of the time, the input that you read in will convert successfully to the output format you select in either CIMG_save_bitmap() or CIMG_save_document().

Getting a Pixel_Depth_Unsupported Error A Pixel_Depth_Unsupported error indicates that the bit-depths do not match. You can look at the file formats you are using in Appendix B, Supported File Format to compare the bitdepths supported by your input and output file formats. The goal is to find a bit-depth that the file formats have in common. If you do not know the file format of the input file, you can use the CIMGLOW_get_filetype() to determine it. You can find the bit depth/bits per pixel of your image by calling CIMG_bitmap_ info() and looking at the value in biBitCount, In some cases, you will find you do not have enough bits-per-pixel to go to the desired output format. For example, if you are going from a black and white or grayscale to a color document that is color promotion because the bit-depth is going from low to high. Please see Chapter 30, Color Promotion Functions for information on RasterMaster .NET functions that you can use to get to the bits per pixel depth you need. If you have too many bits per pixel for the desired output format, then you are going from color or grayscale towards black and white. Going from a higher bits per pixel to a lower one is color reduction. Please see the Chapter 31, Color Reduction Functions for information on RasterMaster .NET functions that you can use to adjust your image to a lower pixel depth.

Adjusting Low Output Quality The output quality is affected by several factors described in the sections below:

48

Chapter 6 - File Format Conversion

The Input Quality If you are reading in color documents and getting out black and white, then your bit-depth (color) may be lower than that of your desired output. Try increasing bit-depth (color) of the input document using CIMGLOW_set_document_input(int, int, int). If your output is coming out grainy, then check to see if your input is grainy too. If the input document looks good, then increase the input DPI using CIMGLOW_set_document_input(int, int, int). If the input is grainy, then you may need to do some image enhancement techniques. Contact Snowbound Support at http://support.snowbound.com for help. Color Reduction - Going from a Color Document to Black and White or Grayscale RasterMaster .NET will automatically handle color promotion and reduction. However there is no excellent one-size-fits-all method for either of these. You can adjust the quality by using different color promotion or color reduction methods to fine tune your results. Please see the Chapter 30, Color Promotion Functions and Chapter 31, Color Reduction Functions chapters for more information. Lossy Compression If your output format is using a lossy compression, you may lose details. You may want to try a different lossless output format. Error During Conversion In some rare cases, there may be an error during conversion. The text for any of the error codes described in the table below can be obtained by calling ToErrorMessage(). Please provide the input file and a sample of the bad output to Snowbound Support at http://support.snowbound.com . Conversion Takes Too Long or Output Is Too Large If you have selected high quality output by selecting a high resolution (DPI) or a high bit-depth (color), there will be a lot more data than for a lower quality image. The data takes longer to process and takes more space. Please see Determining Memory Requirements for information on determining your memory requirements. If you reduce the DPI or the bits per pixel in your input. using CIMGLOW_set_document_input(int, int, int) and/or in the output using color reduction, you should see better performance and smaller files.

49

Chapter 7 - Class Snow.Snowbnd Methods

Chapter 7 - Class Snow.Snowbnd Methods This chapter describes the available methods for the Snow.Snowbnd class.

Snowbnd() This is an alternate constructor that creates a new Snowbnd object by copying the contents of an existing Snowbnd object. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Alpha

l

Animate

l

Annaction

l

Annotation

l

ASP Conversion

l

ASP Image View

l

ASP Memory Copy

l

ASP Multiple Pages

l

Batch_XPS_Convert

l

Contrast

l

Conversion

l

Convert_Doc

l

DDB Effect

l

DocClean

l

Encryption

l

FileMem

50

Chapter 7 - Class Snow.Snowbnd Methods

l

Image Processing

l

Memory Copy

l

Merge Image

l

Page

l

Panning

l

Print

l

Scan

l

Split to Multiple Pages

l

Text Search

l

Thumbnail

l

Tiff Tag

l

Web Image Viewer Component

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

l

WPFScanning_CSHARP

l

VectorConvertMem_CSHARP

l

XPSMem_CSHARP

Syntax Snowbnd(void);

Snowbnd(int, int, int) This is an image constructor for the Snowbnd object. This allows the creation of a blank image with allocated memory. Syntax Snowbnd(int width, int height, int bitsperpixel);

51

Chapter 7 - Class Snow.Snowbnd Methods

Remark Table 7.1: Snowbnd(int width, int height, int bitsperpixel) Method Variables Variable

Description

width height bitsperpixel

Width of blank bitmap to create. Height of bitmap to create. Pixel depth of bitmap to create. Can be set to 1, 8, or 24.

52

Chapter 8 - SDK Class Specific Methods

Chapter 8 - SDK Class Specific Methods This chapter describes the SDK class specific functions for RasterMaster .NET. The chapter contains the following topics:

isValidImage() This function checks to see if the image is decompressed into the object. It checks that the image data for the object is present or valid. Syntax virtual bool isValidImage(void);

clearImage() This function takes what is in the object, removes image data, and resets the class. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Animate

l

DDB Effect

l

Encryption

l

FileMem

l

Image Processing

l

Memory Copy

l

Text Search

l

Tiff Tag

Syntax virtual int clearImage(void);

53

Chapter 8 - SDK Class Specific Methods

ToErrorMessage() This method checks for errors and returns the appropriate error message for the found error. Syntax String SNBDAPI ToErrorMessage(status); Remark Table 8.1: ToErrorMessage Variable Variable

Description

status

The error code.

Returns Returns he text of the error message. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

54

Chapter 9 - SnowPanel Class Specific Methods

Chapter 9 - SnowPanel Class Specific Methods This chapter describes the SnowPanel class specific methods.

Properties This section lists the properties used in the SnowPanel class specific methods: Table 9.1: SnowPanel Class Specific Method Properties Property

Description

Zoom

Gets and sets user defined zoom value ASPECT_ZOOM type values. Returns the zoom value as an ASPECT_ZOOM. Sets the double buffer display on or off

Type DoubleBuffered

CustomPaint() This function is the main paint method for the Snowbound image to the screen. This function is only used for the SnowPanel class. The user can override CustomPaint to provide his own CustomPaint method. Syntax public virtual void CustomPaint(Graphics *g); Remark Table 9.2: CustomPaint Variable Variable

Description

g

Graphics object

Returns Returns the status of the graphics object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

55

Chapter 9 - SnowPanel Class Specific Methods

OnPaint() This function calls CustomPaint to draw the image using the CustomPaint method. How this method paints is based on the DoubleBuffer property. Syntax protected virtual void OnPaint(PaintEventArgs *e); Remark Table 9.3: OnPaint Variable Variable

Description

PaintEventArgs

Standard .NET event handle

Returns Returns the status of the standard .NET event handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

OnPaintBackground() This function repaints the background color and image of the SnowPanel class depending on if the background image is available. How this method paints is based on the DoubleBuffer property. Syntax protected virtual void OnPaintBackground(PaintEventArgs *pevent); Remark Table 9.4: OnPaintBackground Variable Variable

Description

PaintEventArgs

Standard .NET event handle

Returns Returns the status of the standard .NET event handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

OnSizeChanged() This function is used when the SnowPanel class is resized to preserve the display.

56

Chapter 9 - SnowPanel Class Specific Methods

Syntax protected virtual void OnSizeChanged(EventArgs *e); Remark Table 9.5: OnSizeChanged Variable Variable

Description

EventArgs

Standard .NET event handle

Returns Returns the status of the standard .NET event handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

57

Chapter 10 - Scanning Functions

Chapter 10 - Scanning Functions This chapter describes the scanning functions and parameters.

Scanning Constants Shown below is the structure for setting scanning parameters. Syntax Example 10.1: public__gc class CSCAN_CAPS { public: int bitspix; /* bits per pixel */ double left; /* window x start pos in inches */ double top; /* window y start pos in inches */ double right; /* window x size in inches */ double bottom; /* window y size in inches */ int hres; /* x resolution in pixels */ int vres; /* y resolution in pixels */

Variables Table 10.1: CSCAN_CAPS Variables Variable

Description

int bitspix double left double top double right double bottom int hres int vres

Bits per pixel Window x start pos in inches Window y start pos in inches Window x size in inches Window y size in inches X resolution in pixels Y resolution in pixels

CIMG_scan_acquire() This TWAIN scanning routine scans an image on the currently installed scanner or input device. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample.

58

Chapter 10 - Scanning Functions

Notes: CIMG_scan_open_source()must be called first. See CIMG_scan_open_source() for more information. The Snowbound control must be visible. Syntax int SNBDAPI CIMG_scan_acquire(Control *win_control, int iShowUI); Remark Table 10.2: CIMG_scan_acquire Function Variable Variable

Description

win_control

Window form control object 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

iShowUI Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_acquire_feeder() This TWAIN scanning function allows scanning from a scanner with an automatic document feeder. Call this function in a loop until the NO_MORE_PAGES error is returned then close the scanner with the CIMG_scan_feeder_close() function. See CIMG_scan_feeder_close() for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Note: A negative value indicates (NO_MORE_PAGES) is returned when the feeder is empty. Syntax int SNBDAPI CIMG_scan_acquire_feeder(Control *win_control, int iShowUI);

59

Chapter 10 - Scanning Functions

Remark Table 10.3: CIMG_scan_acquire_feeder Function Variables Variable

Description

win_control

Window form control object 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

iShowUI Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_acquire_feeder_fast() This function allows for new fast memory transfer scanning. A parameter can also be set to duplex scanning if your scanner supports it. Syntax int SNBDAPI CIMG_scan_acquire_feeder_fast(Control *win_control, int iShowUI, int iDuplex); Remark Table 10.4: CIMG_scan_acquire_feeder_fast Function Variables Variable

Description

win_control

Window form control object 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box 1 = set duplex scanning mode

iShowUI iDuplex Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_feeder_close() This TWAIN scanning function closes the scanner after calls to the CIMG_scan_acquire_ feeder() function. Use this function after receiving the NO_MORE_PAGES error message from the CIMG_scan_acquire_feeder() function. See CIMG_scan_acquire_feeder() for more information.

60

Chapter 10 - Scanning Functions

You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_feeder_close(void); Returns Returns the status of the close. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_get_cap() This function returns the value of the current specified TWAIN capability. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_get_cap(Control *win_control, int cap); Remark Table 10.5: CIMG_scan_get_cap Function Variables Variable

Description

win_control cap

Window form control object TWAIN scanner capability to retrieve

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_open_source() This TWAIN scanning function displays a dialog box which allows for setting available input devices. It then displays a dialog box for selecting the available input devices. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample.

61

Chapter 10 - Scanning Functions

Syntax int SNBDAPI CIMG_scan_open_source(Control *win_control); Remark Table 10.6: CIMG_scan_open_source Function Variable Variable

Description

win_control

Window form control object

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_pages() This TWAIN scanning routine scans all pages from the currently selected scanner or input device and saves to the path/filename specified by the filename in the image format file type. For multi-page formats, all pages are stored in a single multi-page file. For single page formats, images are created with the following filenames: 00000000.img, 00000001.img, etc. for each page. For multi-page file types such as TIFF, DCX, or MO:DCA:OCA, you must specify a valid filename. For other file types, the filename can only contain a path. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Note: Normally the iShowUI will be turned off for multi-page scanning. Syntax int SNBDAPI CIMG_scan_pages(Control *win_control, String strFileName, int iFileType, int iShowUI); Remark Table 10.7: CIMG_scan_pages Function Variables Variable

Description

win_control strFileName

Window form control object Output file name to create as a scanned image

62

Chapter 10 - Scanning Functions

Variable iFileType iShowUI

Description See Appendix B, Supported File Format for file type formats in which to save compressed images 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_pages_fast() This function allows for new fast memory transfer scanning. A parameter can also be set to allow duplex scanning if your scanner supports it. It scans all pages from the current installed scanner or input device and saves them to the specified path/filename. The file format is specified by the iFileType parameter. For multi-page formats, all pages are stored in a single multi-page file. For single page formats, images are created with the following filenames: 0000000.img, 00000001.img, etc. for each page. For multi-page file types such as TIFF, DCX, or MO:DCA:IOCA you must specify a valid filename and all pages will be stored in a single multi-page image. For other file types, the filename can only contain a path. Note: Normally the iShowUI will be turned off for multi-page scanning. Syntax int SNBDAPI CIMG_scan_pages_fast(Control *win_control, String strFileName, int iFileType, int iShowUI, int iDuplex); Remark Table 10.8: CIMG_scan_page_fast Function Variables Variable

Description

win_control strFileName iFileType

Window form control object Output file name File type (from imglib.h) 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box 1 = set duplex scanning mode

iShowUI iDuplex

63

Chapter 10 - Scanning Functions

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_set_cap() This function sets the value of the specified TWAIN capability. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_set_cap(Control *win_control, int cap, int value); Remark Table 10.9: CIMG_scan_set_cap Function Variables Variable

Description

win_control cap value

Window form control object Current TWAIN capability to set New setting for TWAIN capability

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_set_caps() This function allows the user to set the scanning parameters such as height, width, and bits per pixel for the current scanner. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_set_caps(CSCAN_CAPS *new_caps); Remark Table 10.10: CIMG_scan_set_caps Function Variable

64

Chapter 10 - Scanning Functions

Variable

Description

new_caps

Pointer to the CSCAN_CAPS structure

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_scan_setup() This function TWAIN scanning routine allows the caller to bring up the TWAIN driver’s user interface to set scanning parameters. After the parameters are set, they are saved. No scanning occurs unless one of the other scan acquiring functions are called. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_setup(Control *win_control); Remark Table 10.11: CIMG_scan_setup Function Variable Variable

Description

win_control

Window form control object

Example 10.2 CIMGLOW_ooxml_license_enable string licensePath = ""; status = snowbnd.CIMGLOW_ooxml_license_enable(ref licensePath); Console.WriteLine(licensePath);

Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

65

Chapter 11 - Scrollbar Default Functions

Chapter 11 - Scrollbar Default Functions This chapter describes the RasterMaster .NET scrollbar default functions. Properties

Properties This section lists the properties used in the scrollbar default functions: Table 11.1: Scrollbar Default Function Properties Property

Description

Hsb Vsb Status StatusDetails

Gets and sets the horizontal scrollbar Gets and sets the vertical scrollbar Gets the GENERAL_STATUS error codes Gets the detailed status error codes

SnowbndCNet_HScrollBar() This function controls how an image is scrolled. Syntax virtual void SnowbndCNet_HScrollBar(Object *sender, ScrollEventArgs *se); Remark Table 11.2: SnowbndCNet _HScrollBar Variables Variable

Description

sender ScrollEventArgs

Standard .NET object Standard .NET object

Returns Returns the standard .NET object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

SnowbndCNet_VScrollBar() This function controls how an image is scrolled.

66

Chapter 11 - Scrollbar Default Functions

Syntax virtual void SnowbndCNet_VScrollBar(Object *sender, ScrollEventArgs *se); Remark Table 11.3: SnowbndCNet _VScrollBar Variables Variable

Description

sender ScrollEventArgs

Standard .NET object Standard .NET object

Returns Returns the standard .NET object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

67

Chapter 12 - Image Decompression Functions

Chapter 12 - Image Decompression Functions This chapter describes the RasterMaster .NET image decompression functions.

CIMG_decompress_bitmap() This is the main function for loading a compressed or uncompressed image from disk. It converts the data to a Windows DIB format in memory. It supports unicode file name input. This function is used to read in any supported format including MO:DCA, AFP, PCL, PDF, RTF, or Word. See Appendix B, Supported File Format for a list of supported file formats.You do not need to know the format of the document before using the decompress bitmap function. Simply provide the document to this function and it will automatically detect the format and convert it to bitmap. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Alpha

l

Animate

l

Annaction

l

Annotation

l

ASP Conversion

l

ASP Image View

l

ASP Memory Copy

l

ASP Multiple Pages

l

Contrast

l

Conversion

l

Convert_Doc

l

DocClean

68

Chapter 12 - Image Decompression Functions

l

DDB Effect

l

Encryption

l

Image Processing

l

Memory Copy

l

Merge Image

l

Page

l

Panning

l

Print

l

Scan

l

Split to Multiple Pages

l

Text Search

l

Thumbnail

l

Tiff Tag

l

WPF Image

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

l

WPFScanning_CSHARP

Syntax int SNBDAPI CIMG_decompress_bitmap(String *filename); Remark Table 12.1: : CIMG_decompress_bitmap Function Variable

69

Variable

Description

filename

File or path/filename of the image to load

Chapter 12 - Image Decompression Functions

Returns Returns the status of the decompress bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_bitmap_display() This function is the same as CIMG_decompress_bitmap() except the image is displayed while being decompressed. The image is converted to a Windows DIB and stored in memory. The return value is an integer for referencing the image for most other functions such as display, print, rotate, and others. Note: This function is not recommended for 1-bit images. It decompresses and displays faster using the normal CIMG_decompress_bitmap() and CIMG_display_bitmap() functions. See CIMG_decompress_bitmap() and CIMG_display_bitmap() for more information. Syntax int SNBDAPI CIMG_decompress_bitmap_display(String *filename, Graphics* g, int xpos, int ypos, int width, int height, int aspect); Remark Table 12.2: CIMG_decompress_bitmap_display Function Variables Variable

Description

filename g xpos ypos width height

File or path/filename of the image to load. Graphics object. Starting X coordinate for display of image. Starting Y coordinate for display of image. Width for display of image. Height for display of image. 0 for no correction, 1 if you want the library to correct for aspect ratio. The original image proportions will be retained. This may make the height or width smaller than expected but never larger.

aspect

Returns Returns the status of the decompress bitmap display operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

70

Chapter 12 - Image Decompression Functions

CIMG_decompress_bitmap_fd() This function decompresses from a file handle returned from Windows OpenFile() or _ lopen(). The offset is usually set to 0, but may be any value for referencing images embedded within a larger file. Data is converted to a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_bitmap_fd(FileStream *filestream, int offset, int page); Remark Table 12.3: CIMG_decompress_bitmap_fd Function Variables Variable

Description

filestream offset

Handle returned from a Windows OpenFile() call Offset into file for embedded images, usually 0 Page number starting at 0 for decompressing multi-page files such as TIFF, DCX, or MODCA:IOCA

page Returns

Returns the status of the decompress file handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_bitmap_FlexSnap() This function decompresses from Snowbound’s FlexSnap server. Syntax int SNBDAPI CIMG_decompress_bitmap_FlexSnap(String *strServer, String *strFileName, int page); Remark Table 12.4: CIMG_decompress_bitmap_FlexSnap Function Variables

71

Variable

Description

strServer strFileName page

Server URL address The image file name to decompress The desired page number starting at zero

Chapter 12 - Image Decompression Functions

Returns Returns the status of the decompress bitmap FlexSnap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_bitmap_mem() This function decompresses from a memory pointer. Like all other decompress functions, the data is converted to a Windows DIB format in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

ASP Memory Copy

l

Memory Copy

l

FileMem

Note: It is best to allocate an extra 30K of memory for the image buffer passed into the function. Syntax int SNBDAPI CIMG_decompress_bitmap_mem(Array *data, int page); Remark Table 12.5: CIMG_decompress_bitmap_mem Function Variables Variable

Description

data

Memory Pointer to compressed image data Page number starting at 0 for decompressing multi-page image files

page Returns

Returns the status of the decompress bitmap memory operation. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes.

72

Chapter 12 - Image Decompression Functions

CIMG_decompress_bitmap_page() The function loads a compressed or uncompressed specific page of image file from disk. It converts the data to a Windows DIB format in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

ASP Multiple Pages

l

Batch_XPS_Convert

l

DocClean

l

Page

l

Scan

l

Split to Multiple Pages

l

Text Search

l

Thumbnail

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

l

WPFScanning_CSHARP

l

XPSMem_CSHARP

Syntax int SNBDAPI CIMG_decompress_bitmap_page(String *filename, int page); Remark Table 12.6: CIMG_decompress_bitmap_page Function Variables

73

Variable

Description

filename page

File path and name of the image to load. Desired page number starting at zero.

Chapter 12 - Image Decompression Functions

Returns Returns the status of the decompress bitmap page operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_bitmap_url() The function decompresses an image from a Uniform Resource Locator (URL) address. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMG_decompress_bitmap_url(String *strURL, int page); Remark Table 12.7: CIMG_decompress_bitmap_url Function Variables Variable

Description

strURL

The URL address that points to the image. The page number starting at 0 for decompressing multipage image files.

page

Example 12.1 CIMG_decompress_bitmap_url status = simage.CIMG_decompress_bitmap_url("http://www.snowbound.com/images/logo_top.gif", 0); status = simage.CIMG_decompress_bitmap_url("http://localhost/ images/test.pdf", 0);

Returns Returns the status of the decompress bitmap URL operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_bitmap_xps() The function decompresses an XPS file.

74

Chapter 12 - Image Decompression Functions

Note: This function is only available in the Visual Studio 2005 .NET library build with .NET Framework 3.0 support. Syntax int SNBDAPI CIMG_decompress_bitmap_xps(String *filename, int iPage); Remark Table 12.8: CIMG_decompress_bitmap_xps Function Variables Variable

Description

filename iPage

Path/filename of the XPS file The page index of the XPS document to render

Returns Returns the status of the decompress bitmap XPS operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_fax() This function decompresses fax or proprietary image formats which uses the CCITT G3 or G4 compression algorithms. The programmer opens the file with OpenFile() or _lopen() then reads any header information to get the height and width of the image (maybe fill order also). It then seeks the beginning of the compressed data. Call this function to decompress the data and convert it into a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_fax(FileStream *filestream, int xsize, int ysize, int type, int fill_order); Remark Table 12.9: CIMG_decompress_fax Function Variables

75

Variable

Description

filestream xsize ysize type fill_order

Handle returned from a Windows OpenFile()call Horizontal width of the image after decompression Vertical height of the image after decompression 2 for Group 3 2d images, 3 for Group 3, 4 for Group 4 fax Bit order in each byte, may be 0 or 2

Chapter 12 - Image Decompression Functions

Variable

Description 0 = Normally for CALS 2 = Normally for G3 and G4

Returns Returns the status of the decompress fax operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_fax_mem() This function decompresses fax or proprietary image formats which use the CCITT G3 or G4 compression algorithms. Using a memory pointer to the beginning of the compressed data, this function decompresses the data and converts it into a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_fax_mem(Array *data, int xsize, int ysize, int type, int fill_order); Remark Table 12.10: CIMG_decompress_fax_mem Function Variables Variable

Description

data xsize ysize

Pointer to image data in memory Horizontal width of the image after decompression Vertical height of the image after decompression 2 = for group 3 2d images 3 = for group 3 and 4 for Group 4 images Bit order in each byte, may be 0 or 2, normally: 2 for G3 and G4 0 for CALS

type fill_order

Returns Returns the status of the decompress fax memory operation. Any value less than zero is a Snowbound error codeSee Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_decompress_tiled_bitmap() This function decompresses the tiled image/pathname specified by the filename. The tiled image is completely decompressed and all tiles are assembled into one image. The normal CIMG_decompress_bitmap() decompresses each tile as a multi-page, unassembled file of tile images. Each tile is decompressed into a separate file.

76

Chapter 12 - Image Decompression Functions

To decompress a tiled image using CIMG_decompress_bitmap_fd(), treat each tile as if it were the next page of a multi-page image. See CIMG_decompress_bitmap() and CIMG_decompress_bitmap_fd()for more information. Syntax int SNBDAPI CIMG_decompress_tiled_bitmap(String *filename, int page); Remark Table 12.11: CIMG_decompress_tiled_bitmap Function Variables Variable

Description

filename page

Path/filename of tiled image to return information on Page number for multi-page files

Returns Returns the status of the decompress tiled bitmap operation. Any value less than zero is a Snowbound error code.See Appendix H, Snowbound Error Codes for a list of error codes.

77

Chapter 13 - Image Decompression Option Functions

Chapter 13 - Image Decompression Option Functions This chapter describes the RasterMaster .NET image decompression option functions.

CIMGLOW_set_auto_detect() This global function turns the automatic file type detection on for verifying the desired format. The data type CIMG_IMAGE_TYPE in .NET library includes all current image types defined in library. When we use .NET library, instead of giving the format number such as 59, use CIMG_ IMAGE_TYPE.pdf. For example: status = simage.CIMGLOW_set_auto_detect((int)CIMG_IMAGE_TYPE.ascii); Syntax int SNBDAPI CIMGLOW_set_auto_detect(int format); Remark Table 13.1: CIMGLOW_set_auto_detect Function Variable Variable

Description

format

Image format type from the defined list in imglib.h

Returns Returns the status of the set auto-detect operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_decomp_rect() This global function decompresses and holds in memory only the data contained in the specified cropping rectangle. Set this before any decompression calls are made. This stays in effect until it is reset to 0 for each parameter. 0 is the default.

78

Chapter 13 - Image Decompression Option Functions

Syntax int SNBDAPI CIMGLOW_set_decomp_rect(int x, int y, int width, int height); Remark Table 13.2: CIMGLOW_set_decomp_rect Function Variables Variable

Description

x y width height

Start of x cropping rectangle Start of y cropping rectangle Width of cropping rectangle Height of cropping rectangle

Returns Returns the status of the set decompressed rectangle operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_decomp_reduction() This global function forces color reduction at decompression. If this function is set to 8, for instance, all 24-bit images are reduced and stored in memory as 8-bit images. Syntax int SNBDAPI CIMGLOW_set_decomp_reduction(int bitsperpixel); Remark Table 13.3: CIMGLOW_set_decomp_reduction Function Variable Variable

Description

bitsperpixel

Pixel depth of bitmap to create

Returns Returns the status of the set decompressed reduction operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

79

Chapter 13 - Image Decompression Option Functions

CIMGLOW_set_decompsize() This global function forces all images to be scaled as they are decompressed. This is useful for creating icons. If the width and height are set to 100, the image in memory is scaled to 100 by 100 using much less memory. Syntax int SNBDAPI CIMGLOW_set_decompsize(int width, int height); Remark Table 13.4: CIMGLOW_set_decompsize Function Variables Variable

Description

width height

Width to decompress image Height to decompress image

Returns Returns the status of the set decompressed size operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_jpeg_decompression This global function gets the frequency components in JPEG images after the Huffman decompression. These values will also be de-quantized. They will replace the internal RGB data normally returned from decompressing a JPEG image. The components will be in the same order as the uncompressed image, except they will be 32bit integer values for each plane. Syntax int SNBDAPI CIMGLOW_set_jpeg_decompression(int mode); Remark Table 13.5: CIMGLOW_set_jpeg_decompression Function Variable Variable

Description

mode

0 = normal JPEG decompression 1 = returns the array of 8x8 blocks of frequency components

80

Chapter 13 - Image Decompression Option Functions

Returns Returns the status of the JPEG decompression. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_overlay_path() This global function sets the path for overlay files for PT:OCA images. The library searches this path for overlay files required by PT:OCA images. If you pass in a NULL parameter, it toggles between the two ways in which the overlay file is decompressed. For example, this function is used when you have a check overlay image file (the file has a check image on a larger white background). If a null parameter is entered, toggling occurs, which lets you retrieve just the check image itself without the extraneous white space. This way, you just get the check image. Calling this method again retrieves the original image. Note: Only used with certain overlay files. Syntax int SNBDAPI CIMGLOW_set_overlay_path(String *path); Returns Returns the status of overlay path. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_pdf_input() This global function converts PDF files into a raster image when being decompressed into RasterMaster .NET. This function allows the type of bitmap created to be specified. Note: PDF reading is an optional module available in the PDF plugin for Windows DLL and ActiveX products. Syntax int SNBDAPI CIMGLOW_set_pdf_input(int dpi, int bitsperpixel);

81

Chapter 13 - Image Decompression Option Functions

Remark Table 13.6: CIMGLOW_set_pdf_input Function Variables Variable dpi

bitsperpixel

Description Controls the width and height of the file. Set to 200 or 300 for black and white images. Set to 100 or 200 for color images. Allows importing color or black and white images. 1 = black and white documents 24 = color images

Returns Returns the status of PDF input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_pdf_password() This function allows passing a password string to allow for decompressing PDF files that are password protected. Make this call before calling any of the RasterMaster decompress calls such as CIMG_decompress_bitmap(). Syntax int SNBDAPI CIMGLOW_set_pdf_password(String *filename); Remark Table 13.7: CIMGLOW_set_pdf_password Function Variables Variable

Description

filename

String represented password to use to open a password protecting PDF file.

Returns Returns the status of PDF password. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

82

Chapter 13 - Image Decompression Option Functions

CIMGLOW_unset_auto_detect() This global function turns the automatic file type detection off for the desired format. This file type is then no longer decompressed by the library. Syntax int SNBDAPI CIMGLOW_unset_auto_detect(int format); Remark Table 13.8: CIMGLOW_unset_auto_detect Function Variable Variable

Description

format

Image format type from the defined list in imglib.h

Returns Returns the status of the unset auto-detection operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

83

Chapter 14 - Image Creation Functions

Chapter 14 - Image Creation Functions This chapter describes the RasterMaster .NET image creation functions.

CIMG_create_bitmap_class() This function creates a bitmap object from the Snowbound object. Syntax Bitmap* CIMG_bitmap_class(int width, int height); Remark Table 14.1: CIMG_create_bitmap_class Function Variable Variable

Description

width height

Width of the bitmap object Height of the bitmap object

Returns Returns the status of the create bitmap object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_create_handle() This function imports a Windows DIB created externally from the library. This function makes a copy of the image DIB and does not alter or delete the lpbih or the DIB data passed in. Syntax int SNBDAPI CIMG_create_handle(int width, int height, int bitsperpixel); Remark Table 14.2: CIMG_create_handle Function Variable Variable

Description

width height bitsperpixel

Width of the handle Height of the handle Pixel depth of bitmap to create

84

Chapter 14 - Image Creation Functions

Returns Returns the status of the create handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_create_handle_ddb() This function allows importing of an old-style Windows HBITMAP or Device Dependent Bitmap (DDB). This does not alter the original bitmap, but simply copies and converts the data to the library’s internal DIB format. Syntax int SNBDAPI CIMG_create_handle_ddb(Graphics *g, Bitmap* pBitmap, IntPtr hpal); Remark Table 14.3: CIMG_create_handle_ddb Function Variables Variable

Description

g Bitmap hpal

Graphics object GDI + Bitmap object Windows palette for the bitmap image

Returns Returns the graphics object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_create_handle_keep() This function imports a Windows DIB created externally from the library. It returns a standard image handle for displaying, saving, or printing. Note: This function does not make a copy of the image DIB; it uses the pointer and data directly. After a call to this function, do not delete the lpbih pointer or alter it in any way. Syntax int SNBDAPI CIMG_create_handle_keep(CDIB_HEADER *dib_header); Remark Table 14.4: CIMG_create_handle_keep Function Variable

85

Chapter 14 - Image Creation Functions

Variable

Description

dib_header

Pointer to a CDIB_HEADER structure that contains the image header. For more information, see public class CDIB_HEADER.

Returns Returns the status of the keep image handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

86

Chapter 15 - HTML Functions

Chapter 15 - HTML Functions This chapter describes the HTML functions available in the current version of RasterMaster .NET. Note: The HTML plugin option requires .NET 4.0

CIMGLOW_set_html_input() This function sets parameters for HTML rendering. Syntax int SNBDAPI CIMGLOW_set_html_input(int print_dpi, int bits_pix); Remarks Table 15.1: CIMGLOW_set_html_input function variable descriptions.

Variable print_dpi bits_pix

Description Used for rendering purposes. The default value is 200.0. Sets the bits per pixel. Only 1, 24, and 32 are supported. The default value is 24.

Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_page_size() This function sets the page size in pixels for screen size purposes. These values are just a suggestion and will probably be over-written to more appropriate values during program execution. The measurement units are in inches. Syntax int SNBDAPI CIMGLOW_set_html_page_size(float w, float h); Remarks Table 15.2: CIMGLOW_set_html_page_size function variable descriptions .

87

Chapter 15 - HTML Functions

Variable w h

Description Sets the width. The default value is 8.5. Sets the height. The default vaule is 11.0.

Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes.

Functions Available in RasterMaster .NET V18.1 and Earlier The functions in this section are available in RasterMaster .NET V18.1 and any releases previous to V18.1.

CIMGLOW_set_html_capabilities() This function sets various parameters for the HTML renderer: Enables or disables image capabilities for the HTML renderer. Enables or disables JavaScript capabilities for the HTML renderer. Enables or disables the use of the page size ratio capability of the HTML document. Enables or disables the exclusive use of print page breaks to signal page boundaries. Sets the ratio of the width to the height of the pages extracted from the HTML document. Note: The new version of our HTML renderer engine has JavaScript and image downloading enabled by default. Malicious JavaScript code and maliciously constructed embedded images may compromise the security of the host computer. Please use these features with caution. Syntax int SNBDAPI CIMGLOW_set_html_capabilities(int isImageEnabled, int isJavascriptEnabled, int isRatioEnabled, int isPageBreaksExclusive, Double dRatio);

Remarks Table 15.3: CIMGLOW_set_html_capabilities Function Variables

88

Chapter 15 - HTML Functions

Variable isImageEnabled

isJavascriptEnabled

isRatioEnabled

isPageBreaksExclusive

dRatio

Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Sets the width/height ratio. The default value is 8.5/11.0. (i.e. US LETTER portrait-mode). Note: The ratio value is not set if the isRatioEnabled value is disabled.

Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_home_dir() This function sets the home directory for the HTML renderer. Syntax int SNBDAPI CIMGLOW_set_html_home_dir(String dir); Remarks Table 15.4: CIMGLOW_set_html_home_dir function variable descriptions.

Variable dir

Description This value does not support double-byte characters (i.e. ASCII only).

Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

89

Chapter 15 - HTML Functions

CIMGLOW_set_html_image_capability() This function enables or disables image downloading and image loading capabilities for the HTML renderer. Note: The new version of our HTML renderer engine has JavaScript and image downloading enabled by default. Malicious JavaScript code and maliciously constructed embedded images may compromise the security of the host computer. Please use these features with caution. Syntax int SNBDAPI CIMGLOW_set_html_image_capability(int isEnabled); Remarks Table 15.5: CIMGLOW_set_html_image_capability function variable descriptions.

Variable isEnabled

Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1.

Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_javascript_capability() This function enables or disables JavaScript capabilities for the HTML renderer. Notes: The new version of our HTML renderer engine has JavaScript and image downloading enabled by default. Malicious JavaScript code and maliciously constructed embedded images may compromise the security of the host computer. Please use these features with caution. JavaScript is interpreted differently with each web browser. In particular, our new renderer engine does not support all Microsoft Internet Explorer-only functions. Syntax int SNBDAPI CIMGLOW_set_html_javascript_capability(int isEnabled);

90

Chapter 15 - HTML Functions

Remarks Table 15.6: CIMGLOW_set_html_javascript_capability function variable descriptions. Variable isEnabled

Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1.

Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_page_size_ratio() This function sets the ratio of the width to the height of the pages extracted from the HTML document. Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio(int ratio); Remarks Table 15.7: CIMGLOW_set_html_page_size_ratio function variable descriptions . Variable

Description Sets the width/height ratio. The default value is 8.5/11.0. (i.e. US LETTER portrait-mode).

ratio Note: The value is ignored if the page size ratio capability is disabled. Returns Returns the status of the Snowbound error code. A value of 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_page_size_ratio_capability() This function enables or disables the use of the page size ratio capability of the HTML document by forcing a page size ratio capability in the HTMLdocument. Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio_capability(int isEnabled);

91

Chapter 15 - HTML Functions

Remarks Table 15.8: CIMGLOW_set_html_page_size_ratio_capability function variable descriptions . Variable isEnabled

Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1.

Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_screen_dpi() This function sets the screen DPI used for layout purposes. Syntax int SNBDAPI CIMGLOW_set_html_screen_dpi(Double screen_dpi); Remarks Table 15.9: CIMGLOW_set_html_screen_dpi function variable descriptions . Variable

Description Set the screen DPI. The default value is 94.0.

screen_dpi

Note: The value is ignored if the pixel width is set to anything but zero (0).

Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_use_page_breaks_exclusively()

CIMGLOW_set_html_use_page_breaks_exclusively() This function enables or disables the ability to force the exclusive use of print page breaks to signal page boundaries. Syntax int SNBDAPI CIMGLOW_set_html_use_page_breaks_exclusively(int isEnabled);

92

Chapter 15 - HTML Functions

Remarks Table 15.10: CIMGLOW_set_html_use_page_breaks_exclusively function variable descriptions. Variable

Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1.

isEnabled Note: This variable is only to be used in specific cases where print page breaks tags are used. Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_html_utf_bom()  This function forces this Unicode Byte-Order-Mark (BOM) to all HTML data read by RasterMaster .NET. The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. Its code point is U+FEFF. BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in. Since Unicode can be encoded as 16-bit or 32-bit integers, a computer receiving Unicode text from arbitrary sources needs to know which byte order the integers are encoded in. The BOM gives the producer of the text a way to describe the text stream's endianness to the consumer of the text without requiring some contract or metadata outside of the text stream itself. Once the receiving computer has consumed the text stream, it presumably processes the characters in its own native byte order and no longer needs the BOM. Hence the need for a BOM arises in the context of text interchange, rather than in normal text processing within a closed environment. Syntax int SNBDAPI CIMGLOW_set_html_utf_bom(int utf_bom); Remarks Table 15.11: CIMGLOW_set_html_utf_bom Function Variables Variable

Description

utf_bom

May be set to one of the following values as defined in imglib.h: Please see Table 17-12 for byte order marks by encoding.

93

Chapter 15 - HTML Functions

Variable

Description NOT_UNICODE

0

UTF_8

1

UTF_16BE

2

UTF_16LE

3

UTF_32BE

4

UTF_32LE

5

UTF_7

6

UTF_1

7

UTF_EBCDIC

8

SCSU

9

BOCU_1

10

B_17030

11

Table 15.12: Representations of byte order marks by encoding

Encoding

Representation

Representation

Representation

(hexadecimal)

(decimal)

(ISO-8859-1)

 1

UTF_8

EF BB BF

239 177 191



UTF_16BE

FE FF

254 255

þÿ

UTF_16LE

FF FE

255 254

ÿþ

UTF_32BE

00 00 FE FF

0 0 254 255

FF FE 00 00

255 254 0 0

2B 2F 76, and one of

43 47 117, and one of the

the following:

following:

[ 38 | 39 | 2B | 2F ]

[56 | 57 | 43 | 47 ]

F7 64 4C

247 100 76

÷dL

221 115 102 115

Ýsfs

14 254 255

?þÿ (? is the ascii "shift out"

UTF_32LE

UTF_7

UTF_1

2

UTF_EBCDIC DD 73 66 73 SCSU

94

0E FE FF3

??þÿ (? is the ascii null character) ÿþ?? (? is the ascii null character) +/v, and one of the following: 89+/

Chapter 15 - HTML Functions

Encoding

Representation

Representation

Representation

(hexadecimal)

(decimal)

(ISO-8859-1) character)

FB EE 28 optionally BOCU_1

GB_17030

4

251 238 40 optionally fol-

followed by FF

lowed by 255

84 31 95 33

132 49 149 51

ûî( optionally followed by ÿ □1■3 (□ and ■ are unmapped ISO-8859-1 characters)

1

While identifying text as UTF-8, this is not really a "byte order" mark. Since the byte is also the word in UTF-8, there is no byte order to resolve. 2

In UTF-7, the fourth byte of the BOM, before encoding as base64, is 001111xx in binary, and xx depends on the next character (the first character after the BOM). Hence, technically, the fourth byte is not purely a part of the BOM, but also contains information about the next (nonBOM) character. For xx=00, 01, 10, 11, this byte is, respectively, 38, 39, 2B, or 2F when encoded as base64. If no following character is encoded, 38 is used for the fourth byte and the following byte is 2D. 3

SCSU allows other encodings of U+FEFF, the shown form is the signature recommended in UTR #6. 4

For BOCU-1 a signature changes the state of the decoder. Octet 0xFF resets the decoder to the initial state. Returns Returns the status of the Snowbound error code or the current BOM the system will use. See Appendix H, Snowbound Error Codes for a list of error codes.

95

Chapter 16 - Open Office 2007 XML (OOXML) Functions

Chapter 16 - Open Office 2007 XML (OOXML) Functions This chapter describes the RasterMaster .NET Office Open XML (OOXML) format functions. RasterMaster .NET Microsoft Office plugin supports the seamless conversion of Word 2007 and Excel 2007 documents which use the OOXML format. These documents are frequently stored with the file extension .docx/.xlsx. The CIMG_decompress_bitmap() function will automatically detect OOXML format documents and process them when the DOCX library file has been installed and registered with RasterMaster .NET. If the Office2010 option evaluation license is not found by RasterMaster .NET, the system will return the error code DLL_NOT_LOADED (-24).

CIMGLOW_set_ooxml_license() This function loads the OOXML license file. Note: Please use CIMGLOW_ooxml_license_enable() to enable the license file. CIMGLOW_ license_enable() only needs to be called once to cover all of the Office types: Word, Excel, and PPT. Syntax int CIMGLOW_set_ooxml_license(String licenseFile); Remark Table 16.1: CIMGLOW_set_ooxml_license function variable descriptions. Variable

Description File name of the license file. For example:

licenseFile c:\\temp\\license.txt Returns Returns the last error encountered while loading the products. The error returned will be for the last product that was loaded. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_ooxml_license_enable() This function simplifies Office2010 option evaluation licensing by setting the license path.

96

Chapter 16 - Open Office 2007 XML (OOXML) Functions

Syntax int CIMGLOW_ooxml_license_enable(char* licensePath, int nPathLength); Remark Table 16.2: CIMGLOW_ooxml_license_enable Function Variable Variable licensePath

Description Buffer to receive path name of folder containing the license file or NULL if no licenses found. This buffer must be allocated by calling application.

Returns Returns the status of the Snowbound error code. If no license file is found, returns -52, OOXML_LICENSE_NOT_FOUND. If a license is found but is invalid, returns -53, OOXML_ LICENSE_EXPIRED. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

97

Chapter 17 - Image Saving Functions

Chapter 17 - Image Saving Functions This chapter describes RasterMaster .NET image saving functions.

CIMG_save_bitmap() This function saves an image to disk in any format desired. It supports unicode file name input. You can save images as black and white, grayscale or color by specifying the appropriate bit depth and choosing an output format that supports that bit depth. See Chapter 30, Color Promotion Functions and Chapter 31, Color Reduction Functions for more information on changing the color and bit-depth of an image. See the Supported Bit Depths for Image Formats in Appendix B, Supported File Formatfor details on what bit-depths are available for each format. One way to decrease the output file size is to use CIMGLOW_set_document_input to specify a lower DPI before opening the input file with CIMG_decompress_bitmap. When saving to a JPEG file format, you can decrease the file size by decreasing the quality level of the compression using the CIMGLOW_set_comp_quality method. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

ASP Conversion

l

ASP Memory Copy

l

Batch_XPS_Convert

l

Conversion

l

Convert_Doc

l

Encryption

l

Merge Image

l

Scan

l

Split to Multiple Pages

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

98

Chapter 17 - Image Saving Functions

l

WPFScanning_CSHARP

l

XPSMem_CSHARP

Note: If the type is -1, the library looks at the file extension for determining the output file type. Syntax int SNBDAPI CIMG_save_bitmap(String *filename, int format); Remark Table 17.1: CIMG_save_bitmap Function Variables Variable

Description

filename

File or path/filename for output image See Appendix B, Supported File Format for all image types allowed and all files shipped with the product

format Returns

Returns the status of the save bitmap operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_save_bitmap_fd() This function saves an image to disk in any desired format. This allows saving anywhere into an open file handle for embedded images. After calling OpenFile, the programmer may seek any position in the file. This save function begins writing compressed data in the format specified by type at this location. Note: If the type is -1, the library looks at the file extension for determining the output file type. Syntax int SNBDAPI CIMG_save_bitmap_fd(FileStream *filestream, int format); Remark Table 17.2: CIMG_save_bitmap_fd Function Variables

99

Chapter 17 - Image Saving Functions

Variable

Description

filestream

Windows file handle obtained from OpenFile or _lopen See Appendix B, Supported File Format for all image types allowed

format Returns

Returns the status of the save bitmap file handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_save_bitmap_mem() This function saves an image to a memory pointer in the format specified by the file type. After calling GlobalAlloc() and GlobalLock(), the programmer sends the pointer to the saving function. This function operates on only one page at a time. For multi-page saving, please use CIMG_save_bitmap(). The total size of the compressed image is returned in bytes. If using the same pointer more than once, it is suggested that you clear the first 10 bytes to zero to avoid the library presuming the memory location already contains an image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

ASP Memory Copy

l

Memory Copy

Syntax long SNBDAPI CIMG_save_bitmap_mem(Array *data, int format); Remark Table 17.3: CIMG_save_bitmap_mem Function Variables Variable

Description

data

Windows memory pointer already allocated See Appendix B, Supported File Format for all image types allowed

format Returns

Returns the total size of the compressed image. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

100

Chapter 17 - Image Saving Functions

CIMGLOW_write_tiff_stream() The function creates a TIFF file directly from raw or compressed data. This is best used when receiving raw data (no header information) directly from a scanner or other input device. Syntax int SNBDAPI CIMGLOW_write_tiff_stream(CDIB_HEADER *dib_header, Array *arrData, int data_size, int file_type, String *strFileName); Remark Table 17.4: CIMGLOW_write_tiff_stream Function Variables Variable dib_header arrData data_size file_type strFileName

Description Pointer to a CDIB_HEADER structure contains the image header. For more information, see public class CDIB_ HEADER. Data to write out Size of data stream in bytes TIFF file type to write Output file name

Returns Returns the status of the TIFF stream. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

101

Chapter 18 - Image Saving Option Functions

Chapter 18 - Image Saving Option Functions This chapter describes the RasterMaster .NET image saving option functions.

CIMG_set_encrypt() This global function allows encrypting images while saving. The key passed in by the function is the encryption key. The same key must be used before the image is read. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Encryption sample. Note: The key need only be set once for each instance of the program. Syntax int SNBDAPI CIMG_set_encrypt(int on_off, int key); Remark Table 18.1: CIMG_set_encrypt Function Variables Variable

Description

on_off key

Turns encryption on or off for an image at save A long user defined key for encryption

Returns Returns the set encryption. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_comp_quality() This function sets the compression ratio to quality factor to use when saving JPEG images. This is a global setting and affects all threads. The default value is 70. This is a write only setting. There is no get method.

102

Chapter 18 - Image Saving Option Functions

Syntax int SNBDAPI CIMGLOW_set_comp_quality(int quality); Remark Table 18.2: CIMGLOW_set_comp_quality Function Variable Variable

Description

quality

Integer between 1 - 100 1 = Smallest file size but least quality 100 = Best image quality and largest file size

Returns Returns the set compression ratio. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_image_orientation() This global function sets the orientation for CALS or TIFF images. It orients the image in 45 degree increments. Syntax int SNBDAPI CIMGLOW_set_image_orientation(int orient); Remark Table 18.3: CIMGLOW_set_image_orientation Function Variable Variable

Description

orient

Integer value between 0 and 8

Returns Returns the status of the image orientation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

103

Chapter 18 - Image Saving Option Functions

CIMGLOW_set_jpeg2000_comp_ratio() This global function specifies the amount of compression when saving a JPEG2000 file. The value is the ratio of the output file size to the original uncompressed file size. Note: JPEG2000 is available as an optional add on to the Windows DLL and ActiveX product. Syntax int SNBDAPI CIMGLOW_set_jpeg2000_comp_ratio(int ratio); Remark Table 18.4: CIMGLOW_set_jpeg2000_comp_ratio Function Variable Variable

Description

ratio

Compression ratio of JPEG2000 output file

Returns Returns the status of the JPEG2000 compression ratio. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_jpg_interleave() This global function sets values for blue and red chroma decimation. This function should be used before saving images to JPEG format. A value of 2 for h and 2 for v will skip every other chroma pixel horizontally and vertically. This may give better compression results for saving images as JPEG. The default is 2:1, though the best quality will be at 1:1. Developers should experiment with a value, to determine which will give the best image compression while maintaining acceptable quality. Syntax int SNBDAPI CIMGLOW_set_jpg_interleave(int h_int, int v_int); Remark Table 18.5: CIMGLOW_set_jpg_interleave Function Variables

104

Chapter 18 - Image Saving Option Functions

Variable

Description

h_int v_int

Horizontal interleaving factor Vertical interleaving factor

Returns Returns the status of the JPEG interleave factor. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_pdf_output() This global function sets the destination size for saving PDF files. The xsize and ysize are the output sizes in points. A point is 1/72 of an inch. Only PDF, PCL, and AFP file formats can be saved. The PCL and APF file formats are saved as bitmap. The PDF file format can be saved as bitmap or searchable text.. Syntax int SNBDAPI CIMGLOW_set_pdf_output(double width, double height); Remark Table 18.6: CIMGLOW_set_pdf_output Function Variables Variable

Description

double width double height

Width of image in points Height of image in points

Returns Returns the status of PDF output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_tiff_save_strips This global function saves data in strips, which is known as ‘stripped TIFFs’, when saving to TIFF file formats with the following compression types:

105

l

Uncompressed

l

LZW

l

Packbits

l

Group 4

Chapter 18 - Image Saving Option Functions

This breaks up the data into smaller segments instead of all lines of the image being saved in the same offset. Syntax int SNBDAPI CIMGLOW_set_tiff_save_strips(int on_off); Remark Table 18.7: CIMGLOW_set_tiff_save_strips Function Variable Variable

Description

on_off

0 = Off 1 = On

Returns Returns the status of stripped TIFFs. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_tiff_tag() This global function writes new tags as well as all current tags. This function can be called multiple times for adding multiple tags. Note: If you read in a TIFF file, RasterMaster .NET does not save any of the tags. None of the tag data is saved except for the needed data such as bits per pix, height, and DPI. This is saved in the LPBITMAPINFOHEADER struct in RasterMaster .NET's internal format. Any other tags are not preserved. You could read in the tags and data you need from a source TIFF, then set new tags and data before saving. Setting the tag ID to -1 clears out all extra tags from being written to the file. It stores the previous values between calls. Then, set new tag values as shown in the following example: Simage.CIMGLOW_set_tiff_tag(-1,0,0,null);

Syntax int SNBDAPI CIMGLOW_set_tiff_tag(CTIFF_TAG *tag); Remark Table 18.8: CIMGLOW_set_tiff_tag Function Variable

106

Chapter 18 - Image Saving Option Functions Variable

Description

tag

ID of tag to write. For more information, see public clas CTIFF_TAG

Returns Returns the status of TIFF tags. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

107

Chapter 19 - Image Display Functions

Chapter 19 - Image Display Functions This chapter describes the RasterMaster .NET image display functions.

bool repaintBackground() This function predetermines if the background needs to be repainted. Syntax bool repaintBackground(double zoom, int type); Remark Table 19.1: bool repaintBackground Variables Variable double zoom type

Description Zoom factor: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag

Returns Returns the status of the background. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_display_bitmap() This function is a standard image display routine. This function detects the video display adapter and may reduce the number of colors in the image when displaying, such as when displaying a 24-bit image on a 256 color display adapter. If display quality is poor, try some of the color reduction functions such as, CIMG_mediancut_color()or CIMG_bayer_color(). See CIMG_mediancut_color() and CIMG_bayer_color() for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Animate

108

Chapter 19 - Image Display Functions

l

Contrast

l

Conversion

l

Convert_Doc

l

DDB Effect

l

FileMem

l

Image Processing

l

Memory Copy

l

Page

l

Panning

l

Print

l

Scan

l

Split to Multiple Pages

l

Text Search

l

Thumbnail

l

Tiff Tag

Syntax int SNBDAPI CIMG_display_bitmap(Graphics *g, int x, int y, int width, int height); Remark Table 19.2: CIMG_display_bitmap Function Variables Variable

Description

g x y width height

Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image

109

Chapter 19 - Image Display Functions

Returns Returns the status of the display bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_display_bitmap_aspect() This function is an image display routine with corrected aspect ratio. After displaying the image, it turns scrollbars on or off for correct scrolling. A zoom factor of 100 displays the image with a one to one pixel ratio. A zoom of 0 fits the image horizontally or vertically into the window. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Alpha

l

ASP Image View

l

Web Image Viewer Component

Syntax int SNBDAPI CIMG_display_bitmap_aspect(Control *panel, Graphics *g, CIMG_RECT *view, double zoom, int type); Remark Table 19.3: CIMG_display_bitmap_aspect Variables Variable

Description

panel g view

Standard .NET control Graphics object Display area of interest Zoom factor: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag

double zoom type Returns

Returns the status of the display bitmap aspect operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

110

Chapter 19 - Image Display Functions

CIMG_display_bitmap_transp() This function displays transparent GIF images. It only draws the foreground color when displaying, not the background color. This function compares each pixel to the background color passed in and does not draw foreground pixels that are identical. To get the background color from an image, use the CIMGLOW_ get_transp_color()function. See CIMGLOW_get_transp_color() for more information. Syntax int SNBDAPI CIMG_display_bitmap_transp(Graphics *g, int xpos, int ypos, int width, int height, int tcolor); Remark Table 19.4: CIMG_display_bitmap_transp Function Variables Variable

Description

g xpos ypos width height tcolor

Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image Background color of image to ignore

Returns Returns the status of the display bitmap tranparent GIF operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_display_ddb() This function displays a DDB obtained from CIMG_dib_to_ddb() or any other DDB desired. This may display 4 and 8-bit images faster on some display adapters. See CIMG_dib_to_ddb() for more information. Syntax int SNBDAPI CIMG_display_ddb(bitmap* pBitmap, Graphics *g, int xpos, int ypos); Remark Table 19.5: CIMG_display_ddb Function Variables

111

Chapter 19 - Image Display Functions

Variable

Description

Bitmap g xpos ypos

GDI + Bitmap object Graphics object Starting X position to display image Starting Y position to display image

Returns Returns the status of the device dependent bitmap (DDB) display operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 19.1 CIMG_display_ddb C#:Bitmap Bmp = simage.CIMG_create_bitmap_class(picDisplay.Width, picDisplay.Height); simage.CIMG_display_ddb(bmp,e.Graphics,0,0);

CIMG_display_fit_to_height() This function displays the full height of the image vertically scaling it to fit. It crops the image horizontally for aspect ratio correction and enables the scroll bars. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Animate

l

Merge Image

Syntax int SNBDAPI CIMG_display_fit_to_height(Graphics *g, Control *win_ control, int xs, int ys, int width, int height); Remark Table 19.6: CIMG_display_fit_to_height Function Variables Variable

Description

g win_control xs ys

Graphics object Window form control object X starting position to display Y starting position to display

112

Chapter 19 - Image Display Functions

Variable

Description

width height

width to display height to display

Returns Returns the status of the display fit to height operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_display_fit_to_width() This function displays the full width of the image horizontally scaling it to fit. It crops the image vertically for aspect ratio correction and enables the scroll bars. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Animate sample. Syntax int SNBDAPI CIMG_display_fit_to_width(Graphics *g, Control *win_control, int xs, int ys, int width, int height); Remark Table 19.7: CIMG_display_fit_to_width Function Variables Variable

Description

g win_control xs ys width height

Graphics object Window form control object X starting position to display Y starting position to display width to display height to display

Returns Returns the status of the display fit to width operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_set_croprect() This function sets the current crop rectangle. After decompression the default cropping rectangle is the entire size of the image.

113

Chapter 19 - Image Display Functions

You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Panning sample. Note: The cropping rectangle size cannot be bigger than the height or the width of the image. Syntax int SNBDAPI CIMG_set_croprect(CIMG_RECT *rect); Remark Table 19.8: CIMG_set_croprect Function Variables Variable

Description

rect

Rectangle to set new size to crop. For more information, see public class CIMG_RECT.

Returns Returns the current crop rectangle for the image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_set_croprect_scroll() This function sets the cropping rectangle for the image. It also turns on or off the scrollbars to enable scrolling. If aspect is set to 1, the aspect ratio is corrected. This slightly changes the cropping rectangle in the X or Y direction. Syntax int SNBDAPI CIMG_set_croprect_scroll(Control *win_control, int xpos, int ypos, int scr_width, int scr_height, int aspect); Remark Table 19.9: CIMG_set_croprect_scroll Function Variables Variable

Description

win_control xpos ypos scr_width

Window form control object Starting X coordinate for cropping rectangle Starting Y coordinate for cropping rectangle Width of cropping rectangle

114

Chapter 19 - Image Display Functions

Variable

Description

scr_height

Height of cropping rectangle 1 or True = aspect ratio on 0 = aspect ratio off

aspect Returns

Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_zoom_bitmap() This function is the standard library zoom function. A zoom value of 100 tells the function to display the whole image at the coordinates in the CIMG_display_bitmap() call. Any value greater than 100 crops the image so it is not fully displayed in the current window. Syntax int SNBDAPI CIMG_zoom_bitmap(Control *win_ctrl, int zoom_factor); Remark Table 19.10: CIMG_zoom_bitmap Function Variables Variable

Description

win_ctrl zoom_factor

Window form control object. Amount to zoom.

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_zoom_bitmap_1_to_1() This function is used to display images with a one-to-one pixel correspondence. A zoom value of 100 tells the function to display each pixel of the image for one pixel on the screen. int SNBDAPI CIMG_zoom_bitmap_1_to_1(Control *win_control, int zoom_ level, int center_flag); Remark Table 19.11: CIMG_zoom_bitmap_1_to_1 Function Variables Variable

Description

win_control

Window form control object.

115

Chapter 19 - Image Display Functions

Variable

Description

zoom_level center_flag

Amount to zoom. Re-centers image if set to 1.

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_zoom_bitmap_rect() This function is most effective for resizing a window. Call after the zoom event has been processed when repainting the image with CIMG_display_bitmap(). The scaled image coordinates and size are returned for your use. A CIMG_RECT is the same as a Rect, except the elements of the structure are long, not short. Syntax int SNBDAPI CIMG_zoom_bitmap_rect(Control *win_control, CIMG_RECT *pRTZoom, CIMG_RECT *pRTClient, int mode); Remark Table 19.12: CIMG_zoom_bitmap_rect Function Variables Variable

Description

win_control pRTZoom

Window form control object CIMG_RECT structure, rectangle in image to zoom Using image or screen coordinates 0 = Screen Coordinates 1 = Image Coordinates

mode

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_map_image_to_wnd() This function translates the image coordinates passed in to reflect the window coordinates for the displayed image. It takes into account scaling and cropping of the image on screen. Syntax int SNBDAPI CIMGLOW_map_image_to_wnd(Control *win_control, Int *px, Int *py);

116

Chapter 19 - Image Display Functions

Remark Table 19.13: CIMGLOW_map_image_to_wnd Function Variables Variable

Description

win_control px py

Window form control object Pointer to an integer of an X coordinate to convert Pointer to an integer of a Y coordinate to convert

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_map_wnd_to_image() This function translates window coordinates to image coordinates for the displayed image. This is useful for passing coordinates to the crop functions. Use CIMG_set_croprect_scroll () to display an area of the image and enable scrolling. See CIMG_set_croprect_scroll() for more information. Syntax int SNBDAPI CIMGLOW_map_wnd_to_image(Control *win_control, int *px, int *py); Remark Table 19.14: CIMGLOW_map_wnd_to_image Function Variables Variable

Description

win_control px py

Window form control object Pointer to an integer of an X coordinate to convert Pointer to an integer of a Y coordinate to convert

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

double calcAspectZoom() This function allows you to retrieve the ASPECT_ZOOM value for each of the aspect type properties.

117

Chapter 19 - Image Display Functions

Syntax double calcAspectZoom(CIMG_RECT *view, double zoom, int type); Remark Table 19.15: double calcAspectZoom Variables Variable

Description

view

The display area of interest Zoom factor: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag. Returns the zoom value as an ASPECT_ZOOM.

double zoom type

Example 19.2 double calcAspectZoom snowPanel1.Type = ZOOM_TYPE.ASPECT_DEFAULT; snowPanel1.Zoom = 0; CIMG_display_bitmap_aspect(?,?,?,?,?,snowPanel1.Zoom,snowPanel1.Type); EQUALS: CIMG_RECT view = new CIMG_RECT(snowPanel1.Left,snowPanel1.Top,snowPanel1.Right,snowPanel1. Bottom); double aspectzoom = snowPanel1.calcAspectZoom(view,snowPanel1.Zoom,snowPanel1.Type); CIMG_display_bitmap_aspect(?,?,?,?,?,aspectzoom,ZOOM_ TYPE.ASPECT_ZOOM)

Returns Returns the ASPECT_ZOOM value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

removeScrollbars() This function removes scrollbars from the given control.

118

Chapter 19 - Image Display Functions

Syntax int SNBDAPI RemoveScrollbars(Control *panel); Remark Table 19.16: RemoveScrollbars Variables Variable

Description

panel

Standard .NET control

Returns Returns the standard .NET control. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

119

Chapter 20 - Image Display Option Functions

Chapter 20 - Image Display Option Functions This chapter describes the RasterMaster .NET image display option functions.

CIMG_animate() This function draws all frames of the animated GIF file passed in as bm_name once. Call this function repetitively for continuous display. Use the delay time in the image for proper frame synchronization. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Animate sample. Syntax int SNBDAPI CIMG_animate(Graphics *g, String *bm_name, int xs, int ys, int xsize, int ysize); Remark Table 20.1: CIMG_animate Function Variables Variable

Description

g bm_name xs ys xsize ysize

Graphics object Animated GIF filename to use Starting x position to draw Starting y position to draw X size of image drawing rectangle Y size of image drawing rectangle

Returns Returns the status of the animate operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_bitmap_palette() This function loads the palette from the image into the video adapter’s lut. 4 and 8-bit images have palettes associated with them. For best display quality, the video adapter’s lut or video dac must be loaded with this palette.

120

Chapter 20 - Image Display Option Functions

For a 24-bit image displaying on a 256-color adapter, it loads a special rainbow palette which the library creates internally. For 1-bit images with aliasing set to SCALE_TO_GRAY, it loads a 256 gray scale palette. Syntax int SNBDAPI CIMG_bitmap_palette(Graphics *g); Remark Table 20.2: CIMG_bitmap_palette Function Variable Variable

Description

g

Graphics object

Returns Returns the status of the bitmap palette operation. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

CIMG_display_ddb_effect() This function displays the image with the desired effect. These display effects are also referred to as wipes. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DDB Effect sample. Syntax int SNBDAPI CIMG_display_ddb_effect(Graphics *g, int xpos, int ypos, int width, int height, int effect); Remark Table 20.3: CIMG_display_ddb_effect Function Variables Variable

Description

g xpos ypos width height

Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Width of desired image to display Height of desired image to display Display the following effect:

effect

1 - (Default) Displays image with no image effects 2 - Displays image from the bottom to the top of the Win-

121

Chapter 20 - Image Display Option Functions

Variable

Description dow 3 - Displays image in the Window from the right to the left side in vertical lines 4 - Displays image in the Window from the left to the right side using vertical lines 5 - Displays image in the Window in a window horizontal blind fashion 6 - Displays image in the Window as staggered blocks 7 - Displays image in the Window as blocks from the center of the Window 8 - Displays image in the Window in a window vertical blind fashion 9 - Displays image in the Window as small blocks from the center of the Window 10 - Displays image in the Window as blocks in a zigzag pattern

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_set_gamma() This function corrects for the gamma or response curve of the monitor. The default is 100. This drastically improves the quality of gray scale or 24-bit images. Syntax int SNBDAPI CIMG_set_gamma(int gamma); Remark Table 20.4: CIMG_set_gamma Function Variable Variable

Description

gamma

Integer ranging from 0 to 200

Returns Returns the status of the set gamma operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of

122

Chapter 20 - Image Display Option Functions

error codes.

CIMG_set_lut() This function changes the contrast or brightness of the image. Positive values add contrast or brightness to the image while negative values darken or decrease the contrast of the image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Contrast sample. Syntax int SNBDAPI CIMG_set_lut(int contrast, int brightness); Remark Table 20.5: CIMG_set_lut Function Variables Variable

Description

contrast brightness

Integer value from -127 to 127 Integer value from -127 to 127

Returns Returns the status of the set look up table operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_window_level() This function turns window-leveling on or off for 16 or 8-bit gray scale images. Window-leveling remaps pixel values to increase or decrease the dynamic range of gray values. Many medical images have been created to use only a portion of the total range of gray values possible. They appear very dark or washed out and need contrast enhancement or window leveling. This is typical. The window-leveling function improves the contrast to allow more details to be present in the image at display time. A normal 16 bit image that does not need window leveling should be display correctly. If the min and max values are set to 0, the function automatically calculates the best values for min and max. The image data is never changed since the pixel remapping is done at display time. Syntax int SNBDAPI CIMG_window_level(int min_gray_value, int max_gray_ value, int on_off);

123

Chapter 20 - Image Display Option Functions

Remark Table 20.6: CIMG_window_level Function Variables Variable

Description

min_gray_value max_gray_value

Starting pixel gray value Ending pixel gray value Turn Windows leveling on or off 0 = Off 1 = On

on_off

Returns Returns the status of the set window level operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_autocolor() This global function displays multiple palette images at the same time. A single rainbow palette created by the library is realized when CIMG_bitmap_palette() is called for any palette image. See CIMG_bitmap_palette() for more information. This forces the library to dither all 8-bit images to this palette for best display quality when using multiple palette images. Syntax int SNBDAPI CIMGLOW_autocolor(int color); Remark Table 20.7: CIMGLOW_autocolor Function Variable Variable

Description

color

Background color to set

Returns Returns the multiple palette images. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

124

Chapter 20 - Image Display Option Functions

CIMGLOW_set_alias() This function sets the aliasing factor for the specified image. It is used to turn aliasing on or off for a specific image when one or more images are loaded in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Page

l

Thumbnail

l

Web Image Viewer Component

Syntax int SNBDAPI CIMGLOW_set_alias(int alias); Remark Table 20.8: CIMGLOW_set_alias_img Function Variable Variable

Description

alias

Sets the aliasing factor. Choose from: 0 = No aliasing 1 = Use the preserve black algorithm 2 = Use the scale to gray algorithm 3 = Use the scale to color algorithm 4 = Alias all. Use scale to gray and scale to color

Returns Returns the status of the aliasing factor. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_alias_quality() This function sets the effectiveness of scale to gray and preserve black algorithms. This function works when using CIMGLOW_set_alias(). A value of 100 ensures that no black pixels will be discarded when displaying the image. See CIMGLOW_set_alias() for more information. Syntax int SNBDAPI CIMGLOW_set_alias_quality(int alias_quality);

125

Chapter 20 - Image Display Option Functions

Remark Table 20.9: CIMGLOW_set_alias_quality Function Variable Variable

Description

alias_quality

Alias Quality; 0 to 100 0 = Discard black pixels 100 = Do not discard any black pixels

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_dithermode() This global function dithers 24-bit images to a 256-color display. Also 8 and 24-bit images are dithered on 16-color display adapters. If the display is set to DITHER_NONE, you are at the mercy of the display driver. For instance, 24-bit images on a 256 color display adapter can take 2 or more minutes to display with dither mode off. Syntax int SNBDAPI CIMGLOW_set_dithermode(int mode); Remark Table 20.10: CIMGLOW_set_dithermode Function Variable Variable

Description

mode

Use the above values to decide how or how not to dither. The default is -1.

Returns Returns the status of the set dither mode reduction operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Screen Display Dither Mode Constants Example 20.1 CIMGLOW_set_dithermode DITHER_NONE 0 /* Allows for Windows to do the color reduction. This is not recommended, but available. */

126

Chapter 20 - Image Display Option Functions

DITHER_BAYER 1 /* Uses the Bayer dithering algorithm for color reduction. */ DITHER_DIFFUSION 2 /* Use error diffusion for color reduction. */ ** GLOBAL FUNCTION**

CIMGLOW_set_imnet_page_size() This function allows you to set the document size for the IMNET format. Note: The default value is 200 for the DPI and 0 for the width and height. Syntax int SNBDAPI CIMGLOW_imnet_page_size(int iWidth, int iHeight, int iDPI); Remark Table 20.11: CIMGLOW_set_imnet_page_size Function Variables Variable

Description

iWidth iHeight iDPI

Sets the document’s width Sets the document’s height Sets the document in dots per inch (DPI)

Returns Returns the status of the set IMNET page size operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_rop() This function allows images to be displayed on the screen using ANDing, ORing or any other legal Windows opcode. Syntax int SNBDAPI CIMGLOW_set_rop(int raster_operation);

127

Chapter 20 - Image Display Option Functions

Remark Table 20.12: CIMGLOW_set_rop Function Variables Variable

Description Boolean opcode to use when displaying the image. See the list below for the available opcodes or consult your Windows SDK manual. SRCCOPY = Copies the source bitmap to the destination bitmap. SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator. SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator. SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. NOTSRCCOPY = Copies the inverted source bitmap to the destination.

raster_operation

NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. PATCOPY = Copies the pattern to the destination bitmap. PATPAINT = Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator.Combines the destination bitmap with the pattern using the Boolean XOR operator. DSTINVERT - Inverts the destination bitmap. BLACKNESS - Turns all output black. WHITENESS - Turns all output white.

128

Chapter 20 - Image Display Option Functions

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_transp_color() This function sets the transparent color for GIF images. Syntax int SNBDAPI CIMGLOW_set_transp_color(int color); Remark Table 20.13: CIMGLOW_set_transp_color Function Variable Variable

Description

color

Background color to set

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_wipedelay() This function is used with CIMG_display_ddb_effect() to speed up or slow down the speed that the image is drawn on the screen. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DDB Effect sample. Syntax int SNBDAPI CIMGLOW_set_wipedelay(int wipe_delay); Remark Table 20.14: CIMGLOW_set_wipedelay Function Variable Variable

Description

wipe_delay

Delay time in seconds

129

Chapter 20 - Image Display Option Functions

Returns Returns the delay time. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

130

Chapter 21 - Information Query Functions

Chapter 21 - Information Query Functions This chapter describes the RasterMaster .NET information query functions.

CIMG_bitmap_info() This function gets information about the current image and returns a pointer to the DIB data in memory. All images decompressed or imported into the library are converted to a Windows DIB. It contains a header BITMAPINFOHEADER, palette RGBQUAD, and the raw DIB data. See Chapter 33 - Format For Decompressed Images for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Animate

l

Annaction

l

Annotation

l

ASP Conversion

l

ASP Image View

l

ASP Memory Copy

l

ASP Multiple Pages

l

Batch_XPS_Convert

l

Contrast

l

Convert_Doc

l

DocClean

l

DDB Effect

l

Image Processing

l

FileMem

131

Chapter 21 - Information Query Functions

l

Panning

l

Scan

l

Text Search

l

Thumbnail

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

l

WPF Image

l

WPFScanning_CSHARP

l

VectorConvertMem_CSHARP

l

XPSMem_CSHARP

Syntax LPDIB_HEADER SNBDAPI CIMG_bitmap_info(CDIB_HEADER *dib header); Remark Table 21.1: CIMG_bitmap_info Function Variable Variable

Description

dib_header

Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER.

Returns Returns a memory handle for the DIB. Returns a pointer to an image in memory.

CIMG_get_bitmap_palette() This function returns the palette of the image specified in HPALETTE format. The developer is responsible for releasing HPALETTE when finished with it. Syntax HPALETTE SNBDAPI CIMG_get_bitmap_palette(void); Returns Returns the palette as an HPALETTE format of the image.

132

Chapter 21 - Information Query Functions

CIMG_get_croprect() This function returns the current crop rectangle. After decompression, the default cropping rectangle is the height and width of the image. Syntax int SNBDAPI CIMG_get_croprect(CIMG_RECT *rect); Remark Table 21.2: CIMG_get_croprect Function Variable Variable

Description

rect

Rectangle to hold new size of object. For more information, see public class CIMG_RECT.

Returns Returns the current crop rectangle for the image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_get_display_rect() This function returns the coordinates of the last displayed rectangle. Syntax int SNBDAPI CIMG_get_display_rect(int *xs, int *ys, int *xsize, int *ysize); Remark Table 21.3: CIMG_get_display_rect Function Variables Variable

Description

xs ys xsize ysize

Starting x position (left) Starting y position (top) Height of display Width of display

Returns Returns the coordinates of the last displayed rectangle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

133

Chapter 21 - Information Query Functions

CIMG_get_version(int, int, int, int) This function returns version information for your RasterMaster .NET. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Conversion sample. Syntax int SNBDAPI CIMG_get_version(int *major, int *minor, int *update, int*fix); Remark Table 21.4: CIMG_get_version Function Variable Variable

Description

major minor update fix

Returns the major number of the library version. Returns the minor number of the library version. Returns the address update number of the library version. Returns the fix address number of the library version.

Example 21.1 CIMG_get_version int major=0, minor=0, update=0, fix=0; status = simage.CIMG_get_version(ref major, ref minor, ref update, ref fix);

Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_get_version(String) This function returns version information for your RasterMaster .NET. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Conversion sample. Syntax int SNBDAPI CIMG_get_version(String **version);

134

Chapter 21 - Information Query Functions

Remark Table 21.5: CIMG_get_version Function Variable Variable

Description

version

Returns a string with "major.minor.update.fix". For example, "17.11.8.0"

Example 21.2 CIMG_get_version ToolStripStatusLabel lblStatus; this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel (); [... add status to form] String strVersion = null; status = simage.CIMG_get_version(ref strVersion); if (status >= 0) { lblStatus.Text = ".NET library " + strVersion; } else { lblStatus.Text = "Error getting RasterMaster .NET library version: " + simage.ToErrorMessage(status); }

Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_ifl_version() This function returns version information for your RasterMaster .NET. Syntax int SNBDAPI CIMG_ifl_version(int *major, int *minor); Remark Table 21.6: CIMG_ifl_version Function Variable

135

Chapter 21 - Information Query Functions

Variable

Description

major minor

Pointer to 8 bytes of memory to receive the major version number Pointer to 8 bytes of memory to receive the minor version number

Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_delete_page() This function deletes a page from a file. int CIMGLOW_delete_page(String fileName, int pageIndex, Byte[] resultBuffer); Remark Table 21.7: CIMGLOW_delete_page Function Variables Variable

Description

fileName pageIndex

The path of file name Page index number. The deleted page result buffer. It's the buffer after delete the page. If there is only one page, the result buffer is empty. The last page will not be deleted.

resultBuffer

Returns Returns a deleted page. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_delete_page_mem() This function is used to delete a PDF page from the memory buffer. int CIMGLOW_delete_page_mem(Ref Byte[] dataBuffer, int pageIndex); Remark Table 21.8: CIMGLOW_delete_page_mem Function Variables Variable

Description

dataBuffer

Reference data buffer. Input buffer is the original image buffer. Output is the result data buffer with image deleted. The last page will not be deleted so result buffer will be empty.

136

Chapter 21 - Information Query Functions

Variable

Description

pageIndex

Page index number.

Returns Returns a PDF page from the memory buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_anim_delay() This function returns the animation delay time for GIF files which have a graphic extension block containing the animation delay time parameter. If it is not found, the function returns the error code NO_DELAY_TIME_FOUND. Syntax int SNBDAPI CIMGLOW_get_anim_delay(String *filename); Remark Table 21.9: CIMGLOW_get_anim_delay Function Variable Variable

Description

filename

Path/filename of the file to return animation delay time

Returns Returns the animation delay time for GIF files which have a graphic extension block containing the animation delay time parameter. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_auto_detect() This global function returns the current RasterMaster .NET auto-detection for the specified file type on the current file. Syntax int SNBDAPI CIMGLOW_get_auto_detect(int format); Remark Table 21.10: CIMGLOW_get_auto_detect Function Variable Variable

Description

format

Image format type from the defined list in imglib.h

137

Chapter 21 - Information Query Functions

Returns Returns the status of the get auto-detect status operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_get_bitmap_header() This function fills in the CDIB_HEADER structure for the image. It is used to get height, width, bits_pix and other information. bits_pix and other information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMGLOW_get_bitmap_header(CDIB_HEADER *dib_header); Remark Table 21.11: CIMGLOW_get_bitmap_header Function Variables Variable

Description

dib_header

Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER.

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_bitmap_name() This function returns a text string from the image, if available. It is mainly used for TIFF images. Each buffer should be at least 200 bytes. Syntax int SNBDAPI CIMGLOW_get_bitmap_name(String *strName, String *strDate); Remark Table 21.12: CIMGLOW_get_bitmap_name Function Variables

138

Chapter 21 - Information Query Functions

Variable StrName StrDate

Description Pointer to a string to receive the name or author from the last image decompressed Pointer to a string to receive the date from the last image decompressed

Returns Returns the text string from the image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 21.3 CIMGLOW_get_bitmap_name C#:simage.CIMGLOW_get_bitmap_name(ref strBMName, ref strDateInfo);

CIMGLOW_get_custstring() This function returns a string stored in RasterMaster .NET. The name of the corporation licensed to use this product is embedded in RasterMaster .NET by Snowbound Software. This allows detection of the DLL or OCX to ensure that the user has the correct version. Syntax int SNBDAPI CIMGLOW_get_custstring(String *custstring); Remark Table 21.13: CIMGLOW_get_custstring Function Variable Variable

Description

custstring

Pointer to string in which to store custom string data

Returns Returns the string stored in RasterMaster .NET. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_fileinfo() This function gets image information by filling in the lpbih structure containing height, width and bits per pixel for the image. This structure should be allocated large enough to fit the size of the lpbih structure (40 bytes).

139

Chapter 21 - Information Query Functions

Syntax int SNBDAPI CIMGLOW_get_fileinfo(String *filename, CDIB_HEADER *dib_header); Remark Table 21.14: CIMGLOW_get_fileinfo Function Variables Variable

Description

filename

Any valid existing image on the disk Pointer to a CDIB_HEADER structure. For more information, see public class CDIB_HEADER.

dib_header Returns

Returns the image information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_fileinfo_fd() This function reads and returns the file header information from the image file and specific page number passed in. It fills in the DIB_HEADER structure with width, height, dpi and bits per pixel. Syntax int SNBDAPI CIMGLOW_get_fileinfo_fd_(FileStream *filestream, CDIBHEADER *dib_header); Remark Table 21.15: CIMGLOW_get_fileinfo_fd Function Variables Variable

Description

filestream

Pointer to FileStream object Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER.

dib_header Returns

Returns the status of the file header information operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

140

Chapter 21 - Information Query Functions

CIMGLOW_get_fileinfo_page() This function reads and returns the file header information from the image file and specific page number passed in. It fills in the DIB_HEADER structure with width, height, dpi and bits per pixel. Syntax int SNBDAPI CIMGLOW_get_fileinfo_page(String *filename, CDIBHEADER *dib_header, int page); Remark Table 21.16: CIMGLOW_get_fileinfo_page Function Variables Variable

Description

filename

Image path and file name Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. Page number starts at 0

dib_header page Returns

Returns the file information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_fileinfo_fd() This function reads and returns the file header information from the image file passed in. It fills in the DIB_HEADER structure with width, height, DPI, and bits per pixel. Syntax int SNBDAPI CIMGLOW_get_fileinfo_fd(FileStream *filestream, CDIB_ HEADER *dib_header); Remark Table 21.17: CIMGLOW_get_fileinfo_fd Function Variables Variable

Description

filestream

Handle returned from a Windows OpenFile() call Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER.

dib_header

141

Chapter 21 - Information Query Functions

Returns Returns the status of the file header information operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_filetype() This function returns the filetype as defined in imglib.h. Syntax int SNBDAPI CIMGLOW_get_filetype(String *filename); Remark Table 21.18: CIMGLOW_get_filetype Function Variable Variable

Description

filename

Path/filename of image to return file type

Returns Returns the filetype as defined in the image library (imgelib.h). For example, a Word file would return the file type number 86. For a list of file type numbers, please see Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_filetype_fd() This function returns the file types as defined in imglib.h for the file handle of the image currently open. The regular decompress bitmap starts at the beginning of the file, position zero. If the image you want to open is embedded in a file, use CIMG_ decompress__bitmap_ fd to open the content at the current position without rewinding to the beginning of the file. Syntax int SNBDAPI CIMGLOW_get_filetype_fd(FileStream *filestream); Remark Table 21.19: CIMGLOW_get_filetype_fd Function Variable Variable

Description

filestream

File handle obtained from OpenFile() or _lopen() Windows call

142

Chapter 21 - Information Query Functions

Returns Returns the filetype as defined in the image library (imgelib.h). For example, a Word file would return the file type number 86. For a list of file type numbers, pleasesee Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_filetype_mem() This function gets the file type number of the image stored in memory at the location pointed to by the filename pointer. Syntax int SNBDAPI CIMGLOW_get_filetype_mem(Array *data); Remark Table 21.20: CIMGLOW_get_filetype_mem Function Variable Variable

Description

data

Pointer to image in memory

Returns Returns the standard library image handle. For example, a Word file would return the file type number 86. For a list of file type numbers, please see Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_filetype_url() This function gets the file type number of the image stored in the given Uniform Resource Locator (URL) address. Syntax int SNBDAPI CIMGLOW_get_filetype_url(String *strURL); Remark Table 21.21: CIMGLOW_get_filetype_url Function Variable Variable

Description

strURL

The URL address to point to the image

143

Chapter 21 - Information Query Functions

Returns Returns the file type number of the image stored in the given URL address. For example, a Word file would return the file type number 86. For a list of file type numbers, please see Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_image_orientation_page() This function returns the rotation angle for the filename and page specified. It is used to get the orientation of images in multi-page file formats. It returns the same values as CIMGLOW_get_ image_orientation(). Syntax int SNBDAPI CIMGLOW_get_image_orientation_page(String *filename, int page); Remark Table 21.22: CIMGLOW_get_image_orientation_page Function Variables Variable

Description

filename page

Path/filename of image to return orientation information Page number to return orientation

Returns Returns the rotation angle for the filename and page specified. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_pages() This function returns the number of pages for a multi-page file. If the file is not of the multi-page variety (such as TIFF, .DCX, PDF, or MO:DCA:IOCA) the function returns 1. It supports unicode file name input. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples:

144

l

ASP Multiple Pages

l

Convert_Doc

l

Page

Chapter 21 - Information Query Functions

l

Scan

l

Split to Multiple Pages

l

Text Search

l

Thumbnail

l

WPFAnnotation_CSHARP

l

WPFConversion_CSHARP

l

WPFScanning_CSHARP

Syntax int SNBDAPI CIMGLOW_get_pages(String *filename); Remark Table 21.23: CIMGLOW_get_pages Function Variable Variable

Description

filename

Path/filename of image to return page information

Returns Returns the number of pages for a multi-page file. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_pages_fd() This function returns the number of pages for a multi-page file. If the file is not of the multi-page variety (such as TIFF or MO:DCA:IOCA) the function returns 1. Syntax int SNBDAPI CIMGLOW_get_pages_fd(FileStream *filestream); Remark Table 21.24: CIMGLOW_get_pages_fd Function Variable Variable

Description

filestream

Handle returned from a Windows OpenFile() call

145

Chapter 21 - Information Query Functions

Returns Returns the number of pages for a multi-page file. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_pages_mem() This function returns the number of pages from an image stored in the pointer passed as the first argument. This is similar to CIMGLOW_get_pages() but is used for the image stored in a memory pointer. Syntax int SNBDAPI CIMGLOW_get_pages_mem(Array *data); Remark Table 21.25: CIMGLOW_get_pages_mem Function Variable Variable

Description

32

Pointer to image in memory

Returns Returns the number of pages from an image stored in the pointer passed as the first argument. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_pages_url() This function returns the number of pages from an image stored in the given Uniform Resource Locator (URL) address. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMGLOW_get_pages_url(String *strURL); Remark Table 21.26: CIMGLOW_get_pages_url Function Variable Variable

Description

strURL

The URL address to point to the image.

146

Chapter 21 - Information Query Functions

Example 21.4 CIMGLOW_get_pages_url status = simage.CIMGLOWLOW_get_pages_url ("http://www.snowbound.com/images/HomeBanner0.jpg"); status = simage.CIMGLOWLOW_get_pages_url("http://localhost/images/test.pdf");

Returns Returns the number of pages from an image stored in the given URL address. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_tiff_tag() This function reads a TIFF tag from the file specified by bm_name. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. A return value of 0 indicates a non-string value. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Tiff Tag sample. int SNBDAPI CIMGLOW_get_tiff_tag(int tag, int max_bytes, int *ptr_ value, String *strFileName, String *strBuff); Remark Table 21.27: CIMGLOW_get_tiff_tag Function Variables Variable

Description

tag max_bytes ptr_value strFileName strBuff

TIFF tag number to return Maximum bytes to read for string tags Pointer to tag value returned Filename to read tags from String buffer for returning string tags

Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

147

Chapter 21 - Information Query Functions

You can use the TIFF tag to get the colorspace type by specifying tag #262. Value is what is returned. For this tag you will not need the bytearray. Example 21.5 CIMGLOW_get_tiff_tag int tag_no = 262; int max_bytes = 0; int[] value = new int[1]; byte[] data = null; myFrame.Simage.CIMGLOW_get_tiff_tag(tag_no, max_bytes, value, st, data, page); /* PHOTOMETRIC INTERPRETATION */ #define TIFF_PHOTO_WHITE_IS0 0 #define TIFF_PHOTO_WHITE_IS1 1 #define TIFF_PHOTO_RGB 2 #define TIFF_PHOTO_PALETTE 3 #define TIFF_PHOTO_TRANSP 4 #define TIFF_PHOTO_CMYK 5 #define TIFF_PHOTO_YCC 6 #define TIFF_PHOTO_CIELAB 8

CIMGLOW_get_tiff_tag_page() This function reads a TIFF tag from the file specified by filename and the page specified by page. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. Return values of 0 indicate non-string values. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page(String *filename, int page, CTIFF_TAG *tag); Remark Table 21.28: CIMGLOW_get_tiff_tag_page Function Variables Variable

Description

filename page

Path/filename of image to return orientation information Page number from which to read tags TIFF tag number to return. For more information, see ‘‘public class CTIFF_TAG’’

tag

148

Chapter 21 - Information Query Functions

Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_tiff_tag_page_fd() This function reads a TIFF tag from the file specified by filestream and page specified by page. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. Return values of 0 indicate non-string values. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page_fd(Filestream *filestream, int page, CTIFF_TAG *tag); Remark Table 21.29: CIMGLOW_get_tiff_tag_page_fd Function Variables Variable

Description

filestream page

Handle returned from a Windows OpenFile() call Page number from which to read tags TIF tag number to return. For more information, see public class CTIFF_TAG.

tag Returns

Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_tiff_tag_page_mem() This function reads a TIFF tag from the image buffer. The tag may be either a string returned in buff or a long, int, or char returned in value. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page_mem(Array *data, int page, CTIFF_TAG *tag); Remark Table 21.30: CIMGLOW_get_tiff_tag_page_mem Function Variables

149

Chapter 21 - Information Query Functions

Variable

Description

data page

Memory Pointer to image data Page number from which to read tags TIF tag number to return. For more information, see public class CTIFF_TAG.

tag Returns

Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 21.6 CIMGLOW_get_tiff_tag_page_mem() CTIFF_TAG tifTag = new CTIFF_TAG(); tifTag.tag = 315; tifTag.tagvalue = 0; tifTag.buff_max_bytes = 255; tifTag.buff = new byte[255]; status = simage.CIMGLOW_get_tiff_tag_page_mem(arrImageData, 0, tifTag); UTF8Encoding utf8Encoder = new UTF8Encoding(); String tagString = utf8Encoder.GetString(tifTag.buff); int tagValue = tifTag.tagvalue;

CIMGLOW_get_tile_info() This function fills in the tile structure information on width, height, tile width, and tile height. Syntax int SNBDAPI CIMGLOW_get_tile_info(String *filename, CSNBDTILESTRUCT *tile, int page); Remark Table 21.31: CIMGLOW_get_tile_info Function Variables Variable

Description

filename

Path/filename of tiled image for which to return information Pointer to the tile information structure to return. For more information, see public class CSNBDTILESTRUCT. Page number of the tile information structure to return

tile page

150

Chapter 21 - Information Query Functions

Example 21.7 CIMGLOW_get_tile_info typedef struct tagSNBDTILESTRUCT { Long width; Long height; Long tile_width Long tile_height Long num_tiles; SNBDTILESTRUCT

Returns Returns the file name of a tiled image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_transp_color() This function gets the transparent color for GIF images. int SNBDAPI CIMGLOW_get_transp_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_is_tiled_image() This function returns 1 if the image passed as argument is a tiled image. Currently TIFF and JEDMICS images can be tiled. Syntax int SNBDAPI CIMGLOW_is_tiled_image(String *filename); Remark Table 21.32: CIMGLOW_is_tiled_image Function Variable Variable

Description

filename

Path/filename of the file to return animation delay time

151

Chapter 21 - Information Query Functions

Returns Returns the value of the tiled image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_read_pixel() This function reads and returns a pixel value from the image. The xpos and ypos specify the location in the image from which to read. See CIMG_runs_to_dib() for more information. Syntax int SNBDAPI CIMGLOW_read_pixel(int xpos, int ypos); Remark Table 21.33: CIMGLOW_read_pixel Function Variables Variable

Description

xpos ypos

X coordinate of pixel to read Y coordinate of pixel to read

Returns Returns the status of the read pixel operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_redact_text() This function redacts text string from extracted text buffer. Syntax int SNBDAPI CIMGLOW_redact_text(Byte[] arrBuff, out Byte[] textBuffer, String redactText, int caseSense, int redactColor, Boolean isUnicode); Remark Table 21.34: CIMGLOW_redact_text Function Variables Variable

Description

arrBuff textBuffer

Input, extracted text buffer from a document page. Output text buffer with the text string redacted.

String

Text string to redact.

152

Chapter 21 - Information Query Functions

Variable

Description

caseSense

If it is not 0, case sensitive, otherwise not.

redactColor

The color value of the redacted rectangle.

isUnicode

True if it is Unicode string otherwise, ascii string.

Returns Returns a value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_redact_rects() This function redacts text with a group of areas. Syntax int SNBDAPI CIMGLOW_redact_rects(Byte[] arrBuff, out Byte[] textBuffer, CSNBD_SEARCH_RESULT[] snbdRCList, int redactColo; Remark Table 21.35: CIMGLOW_redact_rects Function Variables Variable

Description

arrBuff textBuffer

Extracted text buffer from a document page.. Output redacted text buffer.

CSNBD_SEARCH_RESULT

Text string to redact.

caseSense

Array of redacted areas.

redactColor

The color value of the redacted area.

Returns Returns a value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_rotate_page_mem() This function rotates a PDF page in PDF buffer and returns the rotated page buffer. Only works for PDF. It requires itextsharp.dl. Syntax int CIMGLOW_rotate_page_mem(Byte[] arrImage, out Byte[] arrBuffer, int rotateAngle, int pageIndex);

153

Chapter 21 - Information Query Functions

Remark Table 21.36: CIMGLOW_rotate_page_mem Function Variables Variable

Description

arrImage arrBuffer

Input PDF document buffer. Output rotated page buffer.

rotateAngle pageIndex

Input the angle for a page to rotate. For example 90, 180, 270. Input the page index number to rotate.

Returns Returns the error code of the function executed. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_bitmap_header() This function fills in the CDIB_HEADER structure for the image. It is used to set height, width, bits_pix, DPI, and other information. Syntax int SNBDAPI CIMGLOW_set_bitmap_header(CDIB_HEADER, *dib_header); Remark Table 21.37: CIMGLOW_set_bitmap_header Function Variables Variable

Description

dib_header

Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER.

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. You can use the CIMGLOW_set_bitmap_header and the CIMG_resize_bitmap functions to change the resolution (DPI) of your output document as shown in the example below: Example 21.8 CIMG_decompress_bitmap status = simage.CIMG_decompress_bitmap(filename.tif); sdibHeader = new CDIB_HEADER();

154

Chapter 21 - Information Query Functions

status = simage.CIMG_bitmap_info(sdibHeader); sdibHeader.biXPelsPerMeter = 200; sdibHeader.biYPelsPerMeter = 200; //resize image to what you want //status = simage.CIMG_resize_bitmap(newImageWidth, newImageHeight); status = simage.CIMGLOW_set_bitmap_header(sdibHeader);

CIMGLOW_set_document() This function sets the format parameter is an integer to represent an image type. Syntax int SNBDAPI CIMGLOW_set_document(int dpi, int bits, int format); Remark Table 21.38: CIMGLOW_set_document Function Variables Variable

Description

dpi

Sets the document in dots per inch. Sets the bits per pixel. 1 = black and white documents 24 = color images Sets the format parameter.

bits

format Returns

Returns the status of the document. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_document_input(int, int) This function sets the level of color and resolution quality when reading in documents for most document formats. It is used for the PDF, Word, Excel, PCL, and AFP formats. This function should be called before the input document is read in using CIMG_decompress_bitmap(). You can override RasterMaster .NET’s default bits-per-pixel and DPI settings using this method. You may want to process just black and white documents. Use this method to set the

155

Chapter 21 - Information Query Functions

input bits-per-pixel to 1 for black and white input without the extra overhead and performance costs of processing color images. You can use this function to do the following: l

Read in color or grayscale documents by setting a higher bits-per-pixel. Please see Appendix B, Supported File Formats for details on what bits per pixel are supported for each format.

l

Increase your output image quality by increasing the input document DPI.

l

Enhance your performance by decreasing the document DPI or bits per pixel.

This method does not affect the Office 2007 -2010 formats. Please see CIMGLOW_set_document_input(int, int, int) to set the input quality for a specific format, including Office 2007 formats. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Note: The default is 200 dpi and 24 bits per pixel for PDF. The default is 300 dpi and 1 bit per pixel for PCL, AFP, Word, and Excel. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi, int bits_pix); Remark Table 21.39: CIMGLOW_set_document_input Function Variables Variable

Description

dpi

Sets the input resolution in dots per inch. A higher dpi yields a higher quality document that takes longer to process and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents 24 = color images

bits_pix

See Appendix B, Supported File Formats for information on these and other pixel depths supported by each format. Returns Returns the status of the document input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

156

Chapter 21 - Information Query Functions

CIMGLOW_set_document_input(int, int, int)  This function sets the level of color and resolution quality when reading in documents for the specified document format. This function should be called before the input document is read in using CIMG_decompress_bitmap(). You can override RasterMaster .NET’s default bits-per-pixel and DPI settings for the specified format using this function. You can use this function to do the following: l

l

Set the input bits-per-pixel to 1 for black and white input to remove the extra overhead and performance costs of processing color images. Read in color or grayscale documents by setting a higher bits-per-pixel. Please see Appendix B, Supported File Formats for details on what bits per pixel are supported for each format.

l

Increase your output image quality by increasing the input document DPI.

l

Increase your processing throughput by decreasing the document DPI or bits per pixel.

Note: The default is 200 dpi and 24 bits per pixel for PDF. The default is 300 dpi and 1 bit per pixel for PCL, AFP, Word, and Excel. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi, int bits_pix, int format); Remark Table 21.40: CIMGLOW_set_document_input Function Variable Variable

Description

dpi

Sets the input resolution in dots per inch. A higher dpi yields a higher quality document that takes longer to process and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents 24 = color images

bits_pix

See Appendix B, Suported File Formats for information on these and other pixel depths supported by each format. format

Sets the format parameter. A file format number as specified in Appendix B, Supported File Formats i.e. Word

157

Chapter 21 - Information Query Functions

Variable

Description (DOC) is 86.

Returns Returns the status of the document input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_document_page_size(int, int, int) This function sets the document's page size. Note: Currently this method only supports .xls and .xlsx files. Syntax int SNBDAPI CIMGLOW_set_document_page_size(double width, double height, int format); Remark Table 21.41: CIMGLOW_set_document_page_size Function Variable Variable

Description

width height

Sets the page size width. Using unit inches. Sets the page size height. Using unit inches. Sets the format parameter. Currently, the only supported file format is Excel. A file format number as specified in Appendix B, Supported File Format i.e. Excel(XLS) is 84.

format

Example 21.9 CIMGLOW_set_document_page_size status = simage.CIMGLOW_set_document_page_size(20.0, 20.0, (int)CIMG_IMAGE_TYPE.xls);

Returns Returns the status of the document page size. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

158

Chapter 22 - Text Search Functions

Chapter 22 - Text Search Functions This chapter describes the RasterMaster .NET text search functions.

CIMG_save_document() This function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_bitmap() function only creates a bitmap file. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. Syntax int SNBDAPI CIMG_save_document(String *strName, char *buff, int filetype); Remarks Table 22.1: CIMG_save_document Function Variables Variable

Description

*strName buff filetype

Name of the output PDF file Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59

Returns Returns the document file output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 22.1 Data Format for Extracted Text Buffer for both Windows and Java The coordinates system is originated at the upper left. X - Represents a floating point argument. As in 12.012, all of these arguments are in points of 1/72 of an inch. Text - Represents an ASCII string argument. STREAM COMMANDS and format of extracted file %%SOF- Start of file

159

Chapter 22 - Text Search Functions

/PageNumber=XPage number being extracted. /PageWidth=XWidth of page in points. (1/72 of an inch) /PageHeight=XHeight of page in points. (1/72 of an inch) %%EOFMarks the end of this file. No more data to process. /FontStart of font data and attributes. /FontName=TextStandard font face name. /FontHeight=XFont height in points (1/72 of an inch). /FontBold=XSet to 1 for bold font otherwise 0. /FontItalic=XSet to 1 for Italic font otherwise 0. /Xpos=XX starting coordinate of text string. /Ypos=XY starting coordinate of text string. %%SOTStart of a text string after the carriage return. Text Data here %%EOTEnds a text string. /ImageStart of image data and attributes. /ImageWidth=XWidth in pixels of the image data. /ImageHeight=XHeight in pixels of the image data. /Bitsperpixel=XNumber of bits per pixel. /Compression=TextCompression type used. CCITT_G4, JPEG, or NONE. /Length=XLength of binary image data. %%SOIStarts the binary image data. Binary data here %%EOIEnds the binary image data. /DrawImage Xs Ys Width HeightDraws the last defined image at the location specified by the arguments. /Moveto XS YSMoves current graphics drawing position. /LineXS YSDraws a line from current graphics                                drawing position to a location specified by the arguments. /Rectangle XS YS WIDTH HEIGHT Draws a rectangle at the specified coordinates. /Curve X1 Y1 X2 Y2 X3 Y3Draws a curve from the current graphics drawing position to the end coordinates using the first 4 arguments as guide points.

160

Chapter 22 - Text Search Functions

CIMG_save_mem() This function saves the current snowbound object to a image buffer. It calculates the size of the memory buffer and grows it appropriately. Syntax int SNBDAPI CIMG_save_mem(Array* arrBuffer, int initial_size, int buff_inc, int format, Int32* buff_size); Remark Table 22.2: CIMG_save_mem Function Variables Variable

Description

arrBuffer initial_size

Byte array buffer image save in. Initial size of the image buffer to allocate. Amount to grow the buffer if more space is needed to save. Format code to save as. Saved image buffer size.

buff_inc format buff_size Returns

Returns the memory buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_save_mem_page() This function saves the current page and appends it to the current image buffer. It calculates the size of the memory buffer and grows it appropriately. Syntax int SNBDAPI CIMG_save_mem_page(Array* arrBuffer, int buff_inc, int format, Int32* buff_size); Remark Table 22.3: CIMG_save_mem_page Function Variables Variable

Description

arrBuffer

Byte array buffer image save in. Amount to grow the buffer if more space is needed to save. Format code to save as. Saved image buffer size.

buff_inc format buff_size

161

Chapter 22 - Text Search Functions

Returns Returns the memory buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_append_page() This function extract pages from image file and append them to image buffer. Currently only works for PDF formatt. Syntax int SNBDAPI CIMGLOW_append_page(String *strFileName, Array* arrBuffer); Remarks Table 22.4: CIMGLOW_append_page Function Variables Variable

Description

strFileName *arrBuffer

Input document name. Image buffer to save /in

Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_extract_text() This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files. It returns the buffer of extracted text in ASCII format. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Convert_Doc

l

Text Search

Syntax int SNBDAPI CIMGLOW_extract_text(String *strFileName, Byte *arrBuffer, int *ptrLength, int page);

162

Chapter 22 - Text Search Functions

Remarks Table 22.5: CIMGLOW_extract_text Function Variables Variable

Description

*strFileName *arrBuffer

Name of file from which to extract text Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text

*ptrLength page Returns

Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 22.2 CIMGLOW_extract_text %%SOF /Page=0 /Width=1700 /Height=2200 /FontName=TimesRoman /FontHeight=44 /FontBold=1 /FontItalic=0 /Xpos=1300 /Ypos=240 %%SOT Devadas %%EOT /Xpos=1243 /Ypos=240 %%SOT S. %%EOT %%EOF %%SOI %%EOI Table 22.6: Extracted Text Variables Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters. Variable

Description

%%SOF %%EOF Page

Signals the start of the buffer Marks the end of extracted text Specified once at the beginning of the file to indicate the

163

Chapter 22 - Text Search Functions

Variable

Width Height Font Name FontHeight

Description page number Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate page height in pixels Name of font Font height in pixels Font to be drawn plain or in bold

FontBold

1 = bold 0 = plain Font to be drawn in normal or italic

FontItalic

1 = italic 0 = normal X pos in pixels Y pos in pixels Start of text block End of text block Start of image End of image Start of Text Unicode/UTF. End of Text Unicode/UTF.

Xpos Ypos %%SOT %%EOT %%SOI %%EOI %%SOTU %%EOTU

CIMGLOW_extract_text_mem_pointer() This function extracts text from memory. It returns the buffer pointer of extracted text in ASCII format. This function runs faster than CIMG_extract_text_mem. It is only supported by C++ and C#. Syntax int SNBDAPI CIMGLOW_extract_text_mem_pointer(Array *arrImage, Byte *arrBuffer, int *ptrLength, int page); Remarks Table 22.7: CIMGLOW_extract_text_mem_pointer Function Variables Variable

Description

*arrImage *arrBuffer

Memory array to image data Pointer of buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer

*ptrLength

164

Chapter 22 - Text Search Functions

Variable

Description

page

Page number of file from which to extract text

Returns Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_extract_page() This function extracts a page from document and save to image buffer. Currently only works for PDF format. Syntax int SNBDAPI CIMGLOW_extract_page(String *strFileName, Array* arrBuffer, int page); Remarks Table 22.8: CIMGLOW_extract_page Function Variables Variable

Description

strFileName *arrBuffer page

Input document name. Image buffer to save /in Page number of file from which to extract text

Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_extract_page_mem() This function extracts a page from memory and save to image buffer. Currently only works for PDF format. Syntax int SNBDAPI CIMGLOW_extract_page_mem(Array *arrImage, Array* arrBuffer, int page); Remarks Table 22.9: CIMGLOW_extract_page_mem Function Variables

165

Chapter 22 - Text Search Functions

Variable

Description

arrImage *arrBuffer page

Input image buffer. Image buffer to save /in Page number of file from which to extract text

Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_search_text() This function returns an array of structures of classes of the type, SNBD_SEARCH_RESULT. For each class or structure there is an array of rectangles. This is to allow a search term to wrap to a new line requiring more than two rectangles to highlight. The nCount parameter will be set to the number of rectangles required for each instance of a search term. The rectangles will be sorted from the top of the page to the bottom from the left side to the right. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Text Search sample. Syntax int SNBDAPI CIMGLOW_search_text(CIMG_SEARCH_RESULT[] sbdRCList, Array *txtbuffer, String *strSearch, int case_sense, int *ptrerror, int *pRecNum); Remark Table 22.10: CIMGLOW_search_text Function Variables Variable sbdRCList txtBuffer strSearch instance case_sense ptrerror pRecNum

166

Description Array of CIMG_SEARCH_RESULT specifying the location of the string found. For more information, see public class CIMG_SEARCH_RESULT. Character buffer to search. Returned from a call to CIMGLOW_extract_text(). Search string Occurance of search string to find, start from 0 Is search case sensitive. 0 = Not case sensitive 1 = case sensitive Error code Number of items in search result array.

Chapter 22 - Text Search Functions

Returns Returns the status of the array of structures of classes of the type, SNBD_SEARCH_ RESULT. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_document_input() This function sets the level of color and resolution quality when reading in documents for the specified document format. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi,int bitsperpixel, int format, double width, double height); Remark Table 22.11: CIMGLOW_set_document_input Function Variables Variable

Description

dpi bitsperpixel format width height

Input resolution in dots per inch. Bits per pixel. Format code number. Page width. Units in inches. Page width. Units in inches.

Returns Returns the status of the document input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

167

Chapter 23 - AFP Font Mapping Functions

Chapter 23 - AFP Font Mapping Functions This chapter describes the snbd_map.fnt file and the functions used for AFP font mapping. The chapter contains the following topics: AFP Font Mapping Format of Font Mapping Data Color Documents Rendered as Black and White CIMGLOW_set_fontmap_path() CIMGLOW_set_fontmap()

AFP Font Mapping AFP files can use specific fonts to achieve a particular look. If you find that the fidelity of the output for your AFP documents is lacking, particularly in regards to text size and spacing or barcodes, then you can customize RasterMaster .NET to use particular fonts when processing your AFP files. RasterMaster .NET is easy to customize to improve the look of your AFP documents. Snowbound Software allows you to map the fonts in your AFP/MODCA document to fonts on your system using a mapping file named snbd_map.fnt. The snbd_map.fnt file is custom crafted to specify the fonts used in your AFP files and on your system. If you provide a representative sample AFP document to Snowbound Software by entering a support issue at http://support.snowbound.com, we will provide you with a custom snbd_map.fnt file usually in a few business days that will improve the display and print quality of your AFP documents. RasterMaster .NET automatically loads the snbd_map.fnt file if it is found in one of the following directories: l

l

The directory into which images are being read . For example: C:\\AFP\\fontmap The directory where your application exists as long as you are not changing directories with a dialog box

The following functions allow you to set font mapping: 1. The CIMGLOW_set_fontmap_path() function sets the path of the font mapping file. See CIMGLOW_set_fontmap_path() for more information. 2. The CIMGLOW_set_fontmap() function programmatically sets the font mapping. See CIMGLOW_set_fontmap()  for more information.

Format of Font Mapping Data Any AFP font name can now be mapped to the following:

168

Chapter 23 - AFP Font Mapping Functions

l

face name

l

point size

l

bold attributes

l

italic attributes

The snbd_map.fnt file is a simple ASCII text file. Each entry is ended with a carriage return line feed. The following are two sample entries: C0BC25I3,Courier,10,0,0 C0CGT12S,Times New Roman,14,0,1 Table 23.1: Description of a sample entry in the snbd_map.fnt file Variable

Description

C0BC25I3 Courier 10 0 0

Font resource name in the AFP file. New face name to map to. New size in points or 1/72 of an inch. Bold attribute, 0 - off , 1 - on. Italic attribute 0 - off, 1 - on.

Color Documents Rendered as Black and White   AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use CIMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance. If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Format for details on which formats support color information at different bitdepths.

CIMGLOW_set_fontmap_path() This function defines the path where Snowbound Software will look for the font mapping file, snbd_map.fnt. If the path is not currently set, RasterMaster .NET looks for it in the current directory. The current directory is whatever folder the program is currently in, usually wherever the file being decompressed is located. Syntax int SNBDAPI CIMGLOW_set_fontmap_path(String *strPath);

169

Chapter 23 - AFP Font Mapping Functions

Remarks Table 23.2: CIMGLOW_set_fontmap_path Function Variables Variable

Description A string pointer to the path to look for the snbd_map.fnt file.

strPath

The snbd_map.fnt file will be appended to the path name. CIMGLOW_set_fontmap_path("c:\\temp"); This variable is limited to 50 bytes. Therefore, the path must be below 50 characters.

Example 23.1 CIMGLOW_set_fontmap_path status = simage.CIMGLOW_set_fontmap_path ("C:\\Snowbnd\\FontMap");

Returns Returns the status of the path of the font mapping file. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_fontmap() This function programmatically sets font mapping. Syntax int SNBDAPI CIMGLOW_set_fontmap(String *strFontMap, int mapLength); Remarks Table 23.3: CIMGLOW_set_fontmap Function Variables Variable

Description Pointer to font mapping data. This is the whole buffer of data found in the font map file, snbd_map.fnt. This variable overrides existing font mapping in the snbd_ map.fnt file.

strFontMap

The following are some examples of the data in this variable: C0H400xx90,PrecisionID Postnet L DEMO,12,0,0 C0BPOSBX,CCodePostnet,10,0,0

170

Chapter 23 - AFP Font Mapping Functions

Variable

Description

mapLength

The integer length of font mapping data

Example 23.2 CIMGLOW_set_fontmap status = simage.CIMGLOW_set_fontmap ("C0BC25I3,Courier,10,0,0\nC0CGT12S,Arial,14,0,1\n",46);

Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_pdf_flags() This function programmatically sets PDF flags. Syntax int SNBDAPI CIMGLOW_set_pdf_flags(int flags); Remarks Table 23.4: CIMGLOW_set_pdf_flags Function Variables Variable

Description

flags

New flags for PDF.

Returns Returns the status of the PDF flags. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_pdf_fontpath() This function ]sets the PDF font path. Syntax int SNBDAPI CIMGLOW_set_pdf_fontpath(String* fontPath); Remarks Table 23.5: CIMGLOW_set_pdf_fontpath Function Variables

171

Chapter 23 - AFP Font Mapping Functions

Variable

Description

fontPath

The source path of PDF font locatio.

Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_pdfa_fontpath() This function sets the PDF/A font location. Syntax int SNBDAPI CIMGLOW_set_pdfa_fontpath(String* fontPath); Remarks Table 23.6: CIMGLOW_set_pdfa_fontpath Function Variables Variable

Description

fontPath

PDF/A font location.

Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_pdfa_fontmap() This function sets PDF/A font mapping.. Syntax int SNBDAPI CIMGLOW_set_pdfa_fontmap(String* mapData, int len); Remarks Table 23.7: CIMGLOW_set_pdfa_fontmap Function Variables Variable

Description

mapData

Font mapping data string.

Len

Length of font mapping string.

172

Chapter 23 - AFP Font Mapping Functions

Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

173

Chapter 24 - Housekeeping Functions

Chapter 24 - Housekeeping Functions This chapter describes the RasterMaster .NET housekeeping functions.

CIMG_delete_bitmap() This function removes the image from memory when you are finished with it or when terminating the application. After a call to this function the image handle is no longer valid. This call should be used for each image handle generated by the library. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Annaction

l

Annotation

l

DocClean

l

Thumbnail

l

WPF Image

Note: Each call to acquire an image by decompressing or scanning will delete any previous image memory as long as you are using the same Snowbound object. When you are finished with an object and are no longer using it you must call the IMG_delete_bitmap () function to free up memory associated with the image header and data. Syntax int SNBDAPI CIMG_delete_bitmap(void); Returns Returns the status of the delete bitmap operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

174

Chapter 24 - Housekeeping Functions

CIMG_delete_bitmap_keep() This function can be used in conjunction with CIMG_create_handle_keep() to delete all internal library structures and data. It will not delete the pointer passed to CIMG_create_ handle_keep(). See CIMG_create_handle_keep() for more information. Syntax int SNBDAPI CIMG_delete_bitmap_keep(void); Returns This function returns a DDB or old-style Windows bitmap (HBITMAP or Device Dependent Bitmap). The original image is not altered.

CIMG_unload_plugins() This global function unloads all RasterMaster .NET plugins from memory. These plugins include snbdpl1.dll (the LZW plugin), pdfplug.dll (the PDF plugin), abic32.dll (the ABIC plugin), and more. Syntax int SNBDAPI CIMG_unload_plugins(void); Returns Returns the unloaded RasterMaster .NET plugins from memory. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION**

CIMGLOW_set_bitmap_name() This function sets a text string such as image name or author for the image, if the format supports it. Each buffer should be at least 200 bytes. Syntax int SNBDAPI CIMGLOW_set_bitmap_name(String *strName, String *strDate); Remark Table 24.1: CIMGLOW_set_bitmap_name Function Variables

175

Chapter 24 - Housekeeping Functions

Variable strName strDate

Description String to set name or author for any subsequent images to be saved String to set date for any subsequent images to be saved

Returns Returns the pointer to memory. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** Example 24.1 CIMGLOW_set_bitmap_name C#:status = simage.CIMGLOW_set_bitmap_name(strBMName, strDateInfo);

CIMGLOW_set_tiff_indexing()

CIMGLOW_set_tiff_indexing() This function sets the TIFF indexing page. Syntax int SNBDAPI CIMGLOW_set_tiff_indexing(int pages); Remark Table 24.2: CIMGLOW_set_tiff_indexing Function Variables Variable

Description

pages

The indexing page to set

Returns Returns the status of TIFF indexing page. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

176

Chapter 25 - DocClean Functions

Chapter 25 - DocClean Functions This chapter describes the RasterMaster .NET DocClean functions. DocClean is an optional extension of RasterMaster .NET that provides a group of functions that are useful for cleaning up scanned color, grayscale and black and white images.

CIMG_auto_orient() This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you may want to fix the image by using CIMG_rotate_bitmap(). See CIMG_rotate_bitmap() for more information. Syntax int SNBDAPI CIMG_auto_orient(int32 *p_angle); Remark Table 25.1: CIMG_auto_orient Function Variables Variable p_angle

Description Angle returned as the current orientation. Number of pixels to add to the autocrop rectangle. Either 90 or 0 is returned.

Returns Returns the status of the auto orient detection operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_deskew_bitmap() When a page is scanned in it may be skewed to some degree. This function uses the angle returned from CIMG_get_deskew_angle() to do the rotation. An angle of 0 means there is no skew. If the angle is not zero, you can provide the deskew angle returned from CIMG_deskew_ bitmap to rotate the page so it no longer appears skewed. Note: When a call is made to CIMG_deskew_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_deskew_bitmap(int angle);

177

Chapter 25 - DocClean Functions

Remark Table 25.2: CIMG_deskew_bitmap Function Variable Variable angle

Description Angle value set.

Returns Snowbound Error Code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 25.1 CIMG_deskew_bitmap nRes = snbdObj.CIMG_deskew_bitmap(nAngle);

CIMG_despeckle_bitmap() This function performs a function on the image to remove small specks or noise. Note: When a call is made to CIMG_despeckle_bitmap(), the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_despeckle_bitmap(int quality); Remark Table 25.3: CIMG_despeckle_bitmap Function Variable Variable

quality

Description Sets the coarseness of the amount of data to be filtered or removed. Quality factor 1 - 100 1 = Remove only single pixels 100 = Removes large black areas

Returns Returns the status of the despeckle operation. May return a FORMAT_NOT_ALLOWED error message for 4 or 8-bit color palette images.A value of 0 indicates success. Any value less than

178

Chapter 25 - DocClean Functions

zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 25.2 CIMG_despeckel_bitmap nRes = snbdObj.CIMG_despeckel_bitmap(quality);

CIMGLOW_auto_invert() This function inverts the colors of the image if the passed background color is found to not be the dominant and presumably the background color of the image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_auto_invert(int red, int green, int blue, int colourTolerance, double mismatchTolerance); Remark Table 25.4: CIMGLOW_auto_invert Function Variables Variable

red

green blue colourTolerance

mismatchTolerance

Description 24-bpp: Red component of the detection color or the full background color for 1, 4 and 8-bit per pixel images. May have the value of [0-255]. 1-bpp/4-bpp/8bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color. Ignored for non-24-bpp images. May have the value of [0-255]. Blue component of the detection color. Ignored for non-24-bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear distance value. Mismatch tolerance percentage. If negative, it will default to 75. An example of a valid value is 50.26. If the percentage of background pixels on the page is less than the mismatch tolerance, the image will not be inverted.

179

Chapter 25 - DocClean Functions

Returns Returns 1 if the image is inverted and 0 if the image is not inverted. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_detect_blank_page() This function can be used to detect blank pages. It can also be used to detect pages that are essentially blank though there are some scan artifacts or other “dirt” on them. This function returns the percentage of pixels present that are not equal to the passed detection or background color. If autodetect is set to 1, then the detection or background color will be determined automatically and will correspond to the dominant color in the image. The tolerance value can be set to allow for a more lenient color matching the algorithm. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax double SNBDAPI CIMGLOW_detect_blank_page(int autodetect, int red, int green, int blue, int tolerance, int isLowQuality, int isLowMemory, Double* pctMismatch); Remark Table 25.5: CIMGLOW_detect_blank_page Function Variables Variable autodetect

red

green blue tolerance

isLowQuality isLowMemory

180

Description Auto-detect the background color (0: no; 1: yes). 1 will force the system to ignore the passed color. 24-bpp: Red component of the detection color. May have the value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color. Ignored for non24-bpp images. May have the value of [0-255]. Blue component of the detection color. Ignored for non24-bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear distance value. Use this value in comparing background pixels. This number is in the range [0-255]. Execute the low-quality version of the autodetect algorithm (0: no; 1: yes). The low-quality version will not guarantee the global maximum, but it will execute much faster. The tolerance level is not taken into consideration. Execute the low-memory version of the autodetect

Chapter 25 - DocClean Functions

Variable

Description algorithm (0: no; 1: yes). The low-memory version will not guarantee the global maximum. The tolerance level is not taken into consideration. This setting is only for 24-bpp images. The percentage of pixels on the page that is not equal to the background color. If the percentage is zero or near zero, the page is blank.

pctMismatch Note: The percentage is a floating point number. For example, a return value of 50.26 means 50.26% of the page is non-blank. Returns Returns 1 if the function returns no error. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_image_dilation()  This function performs image dilation on the specified image. This function will thicken the content of an image making lines and text thicker. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_image_dilation(int coarseness); Remark Table 25.6: CIMGLOW_image_dilation Function Variable Variable coarseness

Description The coarseness or amount of dilation.

Returns Returns the status of the image dilation operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes.

181

Chapter 25 - DocClean Functions

CIMGLOW_image_erosion()   This function performs image erosion on the specified image. This function will thin the content of an image making lines and text thinner. This can be used to remove artifacts introduced by scanning. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_image_erosion(int quality); Remark Table 25.7: CIMGLOW_image_erosion Function Variable Variable quality

Description The coarseness or amount of erosion.

Returns Returns the status of the image erosion operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_remove_halftone() This function removes small blobs from images. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_remove_halftone(int minSize, int maxSize); Remark Table 25.8: CIMGLOW_remove_halftone Function Variables Variable minSize maxSize

182

Description Minimum diameter of a blob. (This value should be at least 1.) Maximum diameter of a blob. (This value should be kept very small.)

Chapter 25 - DocClean Functions

Returns Returns the status of the halftone removal operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_remove_lines() This function horizontal and/or vertical lines from an image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_remove_lines(int horizontal, int vertical, int min_value); Remark Table 25.9: CIMGLOW_remove_lines Function Variables Variable horizontal vertical min_value

Description If set to 1, removes horizontal lines. If set to 1, removes vertical lines. The smallest possible value to be considered a line.

Returns Returns the status of the line removal operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_remove_holepunch() This function removes hole punches from specified areas on the page or automatically finds the hole punches. Specifying a fixed area to repair is faster than having the method find and fill the holes. This may be done manually by specifying the exact span of any hole punches along with the fill color. Alternatively, this may be done automatically where both the holes and the fill color are determined algorithmically. This function removes hole punches by filling in the hole area with a background color. The background color is passed in as red, green and blue or you can have the function automatically detect the background color.

183

Chapter 25 - DocClean Functions

You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Note: This will not work with alpha-channel enabled images. Syntax int SNBDAPI CIMGLOW_remove_holepunch(int autoDetectFillColour, int red, int green, int blue, int autoFindHoles, CIMG_RECT* holes[], int holeNum, CIMG_RECT* ROIs[], int ROIsNum, int minHoleDiameter, int maxHoleDiameter); Remark Table 25.10: CIMGLOW_remove_holepunch Function Variables Variable autoDetectFillColour

red

green

blue autoFindHoles

holes

holeNum

ROIs

184

Description Auto-detect the fill colour (0: no; 1: yes). 1 will force the system to ignore the passed fill color. 24-bpp: Red component of the detection color or the full background color for 1, 4 and 8-bit per pixel images. May have the value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color for 24-bit images. Ignored for non-24-bpp images. May have the value of [0-255]. Blue component of the detection color for 24-bit images. Ignored for non-24-bpp images.May have the value of [0-255]. Auto-detect the hole punches (0: no; 1: yes). 1 will force the system to ignore the passed holes. Array of hole punch spans to fill. If there are regions-ofinterest (ROI), then all holes which do not completely lie within an ROI are ignored. Simiarly, holes which span several ROIs but not a single ROI will be ignored. May be NULL when autoFindHoles is 1. Number of elements in the holes array. May be 0 when autoFindHoles is 1. Array of regions-of-interest (ROI). ROIs are areas where holes may span. If ROIs is NULL and the holes are not automatically found, then the entire image will be taken as the ROI. If ROIs is NULL and the holes are automatically found, then sensible ROIs will be determined algorithmically.

Chapter 25 - DocClean Functions

Variable ROIsNum minHoleDiameter maxHoleDiameter

Description Number of elements in the ROIs array. May be 0 when ROIs is NULL. Minimum diameter in pixels of any holes. This is only used when holes are automatically found. Maximum diameter in pixels of any holes. This is only used when holes are automatically found.

Returns Returns the number of holes found. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

185

Chapter 26 - Image Processing Functions

Chapter 26 - Image Processing Functions This chapter describes the RasterMaster .NET image-processing functions.

CIMG_antique_effect() This function converts color images to look as though they are antique photos. It replaces colors with sepia tones, which are reddish brown monochrome tints. When applied to a photo, they give the picture a warm, antique feeling. Note: This method only works with 24-bit color images. Syntax int CIMG_antique_effect(void);

CIMG_apply_profile() This function takes the input profile from the creating device, such as a scanner, and output profile for a printer or display and applies them to the image. If an input file is not available, the parameter can be set to to NULL or ZERO. Syntax int SNBDAPI CIMG_apply_profile(String **strInputProfile,String **strOutputProfile, int mode); Remarks Table 26.1: CIMG_apply_profile Function Variables Variable

Description

strInputProfile strOutputProfile mode

String buffer containing the input profile. String buffer containing the output buffer. For mode choices, see below.

Table 26.2: CIMG_apply_profile Variable Modes Mode

Description

0 1 2

Apply permanently to the image data. Apply only at display time.* Apply only at print time.*

186

Chapter 26 - Image Processing Functions

Mode

Description

3

Apply at display and print time.*

* Mode settings do not change the original image data. Returns Returns the status of the apply profile operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_auto_orient() This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you may want to fix the image by using CIMG_rotate_bitmap(). See CIMG_rotate_bitmap() for more information. Syntax int SNBDAPI CIMG_auto_orient(int32 *p_angle); Remark Table 26.3: CIMG_auto_orient Function Variable Variable

Description

p_angle

Angle returned as the current orientation. Number of pixels to add to the autocrop rectangle. Either 90 or 0 is returned.

Returns Returns the status of the auto orient operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_autocrop_bitmap() This function finds and clips any white border around the image on every side. The border is discarded and the image is resized to the new cropped rectangle plus the margin. The margin may be a value of 0. Note: This function only works with 1-bit images. If you use this function with an image that is not a 1-bit image, you will get a PIXEL_DEPTH_UNSUPPORTED (-21) error message. See Appendix H, Snowbound Error Codes for a list of error codes.

187

Chapter 26 - Image Processing Functions

Syntax int SNBDAPI CIMG_autocrop_bitmap(int margin_numofpixels); Remark Table 26.4: CIMG_autocrop_bitmap Function Variable Variable

Description

margin_numofpixels

Number of pixels to add to the autocrop rectangle

Returns Returns the status of the autocrop bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_create_thumbnail() This function creates a thumbnail with the correct pixel depth and automatically selects the correct resize function for the image. See CIMG_resize_bitmap() and CIMG_resize_bitmap_bicubic() for more information. To zoom larger, use CIMG_resize_bitmap(). To zoom to a smaller size, use CIMG_create_ thumbnail(). 1-bit images are converted to grayscale with our “scale to gray” algorithm. 8 and 24-bit images are resized with our bicubic interpolation algorithm. If you experience diminished quality when resizing, try calling CIMG_create_thumbnail to look at neighboring pixels when resizing for better quality. Use CIMG_create_thumbnail to preserve aspect ratio when converting to a thumbnail. This will create a gray scale aliased bitmap that must be saved with TIFF_LZW or TIFF_JPEG. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Thumbnail sample. Syntax int SNBDAPI CIMG_create_thumbnail(int width, int height); Remark Table 26.5: CIMG_create_thumbnail Function Variables Variable

Description

width height

New width of image in pixels New height of image in pixels

188

Chapter 26 - Image Processing Functions

Returns Returns the status of the create thumbnail operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_deskew_bitmap() This function uses the angle returned from CIMG_get_deskew_angle to do the rotation. This allows angle detection to be separate from the actual rotation in case the angle is 0 and no rotation is needed. See CIMG_get_deskew_angle() for more information. Note: When a call is made to CIMG_deskew_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_deskew_bitmap(int angle); Remark Table 26.6: CIMG_deskew_bitmap Function Variable Variable

Description

angle

Angle in degrees by which to rotate image

Returns Returns the status of the deskew bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_despeckle_bitmap() This function is a noise removal algorithm. Note: When a call is made to CIMG_despeckle_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_despeckle_bitmap(int value);

189

Chapter 26 - Image Processing Functions

Remark Table 26.7: CIMG_despeckle_bitmap Function Variable Variable

Description

value

Quality factor 1 - 100 1 = Remove only single pixels 100 = Removes large black areas

Returns Returns the status of the despeckle bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_dib_to_ddb() This function returns a DDB or old-style Windows bitmap (HBITMAP or Device Dependent Bitmap). The original image is not altered. Syntax DDB SNBDAPI CIMG_dib_to_ddb(int width, int height); Remark Table 26.8: CIMG_dib_to_ddb Function Variables Variable

Description

width height

Width of desired DDB Height of desired DDB

Returns DDB or old-style Windows bitmap (HBITMAP or Device Dependent bitmap). Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 26.1 CIMG_dib_To_ddb C#:IntPtr HBmp = simage.CIMG_dib_to_ddb(panImage.Width, panImage.Height);

190

Chapter 26 - Image Processing Functions

CIMG_dib_to_runs() This function converts the internal library image format from Windows DIB format to a Snowbound runs format. This only works for 1-bit bi-level images. Syntax int SNBDAPI CIMG_dib_to_runs(void); Returns Returns the status of the Snowbound runs format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_erase_rect() This function draws the specified color inside or outside the rectangle passed in. It is used for black border erasing or to permanently fill a solid color inside an image. Syntax int SNBDAPI CIMG_erase_rect(int x, int y, int width, int height, int color, int in_outflag); Remark Table 26.9: CIMG_erase_rect Function Variables Variable

Description

x y width height color

X start of rectangle in pixels Y start of rectangle in pixels width of the rectangle in pixels height of the rectangle in pixels Color to draw 1 = Draw inside rectangle 0 = Draw outside rectangle

in_outflag Returns

Returns the status of the erase rectangle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_flip_bitmapx() This function swaps horizontal pixels to produce a mirror image of the original image. It permanently changes the image in memory.

191

Chapter 26 - Image Processing Functions

You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMG_flip_bitmapx(void); Returns Returns the status of the flip bitmapx operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_flip_bitmapy() This function swaps vertical pixels to produce a mirror image of the original image. It permanently changes the image in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMG_flip_bitmapy(void); Returns Returns the status of the flip bitmapy operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_get_deskew_angle() This function detects the skew angle for 1-bit images by checking all angles starting at the start angle and continuing in one degree increments until the stop angle is reached. The example below uses -20 and 20 for starting and stopping angles. Your application may want to check for only positive or negative angles. Syntax int SNBDAPI CIMG_get_deskew_angle(int *angle, int start_degree, int end_degree); Remark Table 26.10: CIMG_get_deskew_angle Function Variables

192

Chapter 26 - Image Processing Functions

Variable

Description

angle start_degree end_degree

Pointer to integer to receive deskew angle Starting angle for which to check Ending angle for which to check

Returns Returns the status of the get deskew angle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_get_profile() This function gets an input profile from an image file. ICC profiles may be embedded in the image. In order to make an exact match, color profiles are created so that the identical color values can be printed or displayed. Supported file formats include: TIFF, JPEG, PICT, PDF, GIF and PNG. These formats can contain an embedded color profile. Syntax char * SNBDAPI CIMG_get_profile(String *strFile, String **strBuffer, int page, Int32 *ptrLength); Remarks Table 26.11: CIMG_get_profile Function Variables Variable

Description

strFile strBuffer page ptrLength

File name for the image to be read in from the profile. String buffer of the profile. Page number to be read in from the profile. Length of the buffer.

Returns Returns the character buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_histogram_equalize() This function is a histogram equalization which improves the dynamic range of 8 or 16-bit gray scale images by remapping pixels based on a probability algorithm. Syntax int SNBDAPI CIMG_histogram_equalize(void);

193

Chapter 26 - Image Processing Functions

Returns Returns the status of the histogram equalize operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_invert_bitmap() This function changes each bit in the image from 0 to 1 or from 1 to 0. This works well for inverting documents which have a black background. This permanently changes the image in memory. Syntax int SNBDAPI CIMG_invert_bitmap(void); Returns Returns the status of the invert bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_merge_annotation() This function merges a current annotation to an image object. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the WPFAnnotation_CSHARP sample. Syntax int SNBDAPI CIMG_merge_annotation(int iWidth, int iHeight); Remark Table 26.12: CIMG_merge_annotation Function Variables Variable

Description

iWidth iHeight

Image width. Image height.

Returns Returns the status of the merge annotations operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

194

Chapter 26 - Image Processing Functions

CIMG_merge_bitmap() This function permanently merges an image from disk with the image in memory using the boolean function specified by raster_operation. This opcode allows ANDing and ORing over the current image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMG_merge_bitmap(String *filename, int raster_operation, int x, int y); Remark Table 26.13: CIMG_merge_bitmap Function Variables Variable filename

Description Path/filename of disk image to merge onto the image in memory specified by the filename. ROP opcode obtained from the list below or the Windows SDK manual. 0 or SRCCOPY = Copies the source bitmap to the destination bitmap. 1 or SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. 2 or SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator.

raster_operation

3 or SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator. 4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. 5 or NOTSRCCOPY = Copies the inverted source bitmap to the destination. 6 or NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. 7 or MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. Note: These codes will not work in Unix. The valid Unix

195

Chapter 26 - Image Processing Functions

Variable

Description OP Codes are: GXclear CXand GXandReverse GXcopy GXandInverted GXnoop GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand 8 or MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. 9 or PATCOPY = Copies the pattern to the destination bitmap. 10 or PATPAINT = - Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. 11 or PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator. 12 or DSTINVERT = Inverts the destination bitmap. 13 or BLACKNESS = Turns all output black.

x y

14 or WHITENESS = Turns all output white. Pointer to integer to receive the starting x coordinate. Pointer to integer to receive the starting y coordinate.

Returns Returns the status of the merge bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_merge_bitmap() This function permanently merges an image from disk with the image in memory using the boolean function specified by raster_operation. This opcode allows ANDing and ORing

196

Chapter 26 - Image Processing Functions

over the current image. Syntax int SNBDAPI CIMG_merge_bitmap(Snowbnd *src, int raster_operation, int x, int y); Remark Table 26.14: CIMG_merge_bitmap Function Variables Variable src

Description Merges the source Snowbnd object image into the calling Snowbnd object at x and y with the specified raster operation ROP opcode obtained from the list below or the Windows SDK manual. 0 or SRCCOPY = Copies the source bitmap to the destination bitmap. 1 or SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. 2 or SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator. 3 or SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator.

raster_operation

4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. 5 or NOTSRCCOPY = Copies the inverted source bitmap to the destination. 6 or NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. 7 or MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. Note: These codes will not work in Unix. The valid Unix OP Codes are: GXclear CXand GXandReverse GXcopy GXandInverted

197

Chapter 26 - Image Processing Functions

Variable

Description GXnoop GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand 8 or MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. 9 or PATCOPY = Copies the pattern to the destination bitmap. 10 or PATPAINT = - Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. 11 or PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator. 12 or DSTINVERT = Inverts the destination bitmap. 13 or BLACKNESS = Turns all output black.

x y

14 or WHITENESS = Turns all output white. Pointer to integer to receive the starting x coordinate. Pointer to integer to receive the starting y coordinate.

Returns Returns the status of the merge bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_merge_bitmap_alpha() This function merges a 32-bit alpha channel image onto a normal 24-bit DIB using the transparency channel. Syntax int SNBDAPI CIMG_merge_bitmap_alpha(Snowbnd *src, CDIB_HEADER, *dib_header, int xpos, int ypos, int opaque);

198

Chapter 26 - Image Processing Functions

Remark Table 26.15: CIMG_merge_bitmap_alpha Function Variables Variable src dib_header xpos ypos opaque

Description Standard for snowbnd object 32-bit alpha channel image to merge Pointer to a CDIB_HEADER structure contains the image header. For more information, see public class CDIB_ HEADER. Starting x coordinate for which to merge image Starting y coordinate for which to merge image 1 = use transparency channel information to blend images 0 = do not draw any pixels with transparency channel information pixels set

Returns Returns the status of the merge bitmap alpha channel image operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_process_bitmap() This function is used to perform the image processing function. A simple 3 x 3 matrix is applied to the image for 8 and 24-bit images. If the value for the matrix pointer is not NULL, it assumes that it contains values to be applied to the image. This function is a Sobel image processing function. It can be used as a relatively inexpensive edge detection function or to enhance the image. The method parameter allows you to specify which method to use to enhance the image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Image Processing sample. Syntax int SNBDAPI CIMG_process_bitmap(int type, Array* matrix); Remark Table 26.16: CIMG_process_bitmap Function Variables Variable

Description Specify the type of filter to be performed

type

199

0 = User defined 3 * 3 matrix

Chapter 26 - Image Processing Functions

Variable

matrix

Description 1 = Isolate points 2 = Edge detection 3 = Horizontal edge detection 4 = Vertical edge detection 5 = 45 degree edge detection 6 = -45 degree edge detection 7 = Laplacian 8 = Dialation 9 = Roberts Cross Array that contains the operator value to apply to the image if it is not NULL, otherwise it returns the operator array.

Returns Returns the status of the process bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_remove_red_eye() This function detects and converts very red eyes in photos to more natural colors. Notes: If xpos, ypos, xsize, or ysize is set to -1, the entire photo is searched. For best results, refine the search area. Works only with 24-bit color images. Syntax int SNBDAPI CIMG_remove_red_eye(int x, int y, int width, int height); Remarks Table 26.17: CIMG_remove_red_eye Function Variables Variable

Description

x y width height

Starting top left area for x coordinate Starting top left area for y coordinate Width of area to search Height of area to search

200

Chapter 26 - Image Processing Functions

Returns Returns the remove red eye operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_resize_bitmap() This function scales the image up or down to the new height and width. This permanently changes the height and width of the image. To zoom larger, use CIMG_resize_bitmap(). To zoom to a smaller size, use CIMG_create_thumbnail(). To preserve aspect ratio: hres is the destination width. vres the destination height. Set the width and height to the original width and height of the image after decompress as shown in the following example: Example 26.2 Preserving Aspect Ratio vres = (int)((long)height * hres / width); CIMG_resize_bitmap(hres,vres);

Note: IBM AFP printers require the width of an image to be an exact multiple of 8. To be on the safe side, set the width to a multiple of 8. Syntax int SNBDAPI CIMG_resize_bitmap(int width, int height); Remark Table 26.18: CIMG_resize_bitmap Function Variables Variable

Description

width height

New width of image New height of image

Returns Returns the resize bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

201

Chapter 26 - Image Processing Functions

CIMG_resize_bitmap_bicubic() This function uses a bicubic interpolation algorithm to scale down images. This is good for creating high-resolution thumbnails of color images. If this function returns an error such as PIXEL_DEPTH_UNSUPPORTED or PALETTE_ IMAGES_NOT_ALLOWED, then try using CIMG_create_thumbnail() function because that will take a wider variety of input bit-depths than CIMG_resize_bitmap_bicubic function. Syntax int SNBDAPI CIMG_resize_bitmap_bicubic(int width, int height); Remark Table 26.19: CIMG_resize_bitmap_bicubic Function Variables Variable

Description

width height

Width of image in pixels Height of image in pixels

Returns Returns the resize bitmap bicubic interpolation algorithm operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_resize_bitmap_interp() This function scales the image up or down to the new height and width. The interp averages neighboring pixels for scaling down all image types. This permanently changes the height and width of the image. Syntax int SNBDAPI CIMG_resize_bitmap_interp(int width, int height); Remark Table 26.20: CIMG_resize_bitmap_interp Function Variables Variable

Description

width height

New width of image New height of image

202

Chapter 26 - Image Processing Functions

Returns Returns a FORMAT_NOT_ALLOWED error message for images with a bit-depth of 4. Returns a PALETTE_IMAGES_NOT_ALLOWED error message for color 8-bit images. May return a OUT_OF_MEMORY error message. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_rotate_bitmap() This function permanently rotates the image buffer in memory by the specified angle. The value is in hundredths of degrees. For example, for 90 degrees use 9000. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Alpha

l

ASP Image View

Note: It is expected behavior that the image is smaller in each rotation using IMG_rotate_ bitmap. If an image is rotated by 90 degrees, RasterMaster .NET flips from portrait to landscape (or vice-versa) and preserves the page content. If the image is rotated by something other than 90 degrees, RasterMaster .NET shrinks the page so that all the content is preserved. RasterMaster .NET does not crop the edges during the rotation. Syntax int SNBDAPI CIMG_rotate_bitmap(int angle); Remark Table 26.21: CIMG_rotate_bitmap Function Variable Variable

Description

angle

Rotation in hundredths of degrees

Returns Returns the rotate bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

203

Chapter 26 - Image Processing Functions

CIMG_runs_to_dib() The RasterMaster .NET library stores all 1-bit images as a series of runs. A call to this function forces the image to be stored as raw uncompressed data. This function only works for 1-bit images. Syntax int SNBDAPI CIMG_runs_to_dib(void); Returns Returns the stored raw uncompressed data operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_set_display_angle() This function rotates the angle of the image at display time when calling CIMG_display_bitmap_aspect(). The original image data is not affected. See CIMG_display_bitmap_aspect() for more information. To save the image as rotated, use CIMG_rotate_bitmap(). The image is permanently rotated in memory. See CIMG_rotate_bitmap() for more information. Use this function on all image types for fast rotation. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Alpha sample. Syntax int SNBDAPI CIMG_set_display_angle(int rotate_angle); Remark Table 26.22: CIMG_set_display_angle Function Variable Variable

Description

rotate_angle

Rotates image by 0, 90, 280 or 270

Returns Returns the set display angle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

204

Chapter 26 - Image Processing Functions

CIMG_sharpen_bitmap() This function sharpens or blurs the image. Positive values sharpen the image using a Laplacian function while negative values blur the image using an image-averaging filter. Syntax int SNBDAPI CIMG_sharpen_bitmap(int sharpness); Remark Table 26.23: CIMG_sharpen_bitmap Function Variable Variable

Description

sharpness

Integer value from -127 to 127

Returns Returns the sharpen bitmap operation. A value of 0 indicates success. Returns a FORMAT_ NOT_ALLOWED error message for 1-bit (black and white) images and for 4-bit or 8-bit color images. Returns an OUT_OF_MEMORY error if there is not enough memory to complete the operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_palette() This function returns the palette entries of the specified image into an array of RGBQUAD structures. l

1-bit images = 2 entries

l

4-bit images = 16 entries

l

8/24-bit images = 256 entries

24-bit images have no palettes but the autocolor or rainbow palette is returned. Syntax int SNBDAPI CIMGLOW_get_palette(Array *arrRGBQuad); Remark Table 26.24: CIMGLOW_get_palette Function Variables Variable

Description

arrRGBQuad

Array of RGBQUAD structures

205

Chapter 26 - Image Processing Functions

Returns Returns the get palette operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_get_raster() This function gets a line of raw data from the line number specified by ypos. Syntax int SNBDAPI CIMGLOW_get_raster(Array *data, int ypos, int bytes); Remark Table 26.25: CIMGLOW_get_raster Function Variables Variable

Description

data ypos

Buffer to receive a line of raw raster data. Line number of raster to get. Returns no more than this number of bytes. If set to -1, it calculates the number of bytes in one line and returns that amount.

bytes

Returns Returns no more than the number of bytes specified. If set to -1, the number of bytes in one line are calculated and returned.

CIMGLOW_put_palette() This function sets the palette entries of the specified image from an array of RGBQUAD structures. l

1-bit images = 2 entries

l

4-bit images = 16 entries

l

8/24-bit images = 256 entries

Syntax int SNBDAPI CIMGLOW_put_palette(IMG_RGBQUAD *input_prgb); Remark Table 26.26: CIMGLOW_put_palette Function Variables

206

Chapter 26 - Image Processing Functions

Variable

Description

input_prgb

Pointer to array of RGBQUAD structures

Returns Returns the put palette operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_put_raster() This function puts a line of raw data into the DIB specified by data at the ypos line number. Syntax int SNBDAPI CIMGLOW_put_raster(Array *data, int ypos, int bytes); Remark Table 26.27: CIMGLOW_put_raster Function Variables Variable

Description

data ypos bytes

Buffer of raw to data to put into DIB Line number in which to put data Replaces no more than this number of bytes

Returns Returns the put raster operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMGLOW_set_fast_convert() This function greatly improves performance for decompression and conversion. Pages must be decompressed sequentially. This function can be used with any of the decompression functions, either from File I/O based or memory. To turn this function on, set the off_on value to 1. To reset this function, set the off_on value to 0. This function makes the decompression functions non-reentrant or no longer thread safe when turned on. Note: This function currently only works with MO:DCA or AFP images. Syntax int SNBDAPI CIMGLOW_set_fast_convert(int off_on, int format);

207

Chapter 26 - Image Processing Functions

Remark Table 26.28: CIMGLOW_set_fast_convert Function Variables Variable off_on format

Description 0 = Off 1 = On Sets the format

Returns Returns the set fast conversion operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

208

Chapter 27 - Document Conversion and Text Extraction Functions

Chapter 27 - Document Conversion and Text Extraction Functions This chapter describes the functions used for document conversion and text extraction.

Document Conversion and Text Extraction The document conversion DLL extracts and converts vector or document file formats such as AFP/MO:DCA, PCL, and MS Word to vector PDF format. The PDF file will be in a true vector format, meaning that it will not be in a bitmap format. The PDF file will retain the original text and graphics commands. Font information such as the font typeface, font height, and bold/Italic attributes will remain the same. This allows the output PDF file to be created as text searchable. The PDF file created can be searched for words or phrases with the use of a text searching application. Currently, only AFP/MO:DCA, MS Word, Excel and PCL formats are supported. Conversion and text extraction occur in the following two step process: 1. A call is made to extract the text, graphics, and bitmap data. The CIMGLOW_extract_ text() function extracts text, graphics, and position information from the file name passed in. The buffer returned is used as an argument in the call to write out the new PDF file. See CIMGLOW_extract_text() for more information. 2. The CIMG_save_document() function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_bitmap() functions only create a bitmap file. This only supports the PDF file as an output file. See CIMG_save_document() for more information.

CIMGLOW_extract_text() This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files. It returns the buffer of extracted text in ASCII format. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l

Convert_Doc

l

Text Search

209

Chapter 27 - Document Conversion and Text Extraction Functions

Syntax int SNBDAPI CIMGLOW_extract_text(String *strFileName, Byte *arrBuffer, int *ptrLength, int page); Remark Table 27.1: CIMGLOW_extract_text Function Variables Variable

Description

*strFileName *arrBuffer *ptrLength page

Name of file from which to extract text Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text

Returns Returns the buffer of extracted text in ASCII format. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 27.1 CIMGLOW_extract_text %%SOF /Page=0 /Width=1700 /Height=2200 /FontName=TimesRoman /FontHeight=44 /FontBold=1 /FontItalic=0 /Xpos=1290 /Ypos=240 %%SOT Devadas %%EOT /Xpos=1253 /Ypos=240 %%SOT S. %%EOT %%EOF %%SOI %%EOI Table 27.2: Extracted Text Variable Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters.

210

Chapter 27 - Document Conversion and Text Extraction Functions

Variable

Description

%%SOF %%EOF

Signals the start of the buffer Marks the end of extracted text Specified once at the beginning of the file to indicate the page number Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate page height in pixels Name of font Font height in pixels Font to be drawn plain or in bold 1 = bold 0 = plain Font to be drawn in normal or italic 1 = italic 0 = normal X pos in pixels Y pos in pixels Start of text block End of text block Start of image End of image Start of Text Unicode/UTF. End of Text Unicode/UTF.

Page Width Height Font Name FontHeight FontBold

FontItalic Xpos Ypos %%SOT %%EOT %%SOI %%EOI %%SOTU %%EOTU

CIMGLOW_extract_text_mem() This function extracts text from memory. It returns the buffer of extracted text in ASCII format. Syntax int SNBDAPI CIMGLOW_extract_text_mem(Array *arrImage, Byte *arrBuffer, int *ptrLength, int page); Remarks Table 27.3: CIMGLOW_extract_text_mem Function Variables Variable

Description

*arrImage *arrBuffer

Memory array to image data Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text

*ptrLength page

Table 27.4: Extracted Text Variable

211

Chapter 27 - Document Conversion and Text Extraction Functions

Variable

Description

Ypos Xpos

Y pos in pixels X pos in pixels Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate the page number Specified once at the beginning of the file to indicate page height in pixels Font to be drawn in normal or italic 1 = italic 0 = normal Font height in pixels Font to be drawn plain or in bold 1 = bold 0 = plain Name of font Start of text block Signals the start of the buffer End of text block Marks the end of extracted text

Width Page Height FontItalic FontHeight FontBold Font Name %%SOT %%SOF %%EOT %%EOF Returns

Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_save_document() This function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_bitmap() function only creates a bitmap file. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Convert_Doc sample. Syntax int SNBDAPI CIMG_save_document(String *strName, char *buff, int filetype);

212

Chapter 27 - Document Conversion and Text Extraction Functions

Remarks Table 27.5: CIMG_save_document Function Variables Variable

Description

*strName buff filetype

Name of the output PDF file Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59

Returns Returns the document file output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 27.2 Data Format for Extracted Text Buffer for both Windows and Java The coordinates system is originated at the upper left. X - Represents a floating point argument. As in 12.012, all of these arguments are in points of 1/72 of an inch. Text - Represents an ASCII string argument. STREAM COMMANDS and format of extracted file %%SOF- Start of file /PageNumber=XPage number being extracted. /PageWidth=XWidth of page in points. (1/72 of an inch) /PageHeight=XHeight of page in points. (1/72 of an inch) %%EOFMarks the end of this file. No more data to process. /FontStart of font data and attributes. /FontName=TextStandard font face name. /FontHeight=XFont height in points (1/72 of an inch). /FontBold=XSet to 1 for bold font otherwise 0. /FontItalic=XSet to 1 for Italic font otherwise 0. /Xpos=XX starting coordinate of text string. /Ypos=XY starting coordinate of text string. %%SOTStart of a text string after the carriage return. Text Data here %%EOTEnds a text string. /ImageStart of image data and attributes. /ImageWidth=XWidth in pixels of the image data. /ImageHeight=XHeight in pixels of the image data. /Bitsperpixel=XNumber of bits per pixel. /Compression=TextCompression type used. CCITT_G4, JPEG, or NONE. /Length=XLength of binary image data. %%SOIStarts the binary image data. Binary data here

213

Chapter 27 - Document Conversion and Text Extraction Functions

%%EOIEnds the binary image data. /DrawImage Xs Ys Width HeightDraws the last defined image at the location specified by the arguments. /Moveto XS YSMoves current graphics drawing position. /LineXS YSDraws a line from current graphics                                drawing position to a location specified by the arguments. /Rectangle XS YS WIDTH HEIGHT Draws a rectangle at the specified coordinates. /Curve X1 Y1 X2 Y2 X3 Y3Draws a curve from the current graphics drawing position to the end coordinates using the first 4 arguments as guide points.

CIMG_save_document_mem() This function takes a buffer passed in with text, graphics, and position information obtained from CIMGLOW_extract_text_mem() to save the document file output to memory. The output file contains searchable text. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Convert_Doc sample. Syntax int SNBDAPI CIMG_save_document_mem(Array *imgArray, Array *buffArray, int filetype)); Remarks Table 27.6: CIMG_save_document_mem Function Variables Variable

Description

*imgArray buffArray filetype

Memory array already allocated Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59

214

Chapter 27 - Document Conversion and Text Extraction Functions

Returns Returns the exact document size saved in memory. Returns a 0 or positive value on success in RasterMaster .NET version 17.9.8 or earlier. Returns the number of bytes saved in RasterMaster .NET version 17.9.9 or later. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

215

Chapter 28 - Color Promotion Functions

Chapter 28 - Color Promotion Functions This chapter describes the RasterMaster .NET color promotion functions. Generally adding more color depth to an image will use significantly more space and the larger image will take more time to process. However, there are circumstances when a black and white or grayscale image needs to be promoted to color, or a color space needs to be changed in order to make an image consistent with other pages in a document. AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use CIMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance.  If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Formats for details on which formats support color information at different bitdepths. This chapter lists the functions from the functions that save images with less color (smaller size) to more color (largest output depth): CIMG_promote_8() CIMG_promote_24() CIMG_promote_32() This chapter also lists the following functions that change color spaces: CIMG_rgb_to_cmyk() CIMG_cmyk_to_rgb() CIMG_color_combine() CIMG_color_separate() CIMGLOW_get_tiff_tag()

CIMG_promote_8() This function permanently converts a 1 or 4-bit image to an 8-bit image in the current DIB. Syntax int SNBDAPI CIMG_promote_8(void);

216

Chapter 28 - Color Promotion Functions

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_promote_24() This function permanently converts a 1, 4, or 8-bit image to a 24-bit image in the current DIB. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMG_promote_24(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

CIMG_promote_32() This function converts a 1, 4, 8, or 24-bit image to a 32-bit alpha channel image. 32-bit alpha images contain 24 bits of red, green, and blue planes (8-bits each), and an extra (8-bits) alpha channel plane for transparency. Syntax int SNBDAPI CIMG_promote_32(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

Changing Color Spaces Functions CIMG_rgb_to_cmyk() This function converts 24-bit RGB data to 32-bit CMYK data. RasterMaster .NET products support full 32-bit CMYK data as an internal 32-bit DIB format. The black plane is created. Syntax int SNBDAPI CIMG_rgb_to_cmyk(void);

217

Chapter 28 - Color Promotion Functions

Returns Returns the status of the convert RGB to CMYK operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_cmyk_to_rgb() This function converts the 32-bit CMYK data to 24-bit RGB data. RasterMaster .NET supports full 32-bit CMYK data as an internal 32-bit DIB format. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_cmyk_to_rgb(void); Returns Returns the status of the convert CMYK to RGB operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_color_combine() This function combines 3 or 4 planes into a new 24 or 32-bit image. If the 4th argument is a valid handle, a 32-bit CMYK image is created. If the 4th argument is not valid or -1, a 24-bit RGB image is created. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_color_combine(Snowbnd *dest, Snowbnd *blue_handle, Snowbnd *green_handle, Snowbnd *red_handle, Snowbnd *k_handle, int planes_num); Remark Table 28.1: CIMG_color_combine Function Variables

218

Chapter 28 - Color Promotion Functions

Variable blue_handle green_handle red_handle k_handle planes_num

Description Standard for 8-bit gray-scale image which represents the blue plane (cyan). Standard for 8-bit gray-scale image which represents the green plane (magenta). Standard for 8-bit gray-scale image which represents the red plane (yellow). Standard for 8-bit gray-scale image which represents the black plane (black). If negative, creates a 24-bit RGB image. Number of planes for resulting image.

Returns Returns the status of the color combine operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_color_separate() This function gets an individual plane of color data and returns a new RasterMaster .NET handle. The new color plane is an 8-bit gray scale image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_color_separate(Snowbnd *dest, int plane); Remark Table 28.2: CIMG_color_separate Function Variables Variable

Description The plane can be one of the following:

plane

For 32 bitcmyk planes are: 0 = cyan 1 = magenta 2 = yellow 3 = black For 24-bit rgb planes are: 0 = blue 1 = green 2 = red

219

Chapter 28 - Color Promotion Functions

Returns Returns the status of the color separate operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_tiff_tag()

CIMGLOW_get_tiff_tag() This function reads a TIFF tag from the file specified by bm_name. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. A return value of 0 indicates a non-string value. You can use the TIFF tag to get the colorspace type by specifying tag #262. Syntax int SNBDAPI CIMGLOW_get_tiff_tag(int tag, int max_bytes, int *ptr_ value, String *strFileName, String *strBuff); Remark Table 28.3: CIMGLOW_get_tiff_tag Function Variables Variable

Description

tag max_bytes ptr_value strFileName strBuff

TIFF tag number to return Maximum bytes to read for string tags Pointer to tag value returned Filename to read tags from String buffer for returning string tags

Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 28.1 CIMGLOW_get_tiff_tag Value is what is returned. For this tag you will not need the bytearray. int tag_no = 262; int max_bytes = 0; int[] value = new int[1]; byte[] data = null; myFrame.Simage.CIMGLOW_get_tiff_tag(tag_no, max_bytes, value,

220

Chapter 28 - Color Promotion Functions

st, data, page); /* PHOTOMETRIC INTERPRETATION */ #define TIFF_PHOTO_WHITE_IS0 0 #define TIFF_PHOTO_WHITE_IS1 1 #define TIFF_PHOTO_RGB 2 #define TIFF_PHOTO_PALETTE 3 #define TIFF_PHOTO_TRANSP 4 #define TIFF_PHOTO_CMYK 5 #define TIFF_PHOTO_YCC 6 #define TIFF_PHOTO_CIELAB 8

221

Chapter 29 - Color Reduction Functions

Chapter 29 - Color Reduction Functions This chapter describes the RasterMaster .NET color reduction functions. The quality of the conversion is determined by the input and output dots per inch resolution and the output compression type. Use color reduction functions to create a lower image quality that is smaller in size and is speedier to process. If you go from a higher to a lower resolution or a lossy compression type, then the quality of the image will degrade. This chapter lists the functions that save images with more color (largest output depth) to less color (smaller size).

CIMG_color_gray() This function permanently converts a 4, 8, or 24-bit image to an 8-bit gray scale image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_color_gray(void); Returns Returns the status of the grayscale image operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_resize_to_gray() This function resizes down a 1-bit image to an 8-bit grayscale image using the scale to gray anti-aliasing algorithm. This converts a 1-bit image to an 8-bit suitable image for saving as a JPEG file format. This function is excellent for creating small thumbnails for large documents or 1-bit images. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images.

222

Chapter 29 - Color Reduction Functions

Syntax int SNBDAPI CIMG_resize_to_gray(int width, int height); Remark Table 29.1: CIMG_resize_to_gray Function Variables Variable

Description

width height

Destination width of image to resize Destination height of image to resize

Returns Returns the status of the resize to gray operation. A value of 0 indicates success. Returns a PIXEL_DEPTH_UNSUPPORTED error message if the image has a bit depth of more than one if the image is not black and white. May return an OUT_OF_MEMORY error message. Returns an OUT_OF_MEMORY error if there is not enough memory to complete the operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_popularity_color() This function permanently converts a 24-bit image to an 8-bit per pixel image using the popularity algorithm. The popularity algorithm chooses 256 of the most populous colors from the image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_popularity_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

223

Chapter 29 - Color Reduction Functions

CIMG_mediancut_color() This function permanently converts a 24-bit image to an 8-bit per pixel image using a combination of the popularity algorithm and error diffusion. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_mediancut_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_octree_color() This function converts 4, 8, or 24-bit images into 4 or 8-bit as specified. It uses a complex octree function to reduce to the best palette and number of colors chosen, or reduces the image to the palette passed into input_prgb if the pointer is not NULL. This is by far the best color reduction algorithm in the library. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_octree_color(int bits_per_pixel, IMG_RGBQUAD *input_prgb, int entries); Remark Table 29.2: CIMG_octree_color Function Variables Variable

Description

bits_per_pixel

Pixel depth to convert to: 4 or 8

224

Chapter 29 - Color Reduction Functions

Variable

Description

input_prgb

Pointer to array of RGBQUAD structures Number of colors to reduce 1 - 16 for 4-bit images 1 - 256 for 8-bit images

entries

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 29.1 CIMG_octree_color C#:status = simage.CIMG_octree_color(4, null, 16)

CIMG_bayer_color() This function permanently converts an 8 or 24-bit image to a 4-bit per pixel image using a 16 by 16 Bayer matrix dither. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_bayer_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_bayer_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a Bayer fixed matrix dithering technique. Note: The quality of the conversion to black and white or grayscale can be enhanced by

225

Chapter 29 - Color Reduction Functions

specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_bayer_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_diffusion_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel using the Stucky error diffusion technique. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. CIMG_decompress_bitmap must be called before CIMG_diffusion_mono. It is designed for use on rasterized pages. It cannot be used on pages with vector content created by CIMGLOW_extract_text. Syntax int SNBDAPI CIMG_diffusion_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_thresh_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a threshold passed as the second argument. Note: The quality of the conversion to black and white or grayscale can be enhanced by

226

Chapter 29 - Color Reduction Functions

specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_thresh_mono(int threshhold); Remark Table 29.3: CIMG_thresh_mono Function Variable Variable

Description

threshhold

Threshold value to use. The range is from 1 - 255.

Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes.

CIMG_halftone_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a fixed halftone matrix dithering technique. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_halftone_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_detect_color()

227

Chapter 29 - Color Reduction Functions

CIMGLOW_detect_color() This function checks all pixels to determine if the image is color or gray scale. In documents with a mix of black and white and color pages, you can improve performance and reduce the output document size by ensuring the black and white pages are saved as 1-bit per pixel (monochrome) rather than 24-bits per pixel (color). Use this function to detect the presence of grayscale or color pixels on the current page. If the bit depth returned by this method is less than the bit-depth returned by CIMG_bitmap_info() in biBitCount, then you should consider converting to a lower bit per pixel format. Snowbound Software recommends converting to CCITT_TIFF_G4 format for black and white text images. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int CIMGLOW_detect_color(int); Returns Returns the bits per pixel of the image. If this function returns 1, then this image contains only black and white pixels. If this function returns 8, then this image contains grayscale data such as black and white photo or shaded graphics. If this function returns 24, then this image contains at least some content that uses full color. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 29.2 CIMGLOW_get_pages page_count = CIMGLOW_get_pages("file.pdf"); for (x = 0; x < page_count; x++) { status = CIMG_decompress_bitmap_page("file.pdf",x); bitspix = CIMGLOW_detect_color(); if (bitspix == 24) status = CIMG_save_bitmap(imghandle,"c:\\temp\\mixed.tif",TIFF_JPEG); else { if (bitspix == 8) CIMG_thresh_mono(128); status = CIMG_save_bitmap("c:\\temp\\mixed.tif",TIFF_G4_FAX);

228

Chapter 29 - Color Reduction Functions

} CIMG_delete_bitmap();

229

Chapter 30 - ASCII Formats and Functions

Chapter 30 - ASCII Formats and Functions This chapter describes the structure for defining Snowbound’s available ASCII attributes and functions. The ASCII text format is not auto-detected by default. You may get a -7 FORMAT_NOT_ ALLOWED error when trying to convert the ASCII text format. To enable auto-detection of the ASCII text format, call the CIMGLOW_set_auto_detect() function with the file type number set to 38 for the ASCII file format before you get pages or decompress. Please see the example below:  CIMGLOW_set_auto_detect(38) This chapter contains the following topics: ASCII Attribute Structure CIMG_import_ascii() CIMGLOW_get_ascii_attributes() CIMGLOW_get_ascii_page_width() CIMGLOW_set_ascii_attributes()

ASCII Attribute Structure Below is the structure for defining Snowbound ASCII attributes.

230

Chapter 30 - ASCII Formats and Functions

Syntax Example 30.1 ASCII Attributes public class CASCIITEXTATTR { public: int asciiFlags; int asciiXDpi; int asciiYDpi; CIMG_RECT *asciiMargin; int asciiTabStop; int asciiPageWidth; int asciiPageHeight; int asciiPointSize; int asciiCharsPerLine; int asciiLinesPerPage; int asciiWeight; int asciiItalic; String *asciiTypeFace; CASCIITEXTATTR(); void reset(); };

Remark Table 30.1: public class CASCIITEXTATTR Variables Variable

Default

int asciiFlags int asciiXDpi int asciiYDpi

0 Determines which fields to use 200 Horizontal dots per inch 200 Vertical dots per inch if (asciiMargin == 0)

CIMG_RECT *asciiMargin

int asciiTabStop int asciiPageWidth

231

Description

asciiMargin = new CIMG_RECT(); asciiMargin->left = 1000; Margins in 1/1000 inches asciiMargin->right = 1000; asciiMargin>top = 750; asciiMargin->bottom = 750; Number of characters between 8 tab stops 8500 Width of page in 1/1000 inches

Chapter 30 - ASCII Formats and Functions

Variable

Default

Description

int asciiPageHeight int asciiPointSize int asciiCharsPerLIne int asciiLinesPerPage

11000 -1 80 60

int asciiWeight

0

int asciiItalic

0

String *asciiTypeFace

Courier New

Height of page in 1/1000 inches Point size of the font Number of characters per line Number of lines per page Normal=0 Bold=1 Normal=0 Italic=1 Name of the font to use

Table 30.2: ASCIITEXTATTR Function Flags 1L General > Security, and click Unblock. Then re-launch Visual Studio and attempt to build the application once again.

Color Documents Rendered as Black and White    AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use IMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance. If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Format for details on which formats support color information at different bitdepths.

Upgrading to the RasterMaster .NET 18.0 Library If you are upgrading from the RasterMaster .NET base library to the new RasterMaster .NET 18.0 library, you will need to replace references to sbdnet.dll with SbdNetAnn.dll.

362

Appendix H - Troubleshooting

Getting RasterMaster .NET x32 to work with IIS 7.5 Follow the steps below to make it easier to use the RasterMaster .NET x32 evaluation build with IIS 7.5 and ASP.NET: 1. Make sure that you are targeting the x86 platform. For C# projects, go to Project Properties > Build. Choose x86 as the Platform Target. For Visual Basic projects, go to Project Properties > Compile > Advanced Compile Options > Advanced Compiler Settings. Choose x86 as the Platform Target. 2. Make sure this is set to true in your application configuration:

3. If you are still having issues, our VirtualViewer .NET AJAX installer provides the Visual C++ 2005 redistributables from Microsoft. This may be what you need to get the Office plug-in working successfuly with IIS 7.5. Please use the following link to download the C++ 2005 redistributables from Microsoft if you need them: http://download.cnet.com/Microsoft-Visual-C-2005-Redistributable-Package-x86/3000-2070_ 4-10726885.html

363

Appendix I - TIFF Tags

Appendix I - TIFF Tags This appendix describes the tags in the header and in Image File Directories (IFDs) used by TIFF (tagged image file format) files to declare and describe their content. Each TIFF file begins with a image file header which points to one or more image file directories which contain the image data and image information. To call the TIFF tags in RasterMaster .NET, use the CIMGLOW_get_tiff_tag() function. This function reads a TIFF tag from the file specified by bm_name. To set the TIFF tags in RasterMaster, use the CIMGLOW_set_tiff_tag() function. This function reads a TIFF tag from the file specified by bm_name.This function writes new tags as well as all current tags. The TIFF file format was created by an independent group and was supported by Aldus. .TIF files can be any number of bits per pixel, planes and several compression algorithms. The byte order may be Intel or Motorola format. The bytes may also be filled from right to left or left to right. Compression may be uncompressed, pack bits, LZW, modified Huffman, CCITT G4, CCITT G3, CCITT G3-2D or JPEG. The CCITT G4 file format only saves to black and white. If you have any questions about the TIFF file format and the tags described below, you may contact Snowbound Technical support on the web at http://support.snowbound.com .

Sources for Tag Specifications The following are descriptions of the types of the sources of the tags: TIFF Baseline: The baseline set of tags were documented in TIFF 5.0 and carried over on pages 11-47 of the 1992 TIFF 6.0 specification. TIFF Extended: The extended set includes some additional tags and added values for existing tags, as documented on pages 48-115 of the TIFF 6.0 specification. TIFF Private: Originally, the term private meant just that. The TIFF 6.0 specification (page 8) states, “An organization might wish to store information meaningful to only that organization . . . . Tags numbered 32768 or higher, sometimes called private tags, are reserved for that purpose. Upon request, the TIFF administrator . . . will allocate and register one or more private tags for an organization . . . . You do not need to tell the TIFF administrator what you plan to use them for, but giving us this information may help other developers to avoid some duplication of effort.” Over time, however, many private tags have become well established and well documented, e.g., tag 34675 for the ICC profile, dubbed InterColorProfile in the TIFF/EP standard. Thus, many members of the private tag class can be viewed as open extensions rather than as containers for secret information. TIFF/EP, TIFF/IT, and DNG: A number of tags, some of which may once have been private, have been defined in TIFF/EP (ISO 12234-2, 2001), TIFF/IT (ISO 12639, 2004), and DNG_1_1, an Adobe-sponsored extension of the TIFF 6.0 specification. TIFF Private IFD: The TIFF 6.0 specification (page 9) states, “If you need more than 10 tags, we suggest that you reserve a single private tag, define it as a LONG TIFF data type, and use its value as a pointer (offset) to a private IFD [image file directory] or other data structure of your

364

Appendix I - TIFF Tags

choosing. Within that IFD, you can use whatever tags you want, since no one else will know that it is an IFD unless you tell them.” As with private tags, we can understand private IFDs as an extension to TIFF, often very public and well documented. The private IFD tags of greatest interest to the Library of Congress are those associated with the EXIF_2_2 specification, pertaining to image generation by digital still cameras. Exif is an abbreviation for EXchangeable Image File format, although Exif does not relate to TIFF as, say, JFIF relates to JPEG_DCT. The Exif IFD is pointed to by the Private Exif IFD tag 34665. This and other Exif tags are listed in the numerical table below. For the Exif specification and other related information, see Exif.org. There are actually three private IFDs specified by the Exif standard. The other two are the GPS IFD, for positioning information, and the Interoperability IFD, used to encode compability information. With numerical sequences of their own, the GPS and interoperability tags are not included in the table below. HD Photo tags: Although not a true TIFF implementation, WMP_1_0 (originally called Windows Media Photo) is a 2006 specification with a container format that borrows heavily from TIFF and adds a few new tags of interest. Included in the table.

Descriptions of Tags in Numerical Order Table I.1: TIFF Tags in Numerical Order1 Code Dec Hex

Name

Description

Source of Tag

A general indication of the kind of data that is contained in this subfile. This field is made up of a set of 32 flag bits. Unused bits are expected to be 0. Bit 0 is the low-order bit. Currently defined values for the bitmap are: 254

00FE NewSubfileType

0 - Image is reduced of another TIFF Baseline image in this file 1 - Image is a single page of a multipage 2 - Image is a transparency mask for another image in this file. The default is 0. A general indication of the kind of data that is contained in this subfile.

255

00FF SubfileType

Currently defined values are: A general indication of the kind of

365

Baseline

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

data that is contained in this subfile. Currently defined values are: 1 = full resolution image data ImageWidth, ImageLength, and StripOffsets are required fields. 2 = reduced resolution image data ImageWidth, ImageLength, and StripOffsets are required fields. It is further assumed that a reduced resolution image is a reduced version of the entire extent of the corresponding full resolution data. 3 = single page of a multi-page image (see the PageNumber tag description).

256

0100

ImageWidth

257

0101

ImageLength

258

0102

BitsPerSample

259

0103

Compression

Continued use of this field is not recommended. Writers should instead use the new and more general NewSubfileType field. The image's width, in pixels (X:horizontal). The number of columns in Baseline the image. The image's length (height) in pixels (Y:vertical). The number of rows Baseline (sometimes described as "scan lines") in the image. Number of bits per sample. Note that this tag allows a different number of bits per sample for each sample corresponding to a pixel. For example, RGB color data could use Baseline a different number of bits per sample for each of the three color planes. The default is 1. 1 = No compression, but pack data into bytes as tightly as possible, with no unused bits except at the end of a row. The bytes are stored Baseline as an array of bytes, for BitsPerSample 8 and 16 and 8 bits must be consistent with that specified in the TIFF file header (bytes 0 and 1). Rows are required to begin on byte boundaries. 2 = CCITT Group 3 1-Dimensional Modified Huffman run length encoding. See ALGRTHMS.txt BitsPerSample must be 1, since this type of compression is defined only for bilevel images (like FAX images...) 3 = Facsimile-compatible CCITT Group 3, exactly as specified in "Standardization of Group 3 facsimile apparatus for document transmission," Recommendation T.4, Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic Services, The International Telegraph and Telephone Consultative Committee (CCITT), Geneva, 1985, pages 16 through 31. Each strip must begin on a byte boundary. (But recall that an image can be a single strip.) Rows that are not the first row of a strip are not required to begin on a byte boundary. The data is stored as bytes, not words - byte-reversal is not allowed. See the Group3Options field for Group 3 options such as 1D vs 2D coding. 4 = Facsimile-compatible CCITT Group 4, exactly as specified in "Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus," Recommendation T.6, Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic Services, The International Telegraph and Tele-

367

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

phone Consultative Committee (CCITT), Geneva, 1985, pages 40 through 48. Each strip must begin on a byte boundary. Rows that are not the first row of a strip are not required to begin on a byte boundary. The data is stored as bytes, not words. See the Group4Options field for Group 4 options. 5 = LZW Compression, for grayscale, mapped color, and full color images. See ALGRTHMS.txt 32773 = PackBits compression, a simple byte oriented run length scheme for 1-bit images. Data compression only applies to raster image data, as pointed to by StripOffsets. The default value is 1. 0 = For bilevel and grayscale images: 0 is imaged as white. 2**BitsPerSample-1 is imaged as black. If GrayResponseCurve exists, it overrides the PhotometricInterpretation value.

262

0106

PhotometricInterpretation

1 = For bilevel and grayscale images: 0 is imaged as black. 2**BitsPerSample-1 is imaged as white. If GrayResponseCurveexists, it overrides the PhotometricInterpretation Baseline value. 2 = RGB. In the RGB model, a color is described as a combination of the three primary colors of light (red, green, and blue) inparticular concentrations. For each of the three samples, 0 represents minimum intensity, and 2**BitsPerSample - 1 represents maximum intensity. For PlanarConfiguration = 1, the samples are stored in the indicated

368

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

order: first Red, hen Green, then Blue. For PlanarConfiguration = 2, the StripOffsets for the sample planes are stored in the indicated order: first the Red sample plane StripOffsets, then the Green plane StripOffsets, then the Blue plane StripOffsets. 3 = "Palette color." In this mode, a color is described with a single sample. The sample is used as an index into ColorMap. The sample is used to index into each of the red, green and blue curve tables to retrieve an RGB triplet defining an actual color. When this PhotometricInterpretation value is used, the color response curves must also be supplied. SamplesPerPixel must be 1. 4 = Transparency Mask. This means that the image is used to define an irregularly shaped region of another image in the same TIFF file. SamplesPerPixel and BitsPerSample must be 1. PackBits compression is recommended. The 1-bits define the interior of the region; the 0-bits define interior of the region; the 0-bits define the exterior of the region. The Transparency Mask must have the same ImageLength and ImageWidth as the main image. 1 = a bilevel "line art" scan. BitsPerSample must be 1. 263

264

369

0107

0108

Threshholding

CellWidth

2 = a "dithered" scan, usually of conBaseline tinuous tone data such as photographs. BitsPerSample must be 1. 3 = Error Diffused. The width of the dithering or halftoning matrix used to create a dithered Baseline or halftoned bilevel file.

Appendix I - TIFF Tags

Code Dec Hex

Name

265

0109

CellLength

266

010A FillOrder

269

010D DocumentName

270

010E ImageDescription

271

010F

272

273

0110

0111

Make

Model

StripOffsets

Description

Source of Tag

The length of the dithering or halftoning matrix used to create a dithered Baseline or halftoned bilevel file. The logical order of bits within a Baseline byte. The name of the document from Extended which this image was scanned. A string that describes the subject of the image. For example, a user may Baseline wish to attach a comment such as "1988 company picnic" to an image. Manufacturer of the scanner, video digitizer. Baseline Mandatory for TIFF/EP. The model name/number of the scanner, video digitizer. This tag is intended for user information only so Baseline format is arbitrary. Mandatory for TIFF/EP. For each strip, the byte offset of that strip. The offset is specified with respect to the beginning of the TIFF file. Note that this implies that each strip has a location independent of Baseline the locations of other strips. This feature may be useful for editing applications. This field is the only way for a reader to find the image data, and hence must exist. The orientation of the image with respect to the rows and columns. 1 = The 0th row represents the visual top of the image, and the 0th column represents the visual left hand side.

274

0112

Orientation

Baseline 2 = The 0th row represents the visual top of the image, and the 0th column represents the visual right hand side. 3 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual

370

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

right hand side. 4 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual left hand side. 5 = The 0th row represents the visual left hand side of the image, and the 0th column represents the visual top. 6 = The 0th row represents the visual right hand side of the image, and the 0th column represents the visual top. 7 = The 0th row represents the visual right hand side of the image, and the 0th column represents the visual bottom. 8 = The 0th row represents the visual left hand side of the image, and the 0th column represents the visual bottom. It is extremely costly for most readers to perform image rotation "on the fly", i.e., when importing and printing; and users of most desktop publishing applications do not expect a file imported by the application to be altered permanently in any way.

277

0115

SamplesPerPixel

278

0116

RowsPerStrip

371

The default value is 1. The number of samples per pixel. SamplesPerPixel is 1 for bilevel, grayscale, and palette color images. Baseline SamplesPerPixel is 3 for RGB images. The number of rows per strip. The image data is organized into strips for fast access to individual rows Baseline when the data is compressed though this field is valid even if the data is not compressed.

Appendix I - TIFF Tags

Code Dec Hex

Name

279

0117

StripByteCounts

280

0118

MinSampleValue

281

0119

MaxSampleValue

282

011A XResolution

283

011B YResolution

284

011C PlanarConfiguration

Description

Source of Tag

The default is 2**32 - 1, which is effectively infinity. That is, the entire image is one strip. Recomended is a strip size of 8K. For each strip, the number of bytes in that strip. The existenceof this field greatly simplifies the chore of Baseline buffering compressed data, if the strip size is reasonable. The minimum component value Baseline used. The maximum component value Baseline used. The number of pixels per ResolutionUnit in the X direction, i.e., in Baseline the ImageWidth direction. The number of pixels per ResolutionUnit in the Y direction, i.e., in Baseline the ImageLength direction. 1 = The sample values for each pixel are stored contiguously, so that there is a single image plane. See PhotometricInterpretation to determine the order of the samples within the pixel data. So, for RGB data, the data is stored RGBRGBRGB...and so on. 2 = The samples are stored in separate "sample planes." The values in StripOffsets and StripByteCounts are then arranged as a 2-dimensional array, with SamplesPerPixel rows Baseline and StripsPerImage columns. (All of the columns for row 0 are stored first, followed by the columns of row 1, and so on.) PhotometricInterpretation describes the type of data that is stored in each sample plane. For example, RGB data is stored with the Red samples in one sample plane, the Green in another,and the Blue in another. If SamplesPerPixel is 1, PlanarConfiguration is irrelevant, and should

372

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

not be included.

285

011D PageName

286

011E XPosition

287

011F

YPosition

288

0120

FreeOffsets

289

0121

FreeByteCounts

The default is 1. The name of the page from which Extended this image was scanned. The X offset of the left side of the image, with respect to the left side of Extended the page, in ResolutionUnits. The Y offset of the top of the image, with respect to the top of the page, in ResolutionUnits. In the TIFF oordinExtended ate scheme, the positive Y direction is down, so that YPosition is always positive. For each string of contiguous unused bytes in a TIFF file, the byte Baseline offset of the string. For each string of contiguous unused bytes in a TIFF file, the num- Baseline ber of bytes in the string. The precision of the information contained in the GrayResponseCurve. 1 = Number represents tenths of a unit. 2 = Number represents hundredths of a unit.

290

0122

GrayResponseUnit

3 = Number represents thousandths of a unit. Baseline 4 = Number represents ten-thousandths of a unit. 5 = Number represents hundred-thousandths of a unit. For historical reasons, the default is 2. However, for greater accuracy, 3 is recommended. For grayscale data, the optical density of each possible pixel value.

291

373

0123

GrayResponseCurve

The purpose of the gray response Baseline curve and the gray units is to provide more exact photometric interpretation information for gray scale

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

image data, in terms of optical density. Those options are for fax-images stored in TIFF format. This field is made up of a set of 32 flag bits. Unused bits are expected to be 0. It is probably not safe to try to read the file if any bit of this field is set that you don't know the meaning of. 292

0124

Group3Options

Bit map:

Extended

0 - 2-dimensional coding used. 1 - Image is uncompressed 2 - Fill bits have been added before EOL codes, so that EOL always ends on a byte boundary. This field is made up of a set of 32 flag bits and is used for the images with fax group 4 compression. Unused bits are expected to be 0. It is probably not safe to try to read the file if any bit of this field is set that you don't know the meaning of. Gray scale and color coding schemes are under study, and will be added when finalized.

Group4Options 293

0125

For 2-D coding, each strip is encoded as if it were a separate image. In particular, each strip Extended begins on a byte boundary; and the coding for the first row of a strip is encoded independently of the previous row, using horizontal codes, as if the previous row is entirely white. Each strip ends with the 24bit end-of-facsimile block (EOFB). Bit map: 0 - reserved (unused) 1 - uncompressed mode is used

296

0128

ResolutionUnit

2-31 - reserved To be used with XResolution and

Baseline

374

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

YResolution. 1 = No absolute unit of measurement. Used for images that may have a non-square aspect ratio, but no meaningful absolute dimensions. The drawback of ResolutionUnit=1 is that different applications will import the image at different sizes. Even if the decision is quite arbitrary, it might be better to use dots per inch or dots per centimeter, and pick XResolution and YResolution such that the aspect ratio is correct and the maximum dimension of the image is about four inches (the "four" is quite arbitrary.) 2 = Inch. 3 = Centimeter.

297

0129

301

012D TransferFunction

305

0131

Software

306

0132

DateTime

315

013B Artist

316

013C HostComputer

375

PageNumber

The default is 2. This tag is used to specify page numbers of a multiple page (e.g. facsimile) document. Two word values are specified. The first value is the page number; the second value is Extended the total number of pages in the document. Note that pages need not appear in numerical order. The first page is 0 (zero). Describes a transfer function for the Extended image in tabular style. Name and release number of the software package that created the Baseline image. User information only. Date and time of image creation. Uses the format "YYYY:MM:DD HH:MM:SS", with hours on a 24hour clock, and one space character Baseline between the date and the time. The length of the string, including the null, is 20 bytes. Person who created the image. Baseline Copyright notice. The computer and/or operating sys- Baseline

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

tem in use at the time of image creation. ENIAC. A mathematical operator that is applied to the image data before an encoding scheme is applied. 317

013D Predictor

To be used when Compression=5 (LZW).

Extended

1 = No prediction scheme used before coding. 2 = Horizontal differencing. Gives TIFF color image readers a better idea of what kind of color image it is. There will be borderline cases. 1 = Continuous tone, natural image. 318

013E ColorImageType

2 = Synthetic image, using a greatly Extended restricted range of colors. Such images are produced by most color paint programs. See ColorList for a list of colors used in this image. The default value is 1. A list of colors that are used in this image. Use of this field is only practical for images containing a greatly restricted (usually less than or equal to 256) range of colors. ColorImageType should be 2. See ColorImageType.

319

013F

ColorList

320

0140

ColorMap

The list is organized as an array of Extended RGB triplets, with no pad. The RGB triplets are not guaranteed to be in any particular order. Note that the red, green, and blue components can either be a BYTE or a word in length. BYTE should be sufficient for most applications. This tag defines a Red-Green-Blue color map for palette color images. Baseline

376

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag

The palette color pixel value is used to index into all 3 subcurves. The subcurves are stored sequentially. The Red entries come first, followed by the Green entries, followed by the Blue entries. The width of each entry is 16 bits, as implied by the type of word. 0 represents the minimum intensity, and 65535 represents the maximum intensity.

321

0141

HalftoneHints

322

0142

TileWidth

323

0143

TileLength

324

0144

TileOffsets

325

0145

TileByteCounts

326

0146

BadFaxLines

327

0147

CleanFaxData

328

0148

ConsecutiveBadFaxLines

330

014A SubIFDs

332

014C InkSet

333

014D InkNames

377

ColorMap must be included in all palette color images. Conveys to the halftone function the range of gray levels within a colExtended orimetrically-specified image that should retain tonal detail. The tile width in pixels. This is the Extended number of columns in each tile. The tile length (height) in pixels. This Extended is the number of rows in each tile. For each tile, the byte offset of that tile, as compressed and stored on Extended disk. For each tile, the number of (comExtended pressed) bytes in that tile. Used in the TIFF-F standard, denotes the number of 'bad' scan Extended lines encountered by the facsimile device. Used in the TIFF-F standard, indicates if 'bad' lines encountered during reception are stored in the data, or if Extended 'bad' lines have been replaced by the receiver. Used in the TIFF-F standard, denotes the maximum number of Extended consecutive 'bad' scanlines received. Offset to child IFDs. Extended The set of inks used in a separated (PhotometricInterpretation=5) Extended image. The name of each ink used in a sepExtended arated image.

Appendix I - TIFF Tags

Code Name Dec Hex 334 014E NumberOfInks 336

0150

DotRange

337

0151

TargetPrinter

338

0152

ExtraSamples

339

0153

SampleFormat

340

0154

SMinSampleValue

341

0155

SMaxSampleValue

342

0156

TransferRange

343

0157

ClipPath

344

0158

XClipPathUnits

345

0159

YClipPathUnits

346

015A Indexed

347

015B JPEGTables

351

015F

OPIProxy

400

0190

GlobalParametersIFD

401

0191

ProfileType

402

0192

FaxProfile

403

0193

CodingMethods

404

0194

VersionYear

Description

Source of Tag Extended

The number of inks. The component values that corExtended respond to a 0% dot and 100% dot. A description of the printing environment for which this separation is Extended intended. Description of extra components. Baseline Specifies how to interpret each data Extended sample in a pixel. Specifies the minimum sample Extended value. Specifies the maximum sample Extended value. Expands the range of the TransExtended ferFunction. Mirrors the essentials of PostScript's path creation funcExtended tionality. The number of units that span the width of the image, in terms of Extended integer ClipPath coordinates. The number of units that span the height of the image, in terms of Extended integer ClipPath coordinates. Aims to broaden the support for indexed images to include support Extended for any color space. JPEG quantization and/or Huffman Extended tables. OPI-related. Extended Used in the TIFF-FX standard to point to an IFD containing tags that Extended are globally applicable to the complete TIFF file. Used in the TIFF-FX standard, denotes the type of data stored in Extended this file or IFD. Used in the TIFF-FX standard, denotes the 'profile' that applies to Extended this file. Used in the TIFF-FX standard, indicates which coding methods are used Extended in the file. Used in the TIFF-FX standard, Extended

378

Appendix I - TIFF Tags

Code Dec Hex

405

433

434

512

513

514

515

517

518

519

520

521

529

Source of Tag denotes the year of the standard specified by the FaxProfile field. Used in the TIFF-FX standard, 0195 ModeNumber denotes the mode of the standard Extended specified by the FaxProfile field. Used in the TIFF-F and TIFF-FX standards, holds information about 01B1 Decode the ITULAB (PhoExtended tometricInterpretation = 10) encoding. Defined in the Mixed Raster Content part of RFC 2301, is the default color 01B2 DefaultImageColor Extended needed in areas where no image is available. Old-style JPEG compression field. 0200 JPEGProc TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0201 JPEGInterchangeFormat TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0202 JPEGInterchangeFormatLength TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0203 JPEGRestartInterval TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0205 JPEGLosslessPredictors TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0206 JPEGPointTransforms TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0207 JPEGQTables TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0208 JPEGDCTables TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0209 JPEGACTables TechNote2 invalidates this part of Extended the specification. The transformation from RGB to YCbCr image data. 0211 YCbCrCoefficients Extended Name

Description

Mandatory for TIFF/EP YCbCr

379

Appendix I - TIFF Tags

Code Dec Hex

Name

530

0212

YCbCrSubSampling

531

0213

YCbCrPositioning

532

0214

ReferenceBlackWhite

559

022F

StripRowCounts

700

02BC XMP

32781 800D ImageID 32932 80A4 Wang Annotation 33421 828D CFARepeatPatternDim

33422 828E CFAPattern

33423 828F

BatteryLevel

33432 8298

Copyright

Description

Source of Tag

images. Specifies the subsampling factors used for the chrominance comExtended ponents of a YCbCr image. Specifies the positioning of subsampled chrominance components Extended relative to luminance samples. Specifies a pair of headroom and footroom image data values (codes) Extended for each pixel component. Defined in the Mixed Raster Content part of RFC 2301, used to replace Extended RowsPerStrip for IFDs with variable-sized strips. XML packet containing XMP Extended metadata OPI-related. Extended Annotation data, as used in 'Imaging Private for Windows. TIFF/EP For camera raw files from sensors spec, p. with CFA overlay. 23 TIFF/EP For camera raw files from sensors spec, p. with CFA overlay. 23 TIFF/EP Encodes camera battery level at spec, p. time of image capture. 45 Copyright notice. Baseline Exif Private IFD

33434 829A ExposureTime

Exposure time given in seconds.

TIFF/EP spec, p. 38 Exif Private IFD

33437 829D FNumber

The F number.

TIFF/EP spec, p. 39

33445 82A5 MD FileTag 33446 82A6 MD ScalePixel

Specifies the pixel data format encoding in the Molecular Dynamics Private GEL file format. Specifies a scale factor in the Private

380

Appendix I - TIFF Tags

Code Dec Hex

Name

33447 82A7 MD ColorTable

33448 82A8 MD LabName

33449 82A9 MD SampleInfo

33450 82AA MD PrepDate

33451 82AB MD PrepTime

33452 82AC MD FileUnits 33550 830E ModelPixelScaleTag

33723 83BB IPTC/NAA

33918 847E INGR Packet Data Tag 33919 847F

INGR Flag Registers

33920 8480

IrasB Transformation Matrix

33922 8482

ModelTiepointTag

34016

Site

34017

ColorSequence

34018

IT8Header

381

Description

Source of Tag

Molecular Dynamics GEL file format. Used to specify the conversion from 16bit to 8bit in the Molecular Dynam- Private ics GEL file format. Name of the lab that scanned this file, as used in the Molecular Dynam-Private ics GEL file format. Information about the sample, as used in the Molecular Dynamics Private GEL file format. Date the sample was prepared, as used in the Molecular Dynamics Private GEL file format. Time the sample was prepared, as used in the Molecular Dynamics Private GEL file format. Units for data in this file, as used in the Molecular Dynamics GEL file Private format. Used in interchangeable GeoTIFF_ Private 1_0 files. IPTC-NAA (International Press TeleTIFF/EP communications Council-Newspaspec, p. per Association of America) 33 metadata. Intergraph Application specific storPrivate age. Intergraph Application specific flags. Private Originally part of Intergraph's GeoTIFF tags, but likely understood Private by IrasB only. Originally part of Intergraph's GeoTIFF tags, but now used in interchangeable GeoTIFF_1_0 files. In Private GeoTIFF_1_0, either this tag or 34264 must be defined, but not both TIFF/IT Site where image created. spec, 7.2.3 TIFF/IT Sequence of colors if other than spec, CMYK. 7.2.8.3.2 TIFF/IT Certain inherited headers.

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

34019

RasterPadding

Type of raster padding used, if any.

34020

BitsPerRunLength

Number of bits for short run length encoding.

34021

BitsPerExtendedRunLength

Number of bits for long run length encoding.

34022

ColorTable

Color value in a color pallette.

34023

ImageColorIndicator

Indicates if image (foreground) color or transparency is specified.

34024

BackgroundColorIndicator

Background color specification.

34025

ImageColorValue

Specifies image (foreground) color.

34026

BackgroundColorValue

Specifies background color.

34027

PixelIntensityRange

Specifies data values for 0 percent and 100 percent pixel intensity.

34028

TransparencyIndicator

Specifies if transparency is used in HC file.

34029

ColorCharacterization

Specifies ASCII table or other reference per ISO 12641 and ISO 12642.

34030

HCUsage

Indicates the type of information in an HC file.

34031

TrapIndicator

Indicates whether or not trapping has been applied to the file.

34032

CMYKEquivalent

Specifies CMYK equivalent for specific separations.

Source of Tag spec, 7.2.3 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.9 TIFF/IT spec, 7.2.9 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.8.3.4

382

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

34033

Reserved

For future TIFF/IT use

34034

Reserved

For future TIFF/IT use

34035

Reserved

For future TIFF/IT use

34264 85D8 ModelTransformationTag

34377 8649

Photoshop

34665 8769

Exif IFD

34675 8773

InterColorProfile

34732 87AC ImageLayer

34735 87AF GeoKeyDirectoryTag 34736 87B0 GeoDoubleParamsTag 34737 87B1 GeoAsciiParamsTag

34850 8822

ExposureProgram

34852 8824

SpectralSensitivity

34853 8825

GPSInfo

34855 8827

ISOSpeedRatings

Used in interchangeable GeoTIFF_ 1_0 files. In GeoTIFF_1_0, either Private this tag or 33922 must be defined, but not both Collection of Photoshop 'Image Private Resource Blocks. A pointer to the Exif IFD. Private TIFF/EP ICC profile data. spec, p. 47 Defined in the Mixed Raster Content part of RFC 2301, used to denote Extended the particular function of this Image in the mixed raster scheme. Used in interchangeable GeoTIFF_ 1_0 files. Mandatory in GeoTIFF_1_ Private 0. Used in interchangeable GeoTIFF_ Private 1_0 files. Used in interchangeable GeoTIFF_ Private 1_0 files. Exif Private IFD The class of the program used by the camera to set exposure when the picture is taken.

TIFF/EP spec, p. 41 Exif Private IFD

Indicates the spectral sensitivity of each channel of the camera used. TIFF/EP spec, p. 48 TIFF/EP A pointer to the Exif-related GPS spec, p. Info IFD. 34 Exif PrivIndicates the ISO Speed and ISO ate IFD Latitude of the camera or input device as specified in ISO 12232.

383

Source of Tag TIFF/IT spec TIFF/IT spec TIFF/IT spec

TIFF/EP

Appendix I - TIFF Tags

Code Dec Hex

Name

34856 8828

OECF

34857 8829

Interlace

34858 882A TimeZoneOffset

34859 882B SelfTimeMode 34908 885C HylaFAX FaxRecvParams 34909 885D HylaFAX FaxSubAddress 34910 885E HylaFAX FaxRecvTime

Description

Source of Tag spec, p. 47 Exif Private IFD

Indicates the Opto-Electric Conversion Function (OECF) specified TIFF/EP in ISO 14524. spec, p. 48 TIFF/EP Indicates the field number of mulspec, p. tifield images. 22 TIFF/EP Encodes time zone of camera clock spec, p. relative to GMT. 38 TIFF/EP Number of seconds image capture spec, p. was delayed from button press. 45 Used by HylaFAX. Private Used by HylaFAX. Private Used by HylaFAX. Private The version of the supported Exif Exif Privstandard. Mandatory in the Exif IFD. ate IFD Exif PrivThe date and time when the original ate IFD

36864 9000

ExifVersion

36867 9003

DateTimeOriginal

36868 9004

DateTimeDigitized

37121 9101

ComponentsConfiguration

37122 9102

CompressedBitsPerPixel

37377 9201

ShutterSpeedValue

Shutter speed.

37378 9202

ApertureValue

The lens aperture.

image data was generated. Mandatory for TIFF/EP.

TIFF/EP spec, p. 37 Exif Private IFD

The date and time when the image was stored as digital data. Specific to compressed data; speExif Privcifies the channels and comate IFD plements PhotometricInterpretation Exif Private IFD Specific to compressed data; states TIFF/EP the compressed bits per pixel. spec, p. 27 Exif Private IFD TIFF/EP spec, p. 39 Exif Priv-

384

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

Source of Tag ate IFD TIFF/EP spec, p. 39 Exif Private IFD

37379 9203

BrightnessValue

The value of brightness.

TIFF/EP spec, p. 40 Exif Private IFD

37380 9204

ExposureBiasValue

The exposure bias.

TIFF/EP spec, p. 40 Exif Private IFD

37381 9205

MaxApertureValue

The smallest F number of the lens.

TIFF/EP spec, p. 40 Exif Private IFD

37382 9206

SubjectDistance

37383 9207

MeteringMode

The metering mode.

TIFF/EP spec, p. 41 Exif Private IFD

37384 9208

LightSource

The kind of light source.

TIFF/EP spec, p. 46 Exif Private IFD

37385 9209

Flash

Indicates the status of flash when the image was shot.

37386 920A FocalLength

385

The distance to the subject, given in TIFF/EP meters. spec, p. 44 Exif Private IFD

TIFF/EP spec, p. 42 The actual focal length of the lens, in Exif Priv-

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

mm.

37387 920B FlashEnergy

Amount of flash energy (BCPS).

37388 920C SpatialFrequencyResponse

SFR of the camera.

37389 920D Noise

Noise measurement values.

37390 920E FocalPlaneXResolution

37391 920F

FocalPlaneYResolution

37392 9210

FocalPlaneResolutionUnit

37393 9211

ImageNumber

37394 9212

SecurityClassification

37395 9213

ImageHistory

37396 9214

SubjectLocation

37397 9215

ExposureIndex

37398 9216

TIFF/EPStandardID

Number of pixels per FocalPlaneResolutionUnit (37392) in ImageWidth direction for main image. Number of pixels per FocalPlaneResolutionUnit (37392) in ImageLength direction for main image. Unit of measurement for FocalPlaneXResolution(37390) and FocalPlaneYResolution(37391).

Source of Tag ate IFD TIFF/EP spec, p. 44 TIFF/EP spec, p. 43 TIFF/EP spec, p. 49 TIFF/EP spec, p. 49 TIFF/EP spec, p. 18 TIFF/EP spec, p. 19

TIFF/EP spec, p. 19 TIFF/EP Number assigned to an image, e.g., spec, p. in a chained image burst. 32 TIFF/EP Security classification assigned to spec, p. the image. 33 TIFF/EP Record of what has been done to the spec, p. image. 33 Exif Private IFD Indicates the location and area of the TIFF/EP main subject in the overall scene. spec, p. 45 TIFF/EP Encodes the camera exposure index spec, p. setting when image was captured. 47 For current spec, tag value equals 1 TIFF/EP spec, p. 0 0 0.

386

Appendix I - TIFF Tags

Code Dec Hex

Name

Description Mandatory in TIFF/EP. Type of image sensor.

37399 9217

SensingMethod Mandatory in TIFF/EP.

37500 927C MakerNote 37510 9286

UserComment

37520 9290

SubsecTime

37521 9291

SubsecTimeOriginal

37522 9292

SubsecTimeDigitized

37724 935C ImageSourceData 40960 A000 FlashpixVersion

40961 A001 ColorSpace

40962 A002 PixelXDimension 40963 A003 PixelYDimension 40964 A004 RelatedSoundFile 40965 A005 Interoperability IFD

41483 A20B FlashEnergy

41484 A20C SpatialFrequencyResponse

41486 A20E FocalPlaneXResolution

387

Manufacturer specific information. Keywords or comments on the image; complements ImageDescription. A tag used to record fractions of seconds for the DateTime tag. A tag used to record fractions of seconds for the DateTimeOriginal tag. A tag used to record fractions of seconds for the DateTimeDigitized tag. Used by Adobe Photoshop. The Flashpix format version supported by a FPXR file.,

Source of Tag 16 TIFF/EP spec, p. 22 Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Private Exif Private IFD

Mandatory in the Exif IFD The color space information tag is always recorded as the color space Exif Privspecifier. ate IFD Mandatory in the Exif IFD. Specific to compressed data; the Exif Privvalid width of the meaningful image. ate IFD Specific to compressed data; the Exif Privvalid height of the meaningful image. ate IFD Used to record the name of an audio Exif Privfile related to the image data. ate IFD A pointer to the Exif-related InterPrivate operability IFD. Indicates the strobe energy at the time the image is captured, as meas- Exif Privured in Beam Candle Power ate IFD Seconds Records the camera or input device spatial frequency table and SFR valExif Privues in the direction of image width, ate IFD image height, and diagonal direction, as specified in ISO 12233. Indicates the number of pixels in the Exif Priv-

Appendix I - TIFF Tags

Code Dec Hex

Name

41487 A20F FocalPlaneYResolution

41488 A210 FocalPlaneResolutionUnit 41492 A214 SubjectLocation 41493 A215 ExposureIndex 41495 A217 SensingMethod

Description image width (X) direction per FocalPlaneResolutionUnit on the camera focal plane. Indicates the number of pixels in the image height (Y) direction per FocalPlaneResolutionUnit on the camera focal plane. Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. Indicates the location of the main subject in the scene. Indicates the exposure index selected on the camera or input device at the time the image is captured. Indicates the image sensor type on the camera or input device.

41728 A300 FileSource

Indicates the image source.

41729 A301 SceneType

Indicates the image source.

41730 A302 CFAPattern

41985 A401 CustomRendered 41986 A402 ExposureMode 41987 A403 WhiteBalance 41988 A404 DigitalZoomRatio 41989 A405 FocalLengthIn35mmFilm 41990 A406 SceneCaptureType 41991 A407 GainControl 41992 A408 Contrast

Source of Tag ate IFD

Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD

Indicates the color filter array (CFA) geometric pattern of the image Exif Privsensor when a one-chip color area ate IFD sensor is used. Indicates the use of special proExif Privcessing on image data, such as renate IFD dering geared to output. Indicates the exposure mode set Exif Privwhen the image was shot. ate IFD Indicates the white balance mode Exif Privset when the image was shot. ate IFD Indicates the digital zoom ratio when Exif Privthe image was shot. ate IFD Indicates the equivalent focal length Exif Privassuming a 35mm film camera, in ate IFD mm. Indicates the type of scene that was Exif Privshot. ate IFD Indicates the degree of overall image Exif Privgain adjustment. ate IFD Indicates the direction of contrast Exif Privprocessing applied by the camera ate IFD when the image was shot.

388

Appendix I - TIFF Tags

Code Dec Hex

Name

41993 A409 Saturation

41994 A40A Sharpness

41995 A40B DeviceSettingDescription 41996 A40C SubjectDistanceRange 42016 A420 ImageUniqueID

42112 A480 GDAL_METADATA

42113 A481 GDAL_NODATA

48129 BC01 PixelFormat

48130 BC02 Transformation

48131 BC03 Uncompressed

48132 BC04 ImageType

48256 BC80 ImageWidth

48257 BC81 ImageHeight

389

Description Indicates the direction of saturation processing applied by the camera when the image was shot. Indicates the direction of sharpness processing applied by the camera when the image was shot. This tag indicates information on the picture-taking conditions of a particular camera model. Indicates the distance to the subject. Indicates an identifier assigned uniquely to each image. Used by the GDAL library, holds an XML list of name=value 'metadata' values about the image as a whole, and about specific samples. Used by the GDAL library, contains an ASCII encoded nodata or background pixel value.

Source of Tag Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Exif Private IFD Private

Private

HD Photo A 128-bit Globally Unique Identifier Feature (GUID) that identifies the image Spec, p. pixel format. 17 HD Photo Specifies the transformation to be Feature applied when decoding the image to Spec, p. present the desired representation. 23 HD Photo Specifies that image data is uncom- Feature pressed. Spec, p. 23 HD Photo Specifies the image type of each indi-Feature vidual frame in a multi-frame file. Spec, p. 27 HD Photo The image's width, in pixels (X:hoFeature rizontal). The number of columns in Spec, p. the image. 21 HD Photo Specifies the number of pixels or Feature scan lines in the transformed photo. Spec, p. 21

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

48258 BC82 WidthResolution

Specifies the horizontal resolution of a transformed image expressed in pixels per inch.

48259 BC83 HeightResolution

Specifies the vertical resolution of a transformed image expressed in pixels per inch.

48320 BCC0 ImageOffset

Specifies the byte offset pointer to the beginning of the photo data, relative to the beginning of the file.

48321 BCC1 ImageByteCount

Specifies the size of the photo in bytes.

48322 BCC2 AlphaOffset

Specifies the byte offset pointer the beginning of the planar alpha channel data, relative to the beginning of the file.

48323 BCC3 AlphaByteCount

Specifies the size of the alpha channel data in bytes.

48324 BCC4 ImageDataDiscard

48325 BCC5 AlphaDataDiscard

48132 BC04 ImageType 50215 C427 Oce Scanjob Description 50216 C428 Oce Application Selector 50217 C429 Oce Identification Number Oce ImageLogic Char50218 C42A acteristics 50706 C612 DNGVersion

Source of Tag HD Photo Feature Spec, p. 21 HD Photo Feature Spec, p. 21 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 23 HD Photo Feature Spec, p. 25

Signifies the level of data that has been discarded from the image as a result of a compressed domain transcode to reduce the file size. Signifies the level of data that has HD Photo been discarded from the planar alpha Feature channel as a result of a compressed Spec, p. domain transcode to reduce the file 26 size. HD Photo Specifies the image type of each indi-Feature vidual frame in a multi-frame file. Spec, p. 27 Used in the Oce scanning process. Private Used in the Oce scanning process. Private Used in the Oce scanning process. Private Used in the Oce scanning process. Private Encodes DNG four-tier version num- DNG ber; for version 1.1.0.0, the tag con- spec, p. tains the bytes 1, 1, 0, 0. Used in 17

390

Appendix I - TIFF Tags

Code Dec Hex

Name

50707 C613 DNGBackwardVersion

50708 C614 UniqueCameraModel

50709 C615 LocalizedCameraModel

50710 C616 CFAPlaneColor

Description

Source of Tag

IFD 0 of DNG files. Defines oldest version of spec with DNG which file is compatible. Used in IFD spec, p. 0 of DNG files. 17 Unique, non-localized nbame for DNG camera model. Used in IFD 0 of spec, p. DNG files. 18 Similar to 50708, with localized cam- DNG era name. Used in IFD 0 of DNG spec, p. files. 19 Mapping between values in the CFAPattern tag and the plane num- DNG bers in LinearRaw space. Used in spec, p. Raw IFD of DNG files. 19 Required for non-RGB CFA images.

50711 C617 CFALayout

50712 C618 LinearizationTable

50713 C619 BlackLevelRepeatDim

50714 C61A BlackLevel

50715 C61B BlackLevelDeltaH

50716 C61C BlackLevelDeltaV

50717 C61D WhiteLevel

50718 C61E DefaultScale

391

DNG spec, p. 20 Lookup table that maps stored val- DNG ues to linear values. Used in Raw spec, p. IFD of DNG files. 20 DNG Repeat pattern size for BlackLevel spec, p. tag. Used in Raw IFD of DNG files. 21 DNG Specifies the zero light encoding spec, p. level.Used in Raw IFD of DNG files. 21 Specifies the difference between zero light encoding level for each DNG column and the baseline zero light spec, p. encoding level. Used in Raw IFD of 22 DNG files. Specifies the difference between zero light encoding level for each DNG row and the baseline zero light spec, p. encoding level. Used in Raw IFD of 23 DNG files. Specifies the fully saturated encod- DNG ing level for the raw sample values. spec, p. Used in Raw IFD of DNG files. 23 For cameras with non-square pixels, DNG specifies the default scale factors spec, p. for each direction to convert the 24 image to square pixels. Used in Raw Spatial layout of the CFA. Used in Raw IFD of DNG files.

Appendix I - TIFF Tags

Code Dec Hex

Name

50719 C61F DefaultCropOrigin

50720 C620 DefaultCropSize

50721 C621 ColorMatrix1

50722 C622 ColorMatrix2

50723 C623 CameraCalibration1

50724 C624 CameraCalibration2

50725 C625 ReductionMatrix1

50726 C626 ReductionMatrix2

50727 C627 AnalogBalance

Description

Source of Tag

IFD of DNG files. Specifies the origin of the final image area, ignoring the extra pixels at DNG edges used to prevent interpolation spec, p. artifacts. Used in Raw IFD of DNG 25 files. Specifies size of final image area in DNG raw image coordinates. Used in spec, p. Raw IFD of DNG files. 25 Defines a transformation matrix that converts XYZ values to reference DNG camera native color space values, spec, p. under the first calibration illuminant. 27 Used in IFD 0 of DNG files. Defines a transformation matrix that converts XYZ values to reference DNG camera native color space values, spec, p. under the second calibration illu28 minant. Used in IFD 0 of DNG files. Defines a calibration matrix that transforms reference camera native DNG space values to individual camera spec, p. native space values under the first 28 calibration illuminant. Used in IFD 0 of DNG files. Defines a calibration matrix that transforms reference camera native DNG space values to individual camera spec, p. native space values under the 29 second calibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction matrix for use as the first stage in DNG converting color camera native spec, p. space values to XYZ values, under 30 the first calibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction matrix for use as the first stage in DNG converting color camera native spec, p. space values to XYZ values, under 30 the second calibration illuminant. Used in IFD 0 of DNG files. Pertaining to white balance, defines DNG the gain, either analog or digital, that spec, p.

392

Appendix I - TIFF Tags

Code Dec Hex

Name

50728 C628 AsShotNeutral

50729 C629 AsShotWhiteXY

50730 C62A BaselineExposure

50731 C62B BaselineNoise

50732 C62C BaselineSharpness

50733 C62D BayerGreenSplit

50734 C62E LinearResponseLimit

50735 C62F CameraSerialNumber

50736 C630 LensInfo

50737 C631 ChromaBlurRadius

393

Description

Source of Tag

has been applied to the stored raw 31 values. Used in IFD 0 of DNG files. Specifies the selected white balance at the time of capture, encoded as DNG the coordinates of a perfectly neutral spec, p. color in linear reference space val- 31 ues. Used in IFD 0 of DNG files. Specifies the selected white balance DNG at the time of capture, encoded as xspec, p. y chromaticity coordinates. Used in 32 IFD 0 of DNG files. Specifies in EV units how much to DNG move the zero point for exposure spec, p. compensation. Used in IFD 0 of 32 DNG files. Specifies the relative noise of the camera model at a baseline ISO DNG value of 100, compared to reference spec, p. camera model. Used in IFD 0 of 33 DNG files. Specifies the relative amount of sharpening required for this camera DNG model, compared to reference cam- spec, p. era model. Used in IFD 0 of DNG 33 files. For CFA images, specifies, in arbitrary units, how closely the values of DNG the green pixels in the blue/green spec, p. rows track the values of the green 34 pixels in the red/green rows. Used in Raw IFD of DNG files. Specifies the fraction of the encodDNG ing range above which the response spec, p. may become significantly non-linear. 34 Used in IFD 0 of DNG files. DNG Serial number of camera. Used in spec, p. IFD 0 of DNG files. 35 DNG Information about the lens. Used in spec, p. IFD 0 of DNG files. 35 Normally for non-CFA images, DNG provides a hint about how much spec, p. chroma blur ought to be applied. 36 Used in Raw IFD of DNG files.

Appendix I - TIFF Tags

Code Dec Hex

Name

50738 C632 AntiAliasStrength

50739

ShadowScale

50740 C634 DNGPrivateData

50741 C635 MakerNoteSafety

50778 C65A CalibrationIlluminant1

50779 C65B CalibrationIlluminant2

50780 C65C BestQualityScale

50781

RawDataUniqueID

50784 C660 Alias Layer Metadata

50827

OriginalRawFileName

50828

OriginalRawFileData

50829

ActiveArea

50830

MaskedAreas

Source of Tag Provides a hint about the strength of DNG the camera's anti-aliasing filter. spec, p. Used in Raw IFD of DNG files. 36 Used by Adobe Camera Raw to con- DNG trol sensitivity of its shadows slider. spec, p. Used in IFD 0 of DNG files. 38 Provides a way for camera manufacturers to store private data in DNG DNG files for use by their own raw spec, p. convertors. Used in IFD 0 of DNG 37 files. Lets the DNG reader know whether DNG the Exif MakerNote tag is safe to pre-spec, p. serve. Used in IFD 0 of DNG files. 38 Illuminant used for first set of calDNG ibration tags. Used in IFD 0 of DNG spec, p. files. 26 Illuminant used for second set of cal- DNG ibration tags. Used in IFD 0 of DNG spec, p. files. 26 Specifies the amount by which the values of the DefaultScale tag need DNG to be multiplied to achieve best qual- spec, p. ity image size. Used in Raw IFD of 24 DNG files. Contains a 16-byte unique identifier DNG for the raw image file in the DNG file. spec, p. Used in IFD 0 of DNG files. 39 Alias Sketchbook Pro layer usage Private description. Name of original file if the DNG file DNG results from conversion from a nonspec, p. DNG raw file. Used in IFD 0 of DNG 39 files. If the DNG file was converted from a DNG non-DNG raw file, then this tag conspec, p. tains the original raw data. Used in 40 IFD 0 of DNG files. Defines the active (non-masked) DNG pixels of the sensor. Used in Raw spec, p. IFD of DNG files. 41 List of non-overlapping rectangle DNG coordinates of fully masked pixels, spec, p. which can optimally be used by 42 DNG readers to measure the black Description

394

Appendix I - TIFF Tags

Code Dec Hex

Name

Description

50831

AsShotICCProfile

50832

AsShotPreProfileMatrix

50833

CurrentICCProfile

50834

CurrentPreProfileMatrix

1Content for base and extended tags

395

encoding level. Used in Raw IFD of DNG files. Contains ICC profile that, in conjunction with the AsShotPreProfileMatrix tag, specifies a default color rendering from camera color space coordinates (linear reference values) into the ICC profile connection space. Used in IFD 0 of DNG files. Specifies a matrix that should be applied to the camera color space coordinates before processing the values through the ICC profile specified in the AsShotICCProfile tag. Used in IFD 0 of DNG files. The CurrentICCProfile and CurrentPreProfileMatrix tags have the same purpose and usage as the AsShotICCProfile and AsShotPreProfileMatrix tag pair, except they are for use by raw file editors rather than camera manufacturers. Used in IFD 0 of DNG files. The CurrentICCProfile and CurrentPreProfileMatrix tags have the same purpose and usage as the AsShotICCProfile and AsShotPreProfileMatrix tag pair, except they are for use by raw file editors rather than camera manufacturers. Used in IFD 0 of DNG files.

Source of Tag

DNG spec, p. 42

DNG spec, p. 43

DNG spec, p. 44

DNG spec, p. 44

used by permission of the author, Max Maischein.

Index: -1 error code – -43 error code

-22 error code 353

Index

-23 error code 353 -

-24 error code 353

-1 error code 352

-25 error code 353

-10 error code 352

-26 error code 353

-100 error code 355

-27 error code 353

-101 error code 355

-28 error code 353

-102 error code 356

-29 error code 353

-103 error code 356

-3 error code 352

-104 error code 356

-30 error code 353

-105 error code 356

-31 error code 353

-106 error code 356

-32 error code 353

-11 error code 352

-33 error code 353

-12 error code 353

-34 error code 354

-13 error code 353

-35 error code 354

-14 error code 353

-36 error code 354

-15 error code 353

-37 error code 354

-16 error code 353

-38 error code 354

-17 error codee 353

-39 error code 354

-18 error code 353

-4 error code 352

-19 error code 353

-40 error code 354

-2 error code 352

-41 error code 354

-20 error code 353

-42 error code 354

-21 error code 353

-43 error code 354

396

Index: -44 error code – Alpha_VB

-44 error code 354

3

-45 error code 354

32-bit 333

-46 error code 354

32 bit 333

-47 error code 354 6

-48 error code 355 64-bit 334 -5 error code 352 64 bit 334 -52 error code 355

A

-53 error code 355 -54 error code 355

ABIC 293

-55 error code 355

abicplug.dll 315

-56 error code 355

ACCESS_DENIED error code 354

-57 error code 355

AFP 169, 216, 293, 362 file type 306

-6 error code 352 -7 error code 352

AFP Font Mapping 168

-8 error code 352

AFP resource not displayed 360

-9 error code 352

AFP troubleshooting . overlay 360 .NET 4.0 AFP/MO 209 build x64 sample 334 Alias Name 324 1 1 error code 356

Alpha sample 335 2

24-bit images 45

397

Alias Quality 126

Alpha_csharp 317 Alpha_VB 317

Index: Animate sample – ASPImageView_CSHARP

Animate sample 335

ASCIIConversion_VB 317

Animate_CSHARP 317

ASCIII text format

Animate_VB 317

auto detection 230, 234

Annaction sample 336

ASCIIITALIC 232

annaction_csharp 317

ASCIILINESPERPAGE 232

annaction_VB 317

ASCIIMARGIN 232

annotation

ASCIIPAGEHEIGHT 232

create 274

ASCIIPAGEWIDTH 232

create bitmap object 268

ASCIIPOINTSIZE 232

get object 274

ASCIITABSTOP 232

highlight bound box 275

ASCIITYPEFACE 232

read 275-277

ASCIIWEIGHT 232

Annotation Constants 264

ASCIIXDPI 232

Annotation sample 336

ASCIIYDPI 232

Annotation_CSHARP 317

ASP 321

Annotation_VB 317

ASP Conversion sample 338

ASCII 230, 292

ASP Image View sample 338

described 293

ASP Memory Copy sample 338

file type 305

ASP Multiple Pages sample 339

filter bit level support 292

ASP.NET Samples 321

ASCII Attribute Structure 230

Running 321

ASCII Standard Page Sizes 232

ASPConversion_CSHARP 317

ASCIICHARSPERLINE 232

aspect ratio correction 44

ASCIIConversion_CSHARP 317

ASPImageView_CSHARP 317

398

Index: ASPImageView_VB – CALS

ASPImageView_VB 318

Batch_XPS_Convert sample 339

ASPMemCopy_CSHARP 318

BatchConvert sample 339

ASPMemCopy_VB 318

bi-level images 45

ASPMultiPage_CSHARP 318

bit depth 48, 98, 202, 222

ASPMultiPage_VB 318

bitmap object

Aspnet_regiis 322

create from Snowbound object 267-268

Running 321 Aspose.Cells.dll 315 Aspose.Words.dll 315 Assembly.LoadFrom 331

BMP_COMPRESSED 293 file type 304 BMP_UNCOMPRESSED 293 file type 304

auto detection ASCII text format 230, 234 AUTOFEED_FAILED error code 354 automatically detecting 47

BOM 93 bool_repaintBackground 108 BRK defined 293

B

BROOK_TROUT

BAD_DISPLAY_AREA error code 352 BAD_HANDLE error code 353 BAD_LICENSE_PRIMARY error code 354 BAD_LICENSE_SECONDARY error

file type 305 build 32-bit 333 65-bit 334 byte order mark 93

code 354 C

BAD_RETURN error code 352 CALS BAD_STRING error code 352 described 293

399

Index: CANT_CREATE_FILE error code – CIMG_decompress_bitmap_url

file type 304

CIMG_bayer_mono 225

CANT_CREATE_FILE error code 352

CIMG_bitmap_info 131

CANT_FIND_TWAIN_DLL error

CIMG_bitmap_palette 120

code 353 CASCIITEXTATTR 289 CCITT_G3 293 file type 305 CCITT_G3_FO 293 file type 305 CCITT_G4 293 file type 305 CCITT_G4_FO 293 file type 305 CFF 293 file type 306 CIFF 294 file type 306 CIMG_animate 120

CIMG_cmyk_to_rgb 218, 220 CIMG_color_combine 218 CIMG_color_gray 222 CIMG_color_separate 219 CIMG_create_bitmap_class 84 CIMG_create_bitmapsource_annotation 268 CIMG_create_bitmapsource_ class 267 CIMG_create_handle 84 CIMG_create_handle_ddb 85 CIMG_create_handle_keep 85 CIMG_create_thumbnail 188 CIMG_decompress_bitmap 68 CIMG_decompress_bitmap_ display 70

CIMG_antique_effect 186 CIMG_decompress_bitmap_fd 71 CIMG_apply_profile 186 CIMG_decompress_bitmap_ CIMG_auto_orient 187

FlexSnap 71

CIMG_auto_orient Function 177

CIMG_decompress_bitmap_mem 72

CIMG_autocrop_bitmap 187

CIMG_decompress_bitmap_page 73

CIMG_bayer_color 225

CIMG_decompress_bitmap_url 74

400

Index: CIMG_decompress_bitmap_xps – CIMG_promote_24

CIMG_decompress_bitmap_xps 74, 279 CIMG_decompress_bitmap_xps_

CIMG_flip_bitmapx 191 CIMG_flip_bitmapy 192 CIMG_get_bitmap_palette 132

mem 279 CIMG_get_croprect 133 CIMG_decompress_fax 75 CIMG_get_deskew_angle 192 CIMG_decompress_fax_mem 76 CIMG_get_display_rect 133 CIMG_decompress_tiled_bitmap 76 CIMG_get_pages_WPF 270 CIMG_delete_bitmap 174 CIMG_get_pages_xps 277 CIMG_delete_bitmap_keep 175 CIMG_get_pages_xps_mem 278 CIMG_deskew_bitmap 189 CIMG_get_profile 193 CIMG_deskew_bitmap Function 177 CIMG_get_version 134 CIMG_despeckle_bitmap 189 CIMG_halftone_mono 227 CIMG_despeckle_bitmap Function 178

401

CIMG_histogram_equalize 193

CIMG_dib_to_ddb 190

CIMG_ifl_version 135

CIMG_dib_to_runs 191

CIMG_invert_bitmap 194

CIMG_diffusion_mono 226

CIMG_mediancut_color 224

CIMG_display_bitmap 108

CIMG_merge_bitmap 195

CIMG_display_bitmap_aspect 110

CIMG_merge_bitmap_alpha 198

CIMG_display_bitmap_transp 111

CIMG_octree_color 224

CIMG_display_ddb 111

CIMG_popularity_color 223

CIMG_display_ddb_effect 121

CIMG_print_bitmap 41

CIMG_display_fit_to_height 112

CIMG_print_bitmap_fast 41

CIMG_display_fit_to_width 113

CIMG_process_bitmap 199

CIMG_erase_rect 191

CIMG_promote_24 217

Index: CIMG_promote_32 – CIMG_window_level

CIMG_promote_32 217

CIMG_scan_feeder_close 60

CIMG_promote_8 216

CIMG_scan_get_cap 61

CIMG_remove_red_eye 200

CIMG_scan_get_cap_WPF 272

CIMG_resize_bitmap 201

CIMG_scan_open_source 61

CIMG_resize_bitmap_interp 202

CIMG_scan_open_source_WPF 270

CIMG_resize_to_gray 222

CIMG_scan_pages 62

CIMG_rgb_to_cmyk 217

CIMG_scan_pages_fast 63

CIMG_rotate_bitmap 203

CIMG_scan_pages_WPF 271

CIMG_runs_to_dib 204

CIMG_scan_set_cap 64

CIMG_save_bitmap 98

CIMG_scan_set_cap_WPF 272

CIMG_save_bitmap_fd 99

CIMG_scan_set_caps 64

CIMG_save_bitmap_mem 100

CIMG_scan_setup 65

CIMG_save_document 212

CIMG_scan_setup_WPF 273

CIMG_save_document_mem 214

CIMG_SEARCH_RESULT 288

CIMG_save_mem 161

CIMG_set_croprect 113

CIMG_save_mem_page 161

CIMG_set_croprect_scroll 114

CIMG_scan_acquire 58

CIMG_set_display_angle 204

CIMG_scan_acquire_feeder 59

CIMG_set_encrypt 102

CIMG_scan_acquire_feeder_fast 60

CIMG_set_gamma 122

CIMG_scan_acquire_feeder_fast_

CIMG_set_lut 123

WPF 269 CIMG_scan_acquire_feeder_

CIMG_sharpen_bitmap 205 CIMG_thresh_mono 226

WPF 269 CIMG_unload_plugins 175 CIMG_scan_acquire_WPF 268 CIMG_window_level 123

402

Index: CIMG_zoom_bitmap – CIMGLOW_image_dilation Function

CIMG_zoom_bitmap 115

CIMGLOW_get_fileinfo_fd 140-141

CIMG_zoom_bitmap_1_to_1 115

CIMGLOW_get_fileinfo_page 141

CIMG_zoom_bitmap_rect 116

CIMGLOW_get_filetype 142

CIMGLOW_append_page 162

CIMGLOW_get_filetype_fd 142

CIMGLOW_auto_invert Function 179

CIMGLOW_get_filetype_mem 143

CIMGLOW_autocolor 124

CIMGLOW_get_filetype_url 143

CIMGLOW_delete_page 136

CIMGLOW_get_image_orientation_

CIMGLOW_delete_page_mem 136 CIMGLOW_detect_blank_page Function 180

page 144 CIMGLOW_get_pages 144 CIMGLOW_get_pages_fd 145

CIMGLOW_extract_page 165

CIMGLOW_get_pages_mem 146

CIMGLOW_extract_page_mem 165

CIMGLOW_get_pages_url 146

CIMGLOW_extract_text 162, 209

CIMGLOW_get_palette 205

CIMGLOW_extract_text_mem 211

CIMGLOW_get_raster 206

CIMGLOW_extract_text_mem_

CIMGLOW_get_tiff_tag 147

pointer 164 CIMGLOW_get_anim_delay 137 CIMGLOW_get_ascii 234 CIMGLOW_get_ascii_page 235 CIMGLOW_get_auto_detect 137 CIMGLOW_get_bitmap_header 138 CIMGLOW_get_bitmap_name 138 CIMGLOW_get_custstring 139

CIMGLOW_get_tiff_tag_page 148 CIMGLOW_get_tiff_tag_page_fd () 149 CIMGLOW_get_tiff_tag_page_mem () 149 CIMGLOW_get_tile_info 150 CIMGLOW_get_transp_color 151 CIMGLOW_image_dilation Function 181

CIMGLOW_get_fileinfo 139

403

Index: CIMGLOW_image_erosion Function – CIMGLOW_set_html_page_size_ratio_capability

CIMGLOW_image_erosion Function 182 CIMGLOW_is_tiled_image 151 CIMGLOW_map_image_to_wnd 116 CIMGLOW_map_wnd_to_image 117 CIMGLOW_ooxml_license_enable () 96 CIMGLOW_put_palette 206 CIMGLOW_put_raster 207 CIMGLOW_read_pixel 152 CIMGLOW_redact_rects 153 CIMGLOW_redact_text 152 CIMGLOW_remove_halftone Function 182 CIMGLOW_remove_holepunch Function 183 CIMGLOW_remove_lines Function 183 CIMGLOW_search_text 166 CIMGLOW_set_alias 125 CIMGLOW_set_alias_quality 125

CIMGLOW_set_comp_quality 102 CIMGLOW_set_decomp 79 CIMGLOW_set_decomp_rect 78 CIMGLOW_set_decomp_ reduction 79 CIMGLOW_set_decompsize 80 CIMGLOW_set_dithermode 126 CIMGLOW_set_document 155 CIMGLOW_set_document_input 155, 157, 167 CIMGLOW_set_document_page_size (int, int, int) 158 CIMGLOW_set_fontmap 168 CIMGLOW_set_fontmap_path 168 CIMGLOW_set_html_capabilities 88 CIMGLOW_set_html_home_dir 89 CIMGLOW_set_html_image_capability 90 CIMGLOW_set_html_input 87 CIMGLOW_set_html_javascript_capability 90

CIMGLOW_set_ascii 235

CIMGLOW_set_html_page_size 87

CIMGLOW_set_auto_detect 78

CIMGLOW_set_html_page_size_

CIMGLOW_set_bitmap_header 154 CIMGLOW_set_bitmap_name 175

ratio 91 CIMGLOW_set_html_page_size_ ratio_capability 91

404

Index: CIMGLOW_set_html_screen_dpi – conversion

CIMGLOW_set_html_screen_dpi 92

CIMGLOW_write_tiff_stream 101

CIMGLOW_set_html_use_page_

CIMS

breaks_exclusively 92 CIMGLOW_set_image_

file type 306 CIMS (ABIC)

orientation 103 described 294 CIMGLOW_set_imnet_page_size 127 clearImage 53 CIMGLOW_set_jpeg_ decompression 80 CIMGLOW_set_jpeg2000_comp_ ratio 104 CIMGLOW_set_jpg_interleave 104

file type 294, 304 COD file type 294, 305

CIMGLOW_set_ooxml_license 96

color 48, 98, 202, 222

CIMGLOW_set_overlay_path 81

color page input 169, 216, 362

CIMGLOW_set_pdf_flags 171

color page ouput 169, 216, 362

CIMGLOW_set_pdf_fontpath 171

color reduction 49

CIMGLOW_set_pdf_output 105

compatible

CIMGLOW_set_pdf_password 82

input and output 48

CIMGLOW_set_pdfa_fontpath 172

COMPRESSION_NOT_

CIMGLOW_set_rop 127

405

CLIP

SUPPORTED error code 353

CIMGLOW_set_tiff_indexing 176

Contrast sample 340

CIMGLOW_set_tiff_save_strips 105

Contrast_CSHARP 318

CIMGLOW_set_tiff_tag 106

Contrast_VB 318

CIMGLOW_set_transp_color 129

conversion

CIMGLOW_set_wipedelay 129

error 49

CIMGLOW_unset_auto_detect 83

output too large 49

Index: Conversion sample – CSANN_read_ann_mem_page

takes too long 49

CSANN_delete_object 247

Conversion sample 341

CSANN_delete_text_objects 247

Conversion_CSHARP 318

CSANN_display_annotations 247

Conversion_VB 318

CSANN_draw_object 248

Convert_doc sample 341

CSANN_FlipX 249

converting file formats 47

CSANN_FlipY 249

CORRUPTED_FILE error code 352

CSANN_get_croprect 249

create

CSANN_get_disprect 249

bitmap object from Snowbound object 267-268 CSANN_activate_all 241 CSANN_activate_object 242 CSANN_add_object 242 CSANN_choose_color 243 CSANN_choose_font 243 CSANN_choose_line_style 244 CSANN_choose_line_width 244 CSANN_create_ann 245 CSANN_create_ann_WPF 274 CSANN_deactivate_all 245 CSANN_deactivate_object 246 CSANN_delete_all_objects 246 CSANN_delete_non_text_

CSANN_get_object_bounds 250 CSANN_get_object_data 250 CSANN_get_object_info 251 CSANN_get_object_num 251 CSANN_get_object_num_WPF 274 CSANN_highlight_object 252 CSANN_highlight_object_WPF 275 CSANN_map_image_to_wnd 252 CSANN_map_wnd_to_image 253 CSANN_mouse 253 CSANN_move_object 254 CSANN_print_annotations 254 CSANN_read_ann 255 CSANN_read_ann_FlexSnap 255 CSANN_read_ann_mem 256

objects 246 CSANN_read_ann_mem_page 256

406

Index: CSANN_read_ann_mem_page_WPF – dilation

CSANN_read_ann_mem_page_ WPF 276

CUT file type 294, 305

CSANN_read_ann_mem_WPF 277 D

CSANN_read_ann_page 257 DCS CSANN_read_ann_page_WPF 276

file type 294, 305 CSANN_read_ann_WPF 275 DCX CSANN_resize_object 257 defined 294 CSANN_rotate 257 file type 304 CSANN_set_bcolor 258 ddbeffect_CSHARP 318 CSANN_set_croprect 258 ddbeffect_VB 318 CSANN_set_disprect 259 decompress CSANN_set_fcolor 259 XPS file 279 CSANN_set_font 260 decompressing mult-pages 38 CSANN_set_line_style 260 DELETE_ERROR error code 356 CSANN_set_line_width 261 DELETE_PAGE_ERROR 355 CSANN_set_size 261 Device Independent Bitmap 237 CSANN_write_ann 262 DIB CSANN_write_ann_FlexSnap 263 described 294 CSANN_write_ann_mem 263 file type 305 CSANN_write_ann_mem_page 263 DICOM CSANN_write_ann_page 264 described 294 CSV 294 file type 305 CustomPaint 55 dilation 181

407

Index: DISK_FULL error code – error code

DISK_FULL error code 352 DISK_READ_ERROR error code 353 display quality 45 DISPLAY_ERRORerror code 356 DLL_NOT_LOADED error code 353 DOC described 294 file type 306 DocAddress 329 docplug.dll 315 Document Conversion 209 DOCX described 294 file type 306 double_calcAspectZoom 117 DPI 45, 48 changing 154 DWG file type 295, 306 dwgplug.dll 315 DXF file type 295, 306

E EMAIL 295 Encrypt_csharp 318 Encrypt_VB 318 Encryption sample 343 EOF 163, 211 EOI 164, 211 EOT 164, 211 EOTU 164, 211 EPS described 295 file type 304 EPS_BITMAP file type 295, 305 EPS_BITMAP_G4 file type 295, 305 EPS_BITMAP_LZW file type 295, 305 erosion 182 erro code -6 352 error code -1 352

408

Index: error codeZ – DXF

409

-10 352

-26 353

-100 355

-27 353

-101 355

-28 353

-102 356

-29 353

-103 356

-3 352

-104 356

-30 353

-105 356

-31 353

-106 356

-32 353

-11 352

-33 353

-12 353

-34 354

-13 353

-35 354

-14 353

-36 354

-15 353

-37 354

-16 353

-38 354

-17 353

-39 354

-18 353

-4 352

-19 353

-40 354

-2 352

-41 354

-20 353

-42 354

-21 353

-43 354

-22 353

-44 354

-23 353

-45 354

-24 353

-46 354

-25 353

-47 354

Index: error codeZ – DXF

-48 355

DELETE_ERROR 356

-5 352

DISK_FULL 352

-52 355

DISK_READ_ERROR 353

-55 355

DISPLAY_ERROR 356

-56 355

DLL_NOT_LOADED 353

-57 355

ERROR_OPENING_

-7 352 -8 352 -9 352

SCANNER 353 EVAL_TIMEOUT 353 EXCEPTION_ERROR 354 FEEDER_NOT_READY 353

1 356 ACCESS_DENIED 354 AUTOFEED_FAILED 354

FILE_NOT_FOUND 352 FONT_FONT_PATH_FOLDER_ IS_EMPTY 355

BAD_DISPLAY_AREA 352 FONT_PATH_FOLDER_ BAD_HANDLE 353 BAD_LICENSE_PRIMARY 354 BAD_LICENSE_ SECONDARY 354

MISSING_FONTS 355 FONT_PATH_FOLDER_NOT_ FOUND 355 FONT_PATH_FOLDER_TOO_

BAD_RETURN 352

FEW_FONTS 355

BAD_STRING 352

FORMAT_NOT_ALLOWED 352

CAN_CREATE_FILE 352

FORMAT_WILL_NOT_ OTFLY 353

CANT_FIND_TWAIN_DLL 353 GENERAL_ COMPRESSION_NOT_

STATUS.DEFAULT 356

SUPPORTED 353 GENERAL_STATUS.DELETE_ CORRUPTED_FILE 352

ERROR 355

410

Index: error codeZ – DXF

GENERAL_STATUS.DISPLAY_ ERROR 356 GENERAL_STATUS.IMAGE_

NO_SCANNER_FOUND 353 NO_TCOLOR_FOUND 353 NO_VECTOR_CAPABILITY 354

NOT_AVAILABLE 356 NO_WORD_VERSION 354 GENERAL_STATUS.NET_ VALID 356 GENERAL_ STATUS.SNOWBND_API_ NOT_AVAILABLE 356 GENERAL_ STATUS.SNOWBND_

NOT_A_TILED_IMAGE 353 NOT_SUPPORTED_IN_THIS_ VERSION 353 NOT_VALID 356 OOXML_LICENSE_ EXPIRED 355

OK 356 OOXML_LICENSE_NOT_ GENERAL_STATUS.SYSTEM_

FOUND 355

CRASH 355 OUT_OF_MEMORY 352 IMAGE_NOT_AVAILABLE 356 PAGE_NOT_FOUND 352 METHOD_NOT_FOUND 354 PALETTE_IMAGE_NOT_ NO_ABIC_VERSION 354

ALLOWED 353

NO_BITMAP_FOUND 352

PASSWORD_PROTECTED_

NO_CLIPBOARD_IMAGE 353 NO_DELAY_TIME_FOUND 353

FILE 355 PASSWORD_PROTECTED_ PDF 354

NO_FAST_TWAIN_ SUPPORTED 354

PIXEL_DEPTH_ UNSUPPORTE 353

NO_JPEG2000_VERSION 354 SEARCH_STRING_NOT_ NO_MORE_PAGES 353 NO_PCL_VERSION 354 NO_PDF_VERSION 354

411

FOUND 354 SNOWBND_API_NOT 356 SNOWBND_OK 356

Index: error codeZ – file type

SYSTEM_CRASH 356

file type

TIFF_TAG_NOT_FOUND 353

AFP 306

USER_CANCEL 353

ASCII 305

USING_RUNTIME 353

BMP_COMPRESSED 304

error codeZ

BMP_UNCOMPRESSED 304

NO_LZWZ_VERSION 353

BROOK_TROUT 305

error during conversion 49

CALS 304

ERROR_OPENING_SCANNER error

CCITT_G3 305

code 353

CCITT_G3_FO 305

EVAL_TIMEOUT error code 353 evaluation version

CCITT_G4 305 CCITT_G4_FO 305

installing 308

CFF 306

Excel 169, 216, 362 EXCEL

CIFF 306 CIMS 306

file type 306

CLIP 294, 304

EXCEPTION_ERROR error code 354 F

COD 294, 305 CUT 294, 305

fast printing 40

DCS 294, 305

FEEDER_NOT_READY error

DCX 304

code 353 file formats automatically detecting 47 converting 47

DIB 305 DICOM 305 DOC 306 DOCX 306 DWG 295, 306

412

Index: file type constants – file formats

413

DXF 295, 306

LINE_DATA 297, 306

EPS 304

MACPAINT 297, 304

EPS_BITMAP 295, 305

MAG 297, 305

EPS_BITMAP_G4 295, 305

MSG 306

EPS_BITMAP_LZW 295, 305

MSP 297, 305

EXCEL 306

NCR 305

FILENET 306

ODF 306

FLASHPIX 295, 305

ODP 306

GIF 304

ODS 306

GIF_INTERLACED 305

ODT 306

GX2 295, 304

OOXML 306

HTML 306

PCL_1 305

ICONTYPE 296, 304

PCL_5 306

IFF_ILBM 296, 304

PCX 304

IMG 296, 304

PDF 305

IMNET 305

PDF_15 306

IOCA 304

PDF_16 306

JBIG 305

PDF_A 306

JBIG2 306

PDF_LZW 306

JEDMICS 305

PHOTOCD 300, 305

JPEG 304

PHOTOSHOP 300, 305

JPEG2000 305

PICT 300, 304

KOFAX 296, 304

PNG 305

LASER_DATA 296, 304

POWER_POINT 306

Index: file type constants – FONT_PATH_FOLDER_MISSING_FONTS error code

PPTX 306

WPG 303-304

RAST 301, 305

XBM 303-304

RTF 306

Xerox_EPS 303, 305

SCITEX 301, 305

XLS 303

SVG 301, 306

XLSX 303, 306

TARGA 301, 304

XPM 304-305

TARGA16 301, 305

XWD 304-305

TIF_G4_FAX_STRIP 302, 305

file type constants

TIF_HUFFMAN 302, 304

PDF_15 298

TIFF_2D 301, 304

PDF_16 299

TIFF_ABIC 302, 305

FILE_NOT_FOUND error code 352

TIFF_ABIC_BW 302, 305

FileMem sample 343

TIFF_G3_FAX 302, 304

filename extension 360

TIFF_G4_FAX 302, 304

FileNet

TIFF_G4_FAX_FO 302, 305 TIFF_JBIG 305 TIFF_JPEG 302, 305 TIFF_JPEG7 303, 306 TIFF_LZW 303-304 TIFF_PACK 303-304 TIFF_UNCOMPRESSED 304 WBMP 303, 305 WINFAX 303, 305 WMF 303-304

defined 295 FILENET file type 306 files redistributed 308 FLASHPIX file type 295, 305 FONT_FONT_PATH_FOLDER_IS_ EMPTY error code 355 FONT_PATH_FOLDER_MISSING_

414

Index: FONT_PATH_FOLDER_MISSING_FONTS error code – GIF_INTERLACED

FONTS error code 355

GENERAL_STATUS.IMAGE_NOT_ AVAILABLE error code 356

FONT_PATH_FOLDER_NOT_ FOUND error code 355

GENERAL_STATUS.NOT_ VALID 286

FONT_PATH_FOLDER_TOO_FEW_ FONTS error code 355

GENERAL_STATUS.NOT_VALID error code 356

Format For Decompressed Images 237

GENERAL_STATUS.SNOWBND_ API_NOT_AVAILABLE 286

FORMAT_NOT_ALLOWED error code 352

GENERAL_STATUS.SNOWBND_ API_NOT_AVAILABLE error

FORMAT_WILL_NOT_OTFLY error

code 356

code 353

GENERAL_STATUS.SNOWBND_ G General Error Define 286

ERROR 286, 356 GENERAL_STATUS.SNOWBND_ OK 286

General Status Error 356 GENERAL_STATUS.DEFAULT 286

GENERAL_STATUS.SNOWBND_ OK error code 356

GENERAL_STATUS.DEFAULT error code 356

GENERAL_STATUS.SYSTEM_ CRASH 286

GENERAL_STATUS.DELETE_ ERROR 286

GENERAL_STATUS.SYSTEM_ CRASH error code 355

GENERAL_STATUS.DELETE_ ERROR error code 355 GENERAL_STATUS.DISPLAY_ ERROR 286 GENERAL_STATUS.DISPLAY_

GIF described 295 file type 304 GIF_INTERLACED

ERROR error code 356 described 295 GENERAL_STATUS.IMAGE_NOT_ AVAILABLE 286

415

file type 305

Index: GlobalAlloc – IMGLOW_get_tiff_tag

GlobalAlloc 100

image

GlobalLock 100

dilation 181

GX2

erosion 182

file type 295, 304 H

return orientation 177 rotate 177 image compression

halftone

1-bit bi-level images 46

remove 182

24-bit color images 46

hole punch

8-bit gray scale images 46

remove 183

preferred formats 46

HPALETTE 132

Image File Directories (IFDs) 364

HTML

Image Processing sample 343

described 296 file type 305-306

Image Saving Functions 98 IMAGE_NOT_AVAILABLE error

htmlplug.dll 315

code 356 I ICONTYPE file type 296, 304 IFF_ILBM file type 296, 304 IIS 321 IIS 7.5

ImageProcessing_CSHARP 318 ImageProcessing_VB 319 ImageWidth 213 IMG file type 296, 304 IMG_decompress_bitmap (java.awt.Image, int) 169, 216, 362

work with RasterMaster.Net 363 IMGLOW_detect_color 169, 216, 362 IMGLOW_get_tiff_tag 364

416

Index: IMGLOW_set_document_input – LINE_DATA

IMGLOW_set_document_input 157, 169, 216, 362 IMGLOW_set_pcl_input Function 182 IMGLOW_set_tiff_tag 364 IMNET

JBIG2 defined 296 file type 306 JEDMICS described 296

described 296

file type 305

file type 305

jp2plug.dll 315

input

JPEG

color page 169, 216, 362 input compatible with output 48 input document quality 48 input quality 49

described 296 file type 304 JPEG2000 defined 296

invert

file type 305

color 179 K

IOCA KOFAX described 296

file type 296, 304 file type 304 L

isValidImage 53 large documents J printing 42 jb2plug.dll 315 LASER_DATA JBIG

file type 296, 304 defined 296 LINE_DATA file type 305 file type 297, 306

417

Index: lines – NO_FAST_TWAIN_SUPPORTED error code

lines

MODCA resource

remove 183

not displayed 360

loation

MODCA troubleshooting

OOXML license file 96

overlay 360

lossy compression 49

MS Windows DIB Header 238

low output; adjusting quality 48-49

MS Windows DIB Image 239

M MACPAINT file type 297, 304

MS Windows DIB Palette 238 MSG file type 306 MSP

MAG file type 297, 305 memcopy_csharp 319 Memcopy_VB 319

file type 297, 305 multi-page format 39 multi-page images 38

Memory Copy sample 344 Merge Image sample 344

N NCR

mergeimage_CSHARP 319

defined 297

METHOD_NOT_FOUND error

file type 305

code 354 MIME file type 306 MO DCA 169, 216, 362 MODCA defined 297

NO_ABIC_VERSION error code 354 NO_BITMAP_FOUND error code 352 NO_CLIPBOARD_IMAGE error code 353 NO_DELAY_TIME_FOUND error code 353 NO_FAST_TWAIN_SUPPORTED

418

Index: NO_FAST_TWAIN_SUPPORTED error code – OOXML_LICENSE_EXPIRED error code

error code 354 NO_JPEG2000_VERSION error

O ODF

code 354 defined 297 NO_LZW_VERSION error code 353 file type 306 NO_MORE_PAGES error code 353 ODP NO_PCL_VERSION error code 354 file type 306 NO_PDF_VERSION error code 354 ODS NO_SCANNER_FOUND error code 353 NO_TCOLOR_FOUND error code 353 NO_VECTOR_CAPABILITY error

defined 297 file type 306 ODT defined 297

code 354 file type 306 NO_WORD_VERSION error code 354 noise removal 178 normal printing 40 NOT_A_TILED_IMAGE error code 353 NOT_SUPPORTED_IN_THIS_ VERSION error code 353 NOT_VALID error code 356 NOTSRCCOPY 128 NOTSRCERASE 128

Office 169, 216, 362 OnPaint 56 OnPaintBackground 56 OnSizeChanged 56 OOXML defined 297 file type 306 OOXML license file load 96 OOXML_LICENSE_EXPIRED error code 355

419

Index: OOXML_LICENSE_NOT_FOUND error code – PCX

OOXML_LICENSE_NOT_FOUND error code 355 ooxmlplug.dll 315

pages XPS file format 277-278 palette 47, 98, 202

operating system

PALETTE_IMAGES_NOT_

32-bit 333

ALLOWED error code 353

64-bit 334

Panning sample 345

orientation

panning_csharp 319

image 177

panning_VB 319

OUT_OF_MEMORY error code 352

PASSWORD_PROTECTED_FILE error code 355

output color page 169, 216, 362

PASSWORD_PROTECTED_PDF error code 354

resolution 154 path overlay save scanning 271 AFP troubleshooting 360 PCL MODCA troubleshooting 360 defined 297 P page content truncated xls 360 truncated xlsx 360 page count 38

PCL_1 297 file type 305 PCL_5 defined 297 file type 306

Page sample 345

pclplug.dll 315

page_csharp 319

PCX 297

PAGE_NOT_FOUND error code 352

file type 304

Page_VB 319

420

Index: PDF – Print_VB

PDF 87, 92, 127, 140-142, 155, 230, 281, 289-290 defined 298 file type 305 filter bit level support 292 raster 283

PHOTOSHOP file type 300, 305 PICT file type 300, 304 pixel depth 48 PIXEL_DEPTH_

vector 283 PDF output 98

UNSUPPORTED 48, 292 PIXEL_DEPTH_UNSUPPORTED error code 353

PDF v1.4 298-300 PDF/A 298-300 PDF_15 file type 298, 306 PDF_16 file type 299, 306 PDF_A file type 306 PDF_LZW 299 file type 306 PDF_PACKAGE_NOT_ SUPPORTED 355 pdfplug.dll 315

percentage 180 PNG described 301 file type 305 POWER_POINT described 301 file type 306 PowerPoint 169, 216, 362 PPTX described 301 file type 306

performance 359-360

Print sample 345

PHOTOCD

Print_CSHARP 319

file type 300, 305

421

pixels

Print_VB 319

Index: printing – return

printing 40

RasterMaster .NET x32

Printing

work with IIS 7.5 363

large documents 42 production version

RasterMaster 18.0 library 362 Read/Write Capabilities 292

installing 308

redactions 240

public_class 288

redistributables 363

public_class_CANN 240

Reference 326

public_class_CDIB_HEADER 290

remove

public_class_CIMG_RECT 287

halftone 182

public_class_CIMG_SEARCH 287

hole punch 183

public_class_CSEARCH_TEXT 290

remove lines 183

public_class_CTIFF_TAG 290

removeScrollbars 118

Q

resize 188 zoom 188, 201

quality adjusting low output 48

resolution 45, 48, 87, 92, 127, 140142, 155, 230, 281, 289-290

R RAST

changing 154 output 154

file type 301, 305

return

raster PDF 283

fast memory transfer scanning 270

RasterMaster

number of pages in XPS file 277

version get 135

orientation of image 177 pointer to number of pages in XPS file 278

422

Index: rotate – SnowbndCNet_HScrollBar

rotate

image on scanner with automatic document feeder 269

image 177

saves the path/filename 271

RTF

set cap 272

described 301

setup parameters 273

file type 306

Scan sample 346

Running 321 ASP.NET Samples 321 aspnet_regiis 322 running a sample 333

Scan_CSHARP 319 Scan_VB 319 SCITEX file type 301, 305

S

Screen_Display_Dither 126

samples SEARCH_STRING_NOT_FOUND build x32 with .NET 2.0 334 build x64 with .NET 4.0 334 saving multi-page file 38

error code 354 Set Up 329 Web Image Viewer Component 329

sbdnet.dll 362 sbdNetAnn.dll 315 SbdNetAnn.dll 315, 362

setup scan parameters 273

SbdNetLib.Snowbnd 331

SimpleMultiPages_CSHARP 319

scan

SimpleMultiPages_VB 319

fast memory transfer 269

Snowbnd() 50

get cap 272

Snowbnd(int, int, int) 51

image on currently installed scan-

SNOWBND_API_NOT error code 356

ner 268

SNOWBND_OK error code 356 SnowbndCNet_HScrollBar 66

423

Index: SnowbndCNet_VScrollBar – TIFF_JPEG

SnowbndCNet_VScrollBar 66 Snowbound ASCII 230

TIFF read tag 364

Snowbound Error Codes 352

Tiff Tag sample 348

SnowPanel Class Specific

TIFF tags 364

Methods 55 SOF 163, 211

TIFF_2D file type 301, 304

SOI 164, 211

TIFF_ABIC

SOT 164, 211

file type 302, 305

SOTU 164, 211

TIFF_ABIC_BW

Split to Multiple Pages sample 346 supported multi-page formats 38 SVG

file type 302, 305 TIFF_G3_FAX file type 302, 304

file type 301, 306 SYSTEM_CRASH error code 356 T tag specifications 364 TARGA file type 301, 304 TARGA16 file type 301, 305 Text Search sample 347 textsearch_CSHARP 319 textsearch_VB 319 third party viewers 361

TIFF_G4_FAX file type 302, 304 TIFF_G4_FAX_FO file type 302, 305 TIFF_G4_FAX_STRIP file type 302, 305 TIFF_HUFFMAN file type 302, 304 TIFF_JBIG file type 305 TIFF_JPEG 361 file type 302, 305

424

Index: TIFF_JPEG7 – variables

TIFF_JPEG7 file type 303, 306 TIFF_LZW file type 303-304

unknown file format 360 truncated page content 360 Type Property Define 285

TIFF_PACK file type 303-304 TIFF_TAG_NOT_FOUND error

U USER_CANCEL error code 353 USING_RUNTIME error code 353

code 353 UTF-16 303 TIFF_UNCOMPRESSED UTF-8 303 described 303 V

file type 304 TIFFTag_CSHARP 319 TIFFTag_VB 320

variables CIMGLOW_get_ooxml_license_ location 96

ToErrorMessage 54 CIMGLOW_set_html_home_dir 89 troubleshooting 357 CIMGLOW_set_html_image_capcorrupted file 360-361 error code 357 improving performance 359 larger file size 357 lower quality 358 missing characters 359 output differs 357

ability 90 CIMGLOW_set_html_input 87 CIMGLOW_set_html_javascript_ capability 91 CIMGLOW_set_html_page_ size 87 CIMGLOW_set_html_page_size_ ratio 91

third party viewers 361 CIMGLOW_set_html_page_size_ TIFF_JPEG 361

425

ratio_capability 92-93

Index: vector PDF – XPM

CIMGLOW_set_html_screen_ dpi 92

WPFScanning sample 350 WPG

vector PDF 283

file type 303-304

VectorConvertMem_CSHARP X

sample 351 x32

version

build sample with .NET 2.0 334

get 135

x64 W build sample with .NET 4.0 334 watermarks 240 x86 platform 363 WBMP XBM file type 303, 305 file type 303-304 Web Image Viewer Component 329 Xerox_EPS Set Up 329 file type 303, 305 Web Image Viewer Component sample 348 WINFAX file type 303, 305

xls truncated page content 360 XLS file type 303

WMF file type 303-304 Word 169, 216, 362 WPF 266-277 WPF Image sample 350 WPFAnnotation_CSHARP sample 349

xlsx truncated page content 360 XLSX file type 303, 306 XPM file type 304-305

WPFConversion sample 349

426

Index: XPS file – ZOOM_ASPECT.ASPECT_ZOOM

XPS file return number of pages 277 return pointer to number of pages 278 XPS fle decompress 279 XPSMem sample 351 XWD file type 304-305 filter bit level support 292 Z zoom 115-117, 188, 201, 258, 335, 338, 345 ZOOM_ASPECT.ASPECT_ DEFAULT 285 ZOOM_ASPECT.ASPECT_FIT_TO_ HEIGHT 285 ZOOM_ASPECT.ASPECT_FIT_TO_ WIDTH 285 ZOOM_ASPECT.ASPECT_ONE_ TO_ONE 285 ZOOM_ASPECT.ASPECT_ PRESERVE 285 ZOOM_ASPECT.ASPECT_ ZOOM 285

427