RasterMaster® SDK Imaging SDK for the .NET Platform V18.1 Programmer’s Reference Guide

Note: An online version of this manual contains information on the latest updates to Ras- terMaster. 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 REP- RESENTATIVE OF SNOWBOUND SOFTWARE CORPORATION MAKES NO WARRANTY OR REP- RESENTATION 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, trans- lated on paper, film, electronic media, or computer-readable form, or otherwise reproduced in any way, without the express written permission of Snowbound Software Corporation. , MS, MS-DOS, Windows, Windows NT, and SQL 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. Foxit PDF Reader©, copyright by Foxit Software Company. All rights reserved. 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, Aus- tralia. Aspose™, Aspose.Cells© (copyrighted 2003), Aspose.Words© (copyrighted 2003), and Aspose.Slides© (copy- righted 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 Gov- ernment is subject to restrictions as set forth under subparagraph (c)(1)(ii) of The Rights in Technical Data and Com- puter Software clause of DFARS 252.227 –19 or subparagraphs (c)(i) and (2) of the Commercial Computer Software-Restricted Rights at 48 CFR 52.227 – 19 as applicable. The Manufacturer is Snowbound Software Cor- poration, 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: 09 RasterMaster for the .NET Platform Release Number: 18.1 RasterMaster® SDK Release Number: 18.1 Printing Date: June 2012 Published by Snowbound Software Corporation. 309 Waverley Oaks Road Suite 401 Waltham, MA 02452 USA phone: 617-607-2000 fax: 617-607-2002 ©1996 - 2012 by Snowbound Software Corporation. All rights reserved. Table of Contents

Chapter 1 - Additions and Improvements 37

New Features 37

Chapter 2 - Quick Start 39

Quickly Getting Started with the Conversion Sample 39

Viewing Samples Packaged with the Library 40

Sample Directory Files 40

Reading and Displaying Images 43

Reading Images 43

Displaying an Image 43

Return Values and Error Codes 43

System Overview 44

Determining System Requirements 44

.NET Framework 4.0 Support 44

Determining Memory Requirements 45

Chapter 3 - Saving and Reading Multi-page Images 47

Multi-page Images 47

Supported Multi-page Formats 47

Decompressing a Multi-page Image 47

Determining Multi-page Page Count 47

Saving Multi-page File Formats 47

Multi-page Format Functions 48

Chapter 4 - Printing Images 49

3 Printing Overview 49

Printing Functions 49

Normal Printing 49

Fast Printing 49

CIMG_print_bitmap() 50

CIMG_print_bitmap_fast() 50

Chapter 5 - Aspect Ratio Correction Function 52

Aspect Ratio Correction Function 52

Chapter 6 - Display Quality 53

Achieving the Best Display Quality 53

24-Bit Images Displayed on a 256 Color Adapter 53

Bi-Level and 1-Bit Per Pixel Images 53

Chapter 7 - Image Compression 55

Preferred Formats 55

24-Bit Color Images 55

8-Bit Gray Scale Images 55

1-bit Bi-Level Images 55

Chapter 8 - File Format Conversion 56

Converting File Formats 56

Automatically Detecting File Formats 56

Input Document Quality: Resolution/DPI 57

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

Making Sure Input is Compatible with Output 57

Getting a Pixel_Depth_Unsupported Error 57

4 Adjusting Low Output Quality 57

Chapter 9 - Class Snow.Snowbnd Methods 59

Snowbnd() 59

Snowbnd(int, int, int) 60

Chapter 10 - SDK Class Specific Methods 62

isValidImage() 62

clearImage() 62

ToErrorMessage() 63

Chapter 11 - SnowPanel Class Specific Methods 64

Properties 64

CustomPaint() 64

OnPaint() 65

OnPaintBackground() 65

OnSizeChanged() 66

Chapter 12 - Scanning Functions 67

Scanning Constants 67

CIMG_scan_acquire() 68

CIMG_scan_acquire_feeder() 68

CIMG_scan_acquire_feeder_fast() 69

CIMG_scan_feeder_close() 70

CIMG_scan_get_cap() 70

CIMG_scan_open_source() 71

CIMG_scan_pages() 71

CIMG_scan_pages_fast() 72

5 CIMG_scan_set_cap() 73

CIMG_scan_set_caps() 74

CIMG_scan_setup() 74

Chapter 13 - Scrollbar Default Functions 76

Properties 76

SnowbndCNet_HScrollBar() 76

SnowbndCNet_VScrollBar() 77

Chapter 14 - Image Decompression Functions 78

CIMG_decompress_bitmap() 78

CIMG_decompress_bitmap_display() 80

CIMG_decompress_bitmap_fd() 81

CIMG_decompress_bitmap_FlexSnap() 81

CIMG_decompress_bitmap_mem() 82

CIMG_decompress_bitmap_page() 83

CIMG_decompress_bitmap_url() 83

CIMG_decompress_bitmap_xps() 84

CIMG_decompress_fax() 85

CIMG_decompress_fax_mem() 85

CIMG_decompress_tiled_bitmap() 86

Chapter 15 - Image Decompression Option Functions 88

CIMGLOW_set_auto_detect() 88

CIMGLOW_set_decomp_rect() 89

CIMGLOW_set_decomp_reduction() 89

CIMGLOW_set_decompsize() 90

6 CIMGLOW_set_jpeg_decompression 90

CIMGLOW_set_overlay_path() 91

CIMGLOW_set_pdf_input() 92

CIMGLOW_set_pdf_password() 92

CIMGLOW_unset_auto_detect() 93

Chapter 16 - Image Creation Functions 94

CIMG_create_bitmap_class() 94

CIMG_create_handle() 94

CIMG_create_handle_ddb() 95

CIMG_create_handle_keep() 95

Chapter 17 - HTML Functions 97

CIMGLOW_set_html_capabilities() 97

CIMGLOW_set_html_home_dir() 98

CIMGLOW_set_html_image_capability() 99

CIMGLOW_set_html_input() 99

CIMGLOW_set_html_javascript_capability() 100

CIMGLOW_set_html_page_size() 100

CIMGLOW_set_html_page_size_ratio() 101

CIMGLOW_set_html_page_size_ratio_capability() 101

CIMGLOW_set_html_screen_dpi() 102

CIMGLOW_set_html_use_page_breaks_exclusively() 102

CIMGLOW_set_html_utf_bom() 103

Chapter 18 - Open Office 2007 XML (OOXML) Functions 106

CIMGLOW_set_ooxml_license() 106

7 Chapter 19 - Image Saving Functions 107

CIMG_save_bitmap() 107

CIMG_save_bitmap_fd() 108

CIMG_save_bitmap_mem() 109

CIMGLOW_write_tiff_stream() 109

Chapter 20 - Image Saving Option Functions 111

CIMG_set_encrypt() 111

CIMGLOW_set_comp_quality() 112

CIMGLOW_set_image_orientation() 112

CIMGLOW_set_jpeg2000_comp_ratio() 113

CIMGLOW_set_jpg_interleave() 113

CIMGLOW_set_pdf_output() 114

CIMGLOW_set_tiff_save_strips 114

CIMGLOW_set_tiff_tag() 115

Chapter 21 - Image Display Functions 117

bool repaintBackground() 117

CIMG_display_bitmap() 118

CIMG_display_bitmap_aspect() 119

CIMG_display_bitmap_transp() 120

CIMG_display_ddb() 121

CIMG_display_fit_to_height() 121

CIMG_display_fit_to_width() 122

CIMG_set_croprect() 123

CIMG_set_croprect_scroll() 123

8 CIMG_zoom_bitmap() 124

CIMG_zoom_bitmap_1_to_1() 125

CIMG_zoom_bitmap_rect() 125

CIMGLOW_map_image_to_wnd() 126

CIMGLOW_map_wnd_to_image() 126

double calcAspectZoom() 127

removeScrollbars() 128

Chapter 22 - Image Display Option Functions 129

CIMG_animate() 129

CIMG_bitmap_palette() 130

CIMG_display_ddb_effect() 130

CIMG_set_gamma() 132

CIMG_set_lut() 132

CIMG_window_level() 133

CIMGLOW_autocolor() 133

CIMGLOW_set_alias() 134

CIMGLOW_set_alias_quality() 135

CIMGLOW_set_dithermode() 135

CIMGLOW_set_imnet_page_size() 136

CIMGLOW_set_rop() 137

CIMGLOW_set_transp_color() 138

CIMGLOW_set_wipedelay() 139

Chapter 23 - Information Query Functions 140

CIMG_bitmap_info() 141

9 CIMG_get_bitmap_palette() 142

CIMG_get_croprect() 142

CIMG_get_display_rect() 143

CIMG_ifl_version() 143

CIMGLOW_get_anim_delay() 144

CIMGLOW_get_auto_detect() 144

CIMGLOW_get_bitmap_header() 145

CIMGLOW_get_bitmap_name() 145

CIMGLOW_get_custstring() 146

CIMGLOW_get_fileinfo() 146

CIMGLOW_get_fileinfo_fd() 147

CIMGLOW_get_fileinfo_page() 148

CIMGLOW_get_fileinfo_fd() 148

CIMGLOW_get_filetype() 149

CIMGLOW_get_filetype_fd() 149

CIMGLOW_get_filetype_mem() 150

CIMGLOW_get_filetype_url() 150

CIMGLOW_get_image_orientation_page() 151

CIMGLOW_get_pages() 151

CIMGLOW_get_pages_fd() 152

CIMGLOW_get_pages_mem() 153

CIMGLOW_get_pages_url() 153

CIMGLOW_get_tiff_tag() 154

CIMGLOW_get_tiff_tag_page() 155

10 CIMGLOW_get_tiff_tag_page_fd() 156

CIMGLOW_get_tile_info() 156

CIMGLOW_get_transp_color() 157

CIMGLOW_is_tiled_image() 157

CIMGLOW_read_pixel() 158

CIMGLOW_set_bitmap_header() 158

CIMGLOW_set_document() 159

CIMGLOW_set_document_input(int, int) 160

CIMGLOW_set_document_input(int, int, int) 161

Chapter 24 - Text Search Functions 163

CIMG_save_document() 163

CIMGLOW_extract_text() 165

CIMGLOW_extract_text_mem() 167

CIMGLOW_extract_text_mem_pointer() 167

CIMGLOW_extract_text_pointer() 168

CIMGLOW_search_text() 168

CIMGLOW_search_text_pointer() 169

Chapter 25 - AFP Font Mapping Functions 171

AFP Font Mapping 171

Format of Font Mapping Data 171

Color Documents Rendered as Black and White 172

CIMGLOW_set_fontmap_path() 172

CIMGLOW_set_fontmap() 173

Chapter 26 - Housekeeping Functions 175

11 CIMG_delete_bitmap() 175

CIMG_delete_bitmap_keep() 176

CIMG_unload_plugins() 176

CIMGLOW_set_bitmap_name() 176

CIMGLOW_set_tiff_indexing() 177

Chapter 27 - DocClean Functions 178

CIMG_auto_orient() 178

CIMG_deskew_bitmap() 179

CIMG_despeckle_bitmap() 179

CIMGLOW_auto_invert() 180

CIMGLOW_detect_blank_page() 181

CIMGLOW_image_dilation() 182

CIMGLOW_image_erosion() 183

CIMGLOW_remove_halftone() 183

CIMGLOW_remove_lines() 184

CIMGLOW_remove_holepunch() 184

Chapter 28 - Image Processing Functions 187

CIMG_antique_effect() 188

CIMG_apply_profile() 188

CIMG_auto_orient() 189

CIMG_autocrop_bitmap() 189

CIMG_create_thumbnail() 190

CIMG_deskew_bitmap() 191

CIMG_despeckle_bitmap() 191

12 CIMG_dib_to_ddb() 192

CIMG_dib_to_runs() 193

CIMG_erase_rect() 193

CIMG_flip_bitmapx() 193

CIMG_flip_bitmapy() 194

CIMG_get_deskew_angle() 194

CIMG_get_profile() 195

CIMG_histogram_equalize() 195

CIMG_invert_bitmap() 196

CIMG_merge_annotation() 196

CIMG_merge_bitmap() 196

CIMG_merge_bitmap() 198

CIMG_merge_bitmap_alpha() 200

CIMG_process_bitmap() 201

CIMG_remove_red_eye() 202

CIMG_resize_bitmap() 203

CIMG_resize_bitmap_bicubic() 203

CIMG_resize_bitmap_interp() 204

CIMG_rotate_bitmap() 204

CIMG_runs_to_dib() 205

CIMG_set_display_angle() 205

CIMG_sharpen_bitmap() 206

CIMGLOW_get_palette() 207

CIMGLOW_get_raster() 207

13 CIMGLOW_put_palette() 208

CIMGLOW_put_raster() 208

CIMGLOW_set_fast_convert() 209

Chapter 29 - Document Conversion and Text Extraction Functions 210

Document Conversion and Text Extraction 210

CIMGLOW_extract_text() 210

CIMGLOW_extract_text_mem() 212

CIMG_save_document() 213

CIMG_save_document_mem() 215

Chapter 30 - Color Promotion Functions 217

CIMG_promote_8() 217

CIMG_promote_24() 218

CIMG_promote_32() 218

Changing Color Spaces Functions 218

CIMG_rgb_to_cmyk() 218

CIMG_cmyk_to_rgb() 219

CIMG_color_combine() 219

CIMG_color_separate() 220

CIMGLOW_get_tiff_tag() 221

Chapter 31 - Color Reduction Functions 223

CIMG_color_gray() 223

CIMG_resize_to_gray() 224

CIMG_popularity_color() 224

CIMG_mediancut_color() 225

14 CIMG_octree_color() 225

CIMG_bayer_color() 226

CIMG_bayer_mono() 227

CIMG_diffusion_mono() 227

CIMG_thresh_mono() 227

CIMG_halftone_mono() 228

CIMGLOW_detect_color() 229

Chapter 32 - ASCII Formats and Functions 231

ASCII Attribute Structure 231

CIMG_import_ascii() 234

CIMGLOW_get_ascii_attributes() 235

CIMGLOW_get_ascii_page_width() 235

CIMGLOW_set_ascii_attributes() 236

Chapter 33 - Format For Decompressed Images 237

Overview of Data Formats 237

RasterMaster Plus Options 237

MS_Windows DIB Header Format 238

MS_Windows DIB Palette Format 239

MS_Windows DIB Image Data Format 239

Chapter 34 - Annotation and Redlining Toolkit 240

public class CANN_GRAPHIC_STRUCT Structure 242

CSANN_activate_all_objects() 243

CSANN_activate_object() 243

CSANN_add_object() 244

15 CSANN_choose_color() 245

CSANN_choose_font() 245

CSANN_choose_line_style() 245

CSANN_choose_line_width() 246

CSANN_create_ann() 246

CSANN_deactivate_all_objects() 247

CSANN_deactivate_object() 247

CSANN_delete_all_objects() 248

CSANN_delete_object() 248

CSANN_display_annotations() 249

CSANN_draw_object() 249

CSANN_FlipX() 250

CSANN_FlipY() 250

CSANN_get_croprect() 250

CSANN_get_disprect() 251

CSANN_get_object_bounds() 251

CSANN_get_object_data() 252

CSANN_get_object_info() 252

CSANN_get_object_num() 252

CSANN_highlight_object() 253

CSANN_map_image_to_wnd() 253

CSANN_map_wnd_to_image() 254

CSANN_mouse() 254

CSANN_move_object() 255

16 CSANN_print_annotations() 256

CSANN_read_ann() 256

CSANN_read_ann_FlexSnap() 257

CSANN_read_ann_mem() 257

CSANN_read_ann_mem_page() 257

CSANN_read_ann_page() 258

CSANN_resize_object() 258

CSANN_rotate() 259

CSANN_set_bcolor() 259

CSANN_set_croprect() 260

CSANN_set_disprect() 260

CSANN_set_fcolor() 260

CSANN_set_font() 261

CSANN_set_line_style() 261

CSANN_set_line_width() 262

CSANN_set_size() 263

CSANN_write_ann() 263

CSANN_write_ann_FlexSnap() 264

CSANN_write_ann_mem() 264

CSANN_write_ann_mem_page() 265

CSANN_write_ann_page() 265

Annotation Constants 265

Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions 267

Working with .NET Bitmapsource for the WPF Image Control 268

17 CIMG_create_bitmapsource_class() 268

CIMG_create_bitmapsource_class() 268

CIMG_create_bitmapsource_annotation() 269

CIMG_scan_acquire_WPF() 269

CIMG_scan_acquire_feeder_WPF() 270

CIMG_scan_acquire_feeder_fast_WPF() 270

CIMG_scan_open_source_WPF() 271

CIMG_scan_pages_fast_WPF() 271

CIMG_scan_pages_WPF() 272

CIMG_scan_get_cap_WPF() 273

CIMG_scan_set_cap_WPF() 273

CIMG_scan_setup_WPF() 274

Annotating with .NET WPF controls 275

CSANN_create_ann_WPF() 275

CSANN_get_object_num_WPF() 275

CSANN_highlight_object_WPF() 276

CSANN_read_ann_WPF() 276

CSANN_read_ann_page_WPF() 277

CSANN_read_ann_mem_page_WPF() 277

CSANN_read_ann_mem_WPF() 278

Working with XML Paper Specification (XPS) Documents 278

CIMG_get_pages_xps() 278

CIMG_get_pages_xps_mem() 279

CIMG_decompress_bitmap_xps() 279

18 CIMG_decompress_bitmap_xps_mem() 280

Chapter 36 - Working with PDF and Other Document File Formats 281

Working with Document File Formats 281

Saving 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 283

Appendix A - Classes and Support Values 284

Type Property Define Values 284

General Error Define Values Retrieved from Status Property 285

public class CIMG_RECT 285

public class CIMG_SEARCH_RESULT 286

public class CASCIITEXTATTR 287

public class CSEARCH_TEXT 288

public class CDIB_HEADER 288

public class CTIFF_TAG 288

public class CSNBDTILESTRUCT 289

Appendix B - Supported File Formats 290

Descriptions of Supported File Formats 290

File Type Constants Listed by File Type Number 303

19 Appendix C - Software Installation 306

Overview of the Installation Process 306

Redistributing Snowbound Files 307

What to Expect When Installing an Evaluation Version 307

What to Expect in a Production Version 307

Installing the Production Version of RasterMaster .NET 307

Installing the Software 308

Directory Structure 313

Installed Files 313

Main Directory Files 314

Strong Name Support 314

Docs Directory Files 315

Marketing Directory Files 315

Sample Directory Files 315

Chapter D - Set Up for ASP .NET Samples 319

Overview of the Set Up Process 319

Setting Up the Environment to Run Web Applications 320

Setting Up Samples on a Web Server 321

Running ASP.NET Samples 325

Chapter E - Set Up for the Web Image Viewer Component 326

Introduction to the Web Image Viewer 326

Steps to Run the Web Image Viewer Control in 326

Troubleshooting 327

Appendix F - .NET Samples 329

20 Overview of the .NET Samples 330

Running a Sample 330

Building 32-bit Application Running on a 64-bit 330

Building for a 64-bit Operating System 331

Building a RasterMaster .NET x64 sample with .NET 4.0 331

Building a RasterMaster .NET x32 sample with .NET 2.0 331

Alpha 332

Animate 332

Annaction 333

Annotation 333

ASP Conversion 335

ASP Image View 335

ASP Memory Copy 335

ASP Multiple Pages 336

Batch_XPS_Convert 336

ConsoleApp 336

Contrast 337

Conversion 337

Convert_Doc 338

DDB Effect 338

DocClean 339

Encryption 339

FileMem 340

Image Processing 340

21 Memory Copy 340

Merge Image 341

Page 341

Panning 342

Print 342

Scan 342

Split to Multiple Pages 343

Text Search 343

Thumbnail 344

Tiff Tag 344

WPFAnnotation_CSHARP 345

WPFConversion_CSHARP 345

WPFScanning_CSHARP 346

Web Image Viewer Component 347

WPF Image 347

XPSMem_CSHARP 347

Appendix G - TIFF Tags 349

Sources for Tag Specifications 349

Descriptions of Tags in Numerical Order 350

Appendix H - Snowbound Error Codes 375

Detailed Status/Error Codes 375

General Error Define Values Retrieved from Status Property 378

General Status/Error Codes 379

Appendix I - Troubleshooting 380

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

Output Document Differs from Original Document 380

Output Document Has Much Larger File Size than the Original Document 380

Output Document Has Much Lower Quality than the Original Document 381

Output Document Displays Incorrect or Missing Characters 382

Improving Performance 382

Identifying an Unknown File Format 383

Receiving a -3 Corrupted File Error code 383

Overlay Resources Not Pulled into APF or MODCA Document 383

Searching for Text in a Snowbound Software Generated PDF 383

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

RasterMaster .NET 4.0 Compatability 384

Color Documents Rendered as Black and White 385

Upgrading to the RasterMaster 18.0 Library 385

Getting RasterMaster .NET x32 to work with IIS 7.5 385

23 List of Tables

Table 2.1: RasterMaster .NET Imaging SDK Samples Directory 40

Table 2.2: Memory Requirements Based on Image Size 45

Table 3.1: Supported Multi-page Functions 48

Table 4.1: CIMG_print_bitmap Function Variables 50

Table 4.2: CIMG_print_bitmap_fast Function Variables 51

Table 5.1: Aspect Ratio Function Description 52

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

Table 10.1: ToErrorMessage Variable 63

Table 11.1: SnowPanel Class Specific Method Properties 64

Table 11.2: CustomPaint Variable 64

Table 11.3: OnPaint Variable 65

Table 11.4: OnPaintBackground Variable 65

Table 11.5: OnSizeChanged Variable 66

Table 12.1: CSCAN_CAPS Variables 67

Table 12.2: CIMG_scan_acquire Function Variable 68

Table 12.3: CIMG_scan_acquire_feeder Function Variables 69

Table 12.4: CIMG_scan_acquire_feeder_fast Function Variables 69

Table 12.5: CIMG_scan_get_cap Function Variables 70

Table 12.6: CIMG_scan_open_source Function Variable 71

Table 12.7: CIMG_scan_pages Function Variables 72

Table 12.8: CIMG_scan_page_fast Function Variables 73

Table 12.9: CIMG_scan_set_cap Function Variables 73

Table 12.10: CIMG_scan_set_caps Function Variable 74

24 Table 12.11: CIMG_scan_setup Function Variable 74

Table 13.1: Scrollbar Default Function Properties 76

Table 13.2: SnowbndCNet _HScrollBar Variables 76

Table 13.3: SnowbndCNet _VScrollBar Variables 77

Table 14.1: : CIMG_decompress_bitmap Function Variable 80

Table 14.2: CIMG_decompress_bitmap_display Function Variables 80

Table 14.3: CIMG_decompress_bitmap_fd Function Variables 81

Table 14.4: CIMG_decompress_bitmap_FlexSnap Function Variables 81

Table 14.5: CIMG_decompress_bitmap_mem Function Variables 82

Table 14.6: CIMG_decompress_bitmap_page Function Variables 83

Table 14.7: CIMG_decompress_bitmap_url Function Variables 84

Table 14.8: CIMG_decompress_bitmap_xps Function Variables 84

Table 14.9: CIMG_decompress_fax Function Variables 85

Table 14.10: CIMG_decompress_fax_mem Function Variables 86

Table 14.11: CIMG_decompress_tiled_bitmap Function Variables 86

Table 15.1: CIMGLOW_set_auto_detect Function Variable 88

Table 15.2: CIMGLOW_set_decomp_rect Function Variables 89

Table 15.3: CIMGLOW_set_decomp_reduction Function Variable 90

Table 15.4: CIMGLOW_set_decompsize Function Variables 90

Table 15.5: CIMGLOW_set_jpeg_decompression Function Variable 91

Table 15.6: CIMGLOW_set_pdf_input Function Variables 92

Table 15.7: CIMGLOW_set_pdf_password Function Variables 92

Table 15.8: CIMGLOW_unset_auto_detect Function Variable 93

Table 16.1: CIMG_create_bitmap_class Function Variable 94

25 Table 16.2: CIMG_create_handle Function Variable 94

Table 16.3: CIMG_create_handle_ddb Function Variables 95

Table 16.4: CIMG_create_handle_keep Function Variable 96

Table 17.1: CIMGLOW_set_html_capabilities Function Variables 98

Table 17.2: CIMGLOW_set_html_home_dir function variable descriptions. 98

Table 17.3: CIMGLOW_set_html_image_capability function variable descriptions. 99

Table 17.4: CIMGLOW_set_html_input function variable descriptions. 99

Table 17.5: CIMGLOW_set_html_javascript_capability function variable descriptions. 100

Table 17.6: CIMGLOW_set_html_page_size function variable descriptions . 100

Table 17.7: CIMGLOW_set_html_page_size_ratio function variable descriptions . 101

Table 17.8: CIMGLOW_set_html_page_size_ratio_capability function variable descrip- tions . 102

Table 17.9: CIMGLOW_set_html_screen_dpi function variable descriptions . 102

Table 17.10: CIMGLOW_set_html_use_page_breaks_exclusively function variable descriptions. 103

Table 17.11: CIMGLOW_set_html_utf_bom Function Variables 103

Table 17.12: Representations of byte order marks by encoding 104

Table 18.1: CIMGLOW_set_ooxml_license function variable descriptions. 106

Table 19.1: CIMG_save_bitmap Function Variables 108

Table 19.2: CIMG_save_bitmap_fd Function Variables 108

Table 19.3: CIMG_save_bitmap_mem Function Variables 109

Table 19.4: CIMGLOW_write_tiff_stream Function Variables 110

Table 20.1: CIMG_set_encrypt Function Variables 111

Table 20.2: CIMGLOW_set_comp_quality Function Variable 112

Table 20.3: CIMGLOW_set_image_orientation Function Variable 112

26 Table 20.4: CIMGLOW_set_jpeg2000_comp_ratio Function Variable 113

Table 20.5: CIMGLOW_set_jpg_interleave Function Variables 114

Table 20.6: CIMGLOW_set_pdf_output Function Variables 114

Table 20.7: CIMGLOW_set_tiff_save_strips Function Variable 115

Table 20.8: CIMGLOW_set_tiff_tag Function Variable 115

Table 21.1: bool repaintBackground Variables 117

Table 21.2: CIMG_display_bitmap Function Variables 119

Table 21.3: CIMG_display_bitmap_aspect Variables 120

Table 21.4: CIMG_display_bitmap_transp Function Variables 120

Table 21.5: CIMG_display_ddb Function Variables 121

Table 21.6: CIMG_display_fit_to_height Function Variables 122

Table 21.7: CIMG_display_fit_to_width Function Variables 122

Table 21.8: CIMG_set_croprect Function Variables 123

Table 21.9: CIMG_set_croprect_scroll Function Variables 124

Table 21.10: CIMG_zoom_bitmap Function Variables 124

Table 21.11: CIMG_zoom_bitmap_1_to_1 Function Variables 125

Table 21.12: CIMG_zoom_bitmap_rect Function Variables 125

Table 21.13: CIMGLOW_map_image_to_wnd Function Variables 126

Table 21.14: CIMGLOW_map_wnd_to_image Function Variables 127

Table 21.15: double calcAspectZoom Variables 127

Table 21.16: RemoveScrollbars Variables 128

Table 22.1: CIMG_animate Function Variables 130

Table 22.2: CIMG_bitmap_palette Function Variable 130

Table 22.3: CIMG_display_ddb_effect Function Variables 131

27 Table 22.4: CIMG_set_gamma Function Variable 132

Table 22.5: CIMG_set_lut Function Variables 132

Table 22.6: CIMG_window_level Function Variables 133

Table 22.7: CIMGLOW_autocolor Function Variable 134

Table 22.8: CIMGLOW_set_alias_img Function Variable 134

Table 22.9: CIMGLOW_set_alias_quality Function Variable 135

Table 22.10: CIMGLOW_set_dithermode Function Variable 135

Table 22.11: CIMGLOW_set_imnet_page_size Function Variables 136

Table 22.12: CIMGLOW_set_rop Function Variables 137

Table 22.13: CIMGLOW_set_transp_color Function Variable 138

Table 22.14: CIMGLOW_set_wipedelay Function Variable 139

Table 23.1: CIMG_bitmap_info Function Variable 142

Table 23.2: CIMG_get_croprect Function Variable 143

Table 23.3: CIMG_get_display_rect Function Variables 143

Table 23.4: CIMG_ifl_version Function Variable 143

Table 23.5: CIMGLOW_get_anim_delay Function Variable 144

Table 23.6: CIMGLOW_get_auto_detect Function Variable 144

Table 23.7: CIMGLOW_get_bitmap_header Function Variables 145

Table 23.8: CIMGLOW_get_bitmap_name Function Variables 145

Table 23.9: CIMGLOW_get_custstring Function Variable 146

Table 23.10: CIMGLOW_get_fileinfo Function Variables 147

Table 23.11: CIMGLOW_get_fileinfo_fd Function Variables 147

Table 23.12: CIMGLOW_get_fileinfo_page Function Variables 148

Table 23.13: CIMGLOW_get_fileinfo_fd Function Variables 148

28 Table 23.14: CIMGLOW_get_filetype Function Variable 149

Table 23.15: CIMGLOW_get_filetype_fd Function Variable 149

Table 23.16: CIMGLOW_get_filetype_mem Function Variable 150

Table 23.17: CIMGLOW_get_filetype_url Function Variable 150

Table 23.18: CIMGLOW_get_image_orientation_page Function Variables 151

Table 23.19: CIMGLOW_get_pages Function Variable 152

Table 23.20: CIMGLOW_get_pages_fd Function Variable 152

Table 23.21: CIMGLOW_get_pages_mem Function Variable 153

Table 23.22: CIMGLOW_get_pages_url Function Variable 153

Table 23.23: CIMGLOW_get_tiff_tag Function Variables 154

Table 23.24: CIMGLOW_get_tiff_tag_page Function Variables 155

Table 23.25: CIMGLOW_get_tiff_tag_page_fd Function Variables 156

Table 23.26: CIMGLOW_get_tile_info Function Variables 156

Table 23.27: CIMGLOW_is_tiled_image Function Variable 157

Table 23.28: CIMGLOW_read_pixel Function Variables 158

Table 23.29: CIMGLOW_set_bitmap_header Function Variables 158

Table 23.30: CIMGLOW_set_document Function Variables 159

Table 23.31: CIMGLOW_set_document_input Function Variables 160

Table 23.32: CIMGLOW_set_document_input Function Variable 161

Table 24.1: CIMG_save_document Function Variables 163

Table 24.2: CIMGLOW_extract_text Function Variables 165

Table 24.3: Extracted Text Variables 166

Table 24.4: CIMGLOW_extract_text_mem Function Variables 167

Table 24.5: CIMGLOW_extract_text_mem_pointer Function Variables 167

29 Table 24.6: CIMGLOW_extract_text_pointer Function Variables 168

Table 24.7: CIMGLOW_search_text Function Variables 169

Table 24.8: CIMGLOW_search_text_pointer Function Variables 170

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

Table 25.2: CIMGLOW_set_fontmap_path Function Variables 173

Table 25.3: CIMGLOW_set_fontmap Function Variables 173

Table 26.1: CIMGLOW_set_bitmap_name Function Variables 177

Table 26.2: CIMGLOW_set_tiff_indexing Function Variables 177

Table 27.1: CIMG_auto_orient Function Variables 178

Table 27.2: CIMG_deskew_bitmap Function Variable 179

Table 27.3: CIMG_despeckle_bitmap Function Variable 180

Table 27.4: CIMGLOW_auto_invert Function Variables 180

Table 27.5: CIMGLOW_detect_blank_page Function Variables 181

Table 27.6: CIMGLOW_image_dilation Function Variable 182

Table 27.7: CIMGLOW_image_erosion Function Variable 183

Table 27.8: CIMGLOW_remove_halftone Function Variables 183

Table 27.9: CIMGLOW_remove_lines Function Variables 184

Table 27.10: CIMGLOW_remove_holepunch Function Variables 185

Table 28.1: CIMG_apply_profile Function Variables 188

Table 28.2: CIMG_apply_profile Variable Modes 188

Table 28.3: CIMG_auto_orient Function Variable 189

Table 28.4: CIMG_autocrop_bitmap Function Variable 190

Table 28.5: CIMG_create_thumbnail Function Variables 190

Table 28.6: CIMG_deskew_bitmap Function Variable 191

30 Table 28.7: CIMG_despeckle_bitmap Function Variable 192

Table 28.8: CIMG_dib_to_ddb Function Variables 192

Table 28.9: CIMG_erase_rect Function Variables 193

Table 28.10: CIMG_get_deskew_angle Function Variables 194

Table 28.11: CIMG_get_profile Function Variables 195

Table 28.12: CIMG_merge_annotation Function Variables 196

Table 28.13: CIMG_merge_bitmap Function Variables 197

Table 28.14: CIMG_merge_bitmap Function Variables 199

Table 28.15: CIMG_merge_bitmap_alpha Function Variables 200

Table 28.16: CIMG_process_bitmap Function Variables 201

Table 28.17: CIMG_remove_red_eye Function Variables 202

Table 28.18: CIMG_resize_bitmap Function Variables 203

Table 28.19: CIMG_resize_bitmap_bicubic Function Variables 203

Table 28.20: CIMG_resize_bitmap_interp Function Variables 204

Table 28.21: CIMG_rotate_bitmap Function Variable 205

Table 28.22: CIMG_set_display_angle Function Variable 206

Table 28.23: CIMG_sharpen_bitmap Function Variable 206

Table 28.24: CIMGLOW_get_palette Function Variables 207

Table 28.25: CIMGLOW_get_raster Function Variables 207

Table 28.26: CIMGLOW_put_palette Function Variables 208

Table 28.27: CIMGLOW_put_raster Function Variables 208

Table 28.28: CIMGLOW_set_fast_convert Function Variables 209

Table 29.1: CIMGLOW_extract_text Function Variables 211

Table 29.2: Extracted Text Variable 211

31 Table 29.3: CIMGLOW_extract_text_mem Function Variables 212

Table 29.4: Extracted Text Variable 212

Table 29.5: CIMG_save_document Function Variables 213

Table 29.6: CIMG_save_document_mem Function Variables 215

Table 30.1: CIMG_color_combine Function Variables 219

Table 30.2: CIMG_color_separate Function Variables 220

Table 30.3: CIMGLOW_get_tiff_tag Function Variables 221

Table 31.1: CIMG_resize_to_gray Function Variables 224

Table 31.2: CIMG_octree_color Function Variables 226

Table 31.3: CIMG_thresh_mono Function Variable 228

Table 32.1: public class CASCIITEXTATTR Variables 232

Table 32.2: ASCIITEXTATTR Function Flags 232

Table 32.3: Standard Page Sizes 233

Table 32.4: CIMG_import_ascii Function Variables 234

Table 32.5: CIMGLOW_get_ascii_attributes Function Variable 235

Table 32.6: CIMGLOW_get_ascii_page_width Function Variable 235

Table 32.7: CIMGLOW_set_ascii_attributes Function Variable 236

Table 33.1: MS_Windows DIB Palette Format 239

Table 33.2: MS_Windows DIB Image Data Format 239

Table 34.1: CANN_GRAPHIC_STRUCT Class Variables 242

Table 34.2: CSANN_activate_objectFunction Variables 244

Table 34.3: CSANN_add_object Function Variables 244

Table 34.4: CSANN_choose_color Function Variable 245

Table 34.5: CSANN_choose_line_style Function Variable 246

32 Table 34.6: CSANN_choose_line_width Function Variable 246

Table 34.7: CSANN_create_ann Function Variables 247

Table 34.8: CSANN_deactivate_object Function Variables 248

Table 34.9: CSANN_delete_object Function Variables 248

Table 34.10: CSANN_display_annotations Function Variables 249

Table 34.11: CSANN_draw_object Function Variables 250

Table 34.12: CSANN_get_croprect Function Variables 250

Table 34.13: CSANN_get_disprect Function Variables 251

Table 34.14: CSANN_get_object_bounds Function Variables 251

Table 34.15: CSANN_get_object_dataFunction Variables 252

Table 34.16: CSANN_get_object_info Function Variables 252

Table 34.17: CSANN_get_object_numFunction Variables 253

Table 34.18: CSANN_highlight_object Function Variables 253

Table 34.19: CSANN_map_image_to_wnd Function Variables 254

Table 34.20: CSANN_map_wnd_to_image Function Variables 254

Table 34.21: CSANN_mouse Function Variables 255

Table 34.22: CSANN_print_annotations Function Variables 256

Table 34.23: CSANN_read_ann Function Variables 256

Table 34.24: CSANN_read_ann_FlexSnap Function Variables 257

Table 34.25: CSANN_read_ann_mem Function Variables 257

Table 34.26: CSANN_read_ann_mem_page Function Variables 258

Table 34.27: CSANN_read_ann_page Function Variables 258

Table 34.28: CSANN_resize_object Function Variables 258

Table 34.29: CSANN_rotate Function Variables 259

33 Table 34.30: CSANN_set_bcolor Function Variables 259

Table 34.31: CSANN_set_croprect Function Variables 260

Table 34.32: CSANN_set_disprect Function Variables 260

Table 34.33: CSANN_set_fcolor Function Variables 261

Table 34.34: CSANN_set_font Function Variables 261

Table 34.35: CSANN_set_line_style Function Variables 262

Table 34.36: CSANN_set_line_width Function Variables 262

Table 34.37: CSANN_set_size Function Variables 263

Table 34.38: CSANN_write_ann Function Variables 263

Table 34.39: CSANN_write_ann_FlexSnap Function Variables 264

Table 34.40: CSANN_write_ann_mem Function Variables 264

Table 34.41: CSANN_write_ann_mem_page Function Variables 265

Table 34.42: CSANN_write_ann_page Function Variables 265

Table 34.43: Annotation Constants 265

Table 35.1: CIMG_create_bitmapsource_class Function Variable 268

Table 35.2: CIMG_create_bitmapsource_class Function Variable 268

Table 35.3: CIMG_create_bitmapsource_annotation Function Variables 269

Table 35.4: CIMG_scan_acquire_WPF Function Variables 269

Table 35.5: CIMG_scan_acquire_feeder_WPF Function Variables 270

Table 35.6: CIMG_scan_acquire_feeder_fast_WPF Function Variables 271

Table 35.7: CIMG_scan_open_source_WPF Function Variable 271

Table 35.8: CIMG_scan_pages_fast_WPF Function Variable 272

Table 35.9: CIMG_scan_pages_WPF Function Variables 272

Table 35.10: CIMG_scan_get_cap_WPF Function Variables 273

34 Table 35.11: CIMG_scan_set_cap_WPF Function Variables 274

Table 35.12: CSANN_create_ann_WPF Function Variables 275

Table 35.13: CSANN_get_object_num_WPF Function Variables 275

Table 35.14: CSANN_highlight_object_WPF Function Variables 276

Table 35.15: CSANN_read_ann_WPF Function Variables 276

Table 35.16: CSANN_read_ann_page_WPF Function Variables 277

Table 35.17: CSANN_read_ann_mem_page_WPF Function Variables 277

Table 35.18: CSANN_read_ann_mem_WPF Function Variables 278

Table 35.19: CIMG_get_pages_xps Function Variable 278

Table 35.20: CIMG_get_pages_xps_mem Function Variable 279

Table 35.21: CIMG_decompress_bitmap_xps Function Variables 279

Table 35.22: CIMG_decompress_bitmap_xps_mem Function Variables 280

Table 36.1: CIMGLOW_set_document Function Variables 281

Table 36.2: CIMGLOW_set_pdf_output Function Variables 282

Table A.1: Type Property Define Values 284

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

Table A.3: public class CIMG_RECT Variables 286

Table A.4: public class CIMG_SEARCH_RESULT Variables 286

Table A.5: public class CASCIITEXTATTR Variables 287

Table A.6: public class CTIFF_TAG Variables 289

Table B.1: File Format Key 290

Table B.2: Supported File Format Descriptions 291

Table B.3: File Type Constants listed by File Type Number 303

Table C.1: RasterMaster .NET Imaging SDK Default Directory File 314

35 Table C.2: RasterMaster .NET Imaging SDK Docs Directory Files 315

Table C.3: RasterMaster .NET Imaging SDK SamplesDirectory 315

Table G.1: TIFF Tags in Numerical Order1 350

Table H.1: Error Codes 375

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

Table H.3: General Status/Error Codes 379

36 Chapter 1 - Additions and Improvements

Chapter 1 - Additions and Improvements

This chapter describes the latest additions and improvements to the software.

Version 18.1 Additions and Improvements

The following are the new features and formats added to Version 18.1 of the RasterMaster Imag- ing SDK and library for the .NET platform.

New Features

The following are the new features added to Version 18.1 of the product.

l Microsoft’s .NET Framework 4.0 provides the Windows Presentation Foundation (WPF) controls and tools. Microsoft .NET also provides support for XML Paper Specification (XPS) documents. RasterMaster .NET provides functions and samples to enable you to use RasterMaster’s powerful features with:

WPF System::Windows::Media::Visual control - the hub of all drawing related activity in WPF.

BitmapSource to use RasterMaster images in an Image control

XPS documents in memory or in a file.

Note: You will need to use the .NET 4.0 build of the SbdNetAnn library in order to use the methods and samples described in this chapter. The .NET 4.0 build is included with the RasterMaster .NET SDK.

For more information on the new WPF functions, please see Chapter 35, WPF and Microsoft .NET Framework 4.0 Support Functions.

l The Samples directory in RasterMaster .NET has a WPF subdirectory that includes the following samples:

l Batch_XPS_Convert demonstrates how to decompress from memory for the XPS file format.

l WPFAnnotation_CSHARP demonstrates how to display images and annotations with the WPF image functions.

l WPFConversion_CSHARP demonstrates how to convert with the WPF image functions.

37 Chapter 1 - Additions and Improvements

l WPFScanning_CSHARP demonstrates how to apply scanning with the WPF image functions.

l XPSMem_CSHARP demonstrates how to decompress from memory for the XPS file format.

l Added the data type CIMG_IMAGE_TYPE to .NET library to include all current image types defined in library.

When using the .NET library, instead of giving the format number such as 59, use CIMG_IMAGE_TYPE.pdf as shown in the following example: status = simage.CIMGLOW_set_auto_detect((int)CIMG_IMAGE_ TYPE.ascii);

l Added a new sample for color conversion of PDF to TIFF files. The innovative color detection functionality in RasterMaster version 18.1 enables dramatic file size reduction in multi-page documents that are mainly text-based but contain some color or gray-scale images – speeding processing and file transfer, decreasing storage space and enhanc- ing collaboration and sharing. This is accomplished using the new CIMGLOW_detect_ color() function.

l Added the OOXML_LICENSE_NOT_FOUND (-52) error message that is returned when no license file is found.

l Added the OOXML_LICENSE_EXPIRED (-53) error message that is returned when the license file is found but invalid.

Added support for 24-bit and 1-bit bit-depths for RTF document reading.

l Multiple enhancements and bug fixes to the Word file format.

l Multiple enhancements and bug fixes to the PDF file format.

l Multiple enhancements and bug fixes to the PCL file format.

l Multiple enhancements and bug fixes to the AFP file format.

38 Chapter 2 - Quick Start

Chapter 2 - Quick Start

This chapter describes how to quickly start decompressing and displaying images using the RasterMaster .NET Imaging SDK.

If you do not find the information that you are looking for in this manual, please open a support ticket at http://www.support.snowbound.com to request a specific sample, for clarification of a method description or to help you find the information they need. We are dedicated to helping our customers succeed and we are constantly enhancing our products based on feedback from customers like you.

Quickly Getting Started with the Conversion Sample

The fastest way to get started is to run the Conversion sample that is included with this prod- uct. You can find the samples in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET\Net\Sample. The Conversion sample will convert any supported document type into the file format you request and then display it. For more infor- mation, please on how to find and run the Conversion sample.

The Conversion sample uses three routines that are at the heart of RasterMaster:

1. CIMG_decompress_bitmap() - reads in a document in any format and converts it to a valid Snowbound image.

2. CIMG_display_bitmap() - displays a valid Snowbound image.

3. CIMG_save_bitmap() - saves the valid Snowbound image to any available format.

The functions mentioned above are described in detail later in this manual. This manual also covers the following topics:

1. How to read and save multi-page documents. For more information, please see Chapter 3, Saving and Reading Multi-page Images.

2. How to adjust the color, compression and resolution attributes of documents for per- formance, better quality output, or smaller output. For more information, please see Chapter 30, Color Promotion Functions and Chapter 31, Color Reduction Functions.

3. How to extract text and search for text in documents. For more information, please see Chapter 29, Document Conversion and Text Extraction Functions’. Please note that Snowbound Software does not yet support OCR (Optical Character Recognition). There- fore, we can only extract text from documents that contain text. You can use Ras- terMaster in conjunction with OCR tools from other companies if you need to extract text from scanned document images.

We include a lot of code samples to help you get started. These samples are listed in Appendix F, .NET Samples. We have also indexed our documentation and made it searchable to help you find what you need quickly.

39 Chapter 2 - Quick Start

If you have any questions please do not hesitate to open a support ticket at http://www- .support.snowbound.com.

Viewing Samples Packaged with the Library

To run a sample, open any of the samples described below in your development environment such as Visual Studio.

Sample Directory Files

The samples directory contains the .NET Imaging SDK samples that are described in Table 2- 1. All of the .NET samples include C#.NET and VB.NET source code. For more information about each sample, see Appendix F.

Table 2.1: RasterMaster .NET Imaging SDK Samples Directory

Sample Description Sample for using the .NET library in C# to load, display Alpha_csharp the image, and use basic operations like zoom and rotate to manipulate the image. See Alpha for more information. Sample for using the .NET library in Visual Basic to load, display the image, and use basic operations like zoom Alpha_VB and rotate to manipulate the image. See Alpha for more information. Sample for displaying an animated GIF image in C#. See Animate_CSHARP Animate for more information. Sample for displaying an animated GIF image in Visual Animate_VB Basic. See Animate for more information. Sample for using the .NET library in C# mouse handler to annaction_csharp add an annotation. See Annaction for more information. Sample for using the .NET library in Visual Basic mouse annaction_VB handler to add an annotation. See Annaction for more information. Sample for using the .NET library in C# to add an anno- Annotation_CSHARP tation. See Annotation for more information. Sample for using the .NET library in Visual Basic to add Annotation_VB an annotation. See Annotation for more information. Sample for demonstrating a simple conversion in C#. ASPConversion_CSHARP See ASP Conversion for more information. Sample for demonstrating a simple conversion in Visual ASPConversion_VB Basic. See ASP Conversion for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in C# to load, display the ASPImageView_CSHARP image, and use basic operations like zoom and rotate to manipulate the image. See ASP Image View for more information.

40 Chapter 2 - Quick Start

Sample Description Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in Visual Basic to load, dis- ASPImageView_VB play the image, and use basic operations like zoom and rotate to manipulate the image. See ASP Image View for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in C# for saving and reading ASPMemCopy_CSHARP the image from memory. See ASP Memory Copy for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in Visual Basic for saving and ASPMemCopy_VB reading the image from memory. See ASP Memory Copy for more information. Sample for demonstrating how to use the ASP .NET and ASPMultiPage_CSHARP Snowbound .NET libraries in C# to browse multiple page images. See ASP Multiple Pages for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in Visual Basic to browse mul- ASPMultiPage_VB tiple page images. See ASP Multiple Pages for more information. Sample for comparing an image that had the brightness Contrast_CSHARP and contrast changed with the original/unmodified image in C#. See Contrast for more information. Sample for comparing an image that had the brightness Contrast_VB and contrast changed with the original/unmodified image in Visual Basic. See Contrast for more information. Sample for demonstrating a simple conversion in C#. Conversion_CSHARP See Conversion for more information. Sample for demonstrating a simple conversion in Visual Conversion_VB Basic. See Conversion for more information. Sample for showing how to get the DDB display effect ddbeffect_CSHARP from an image in C#. See DDB Effect for more infor- mation. Sample for showing how to get the DDB display effect ddbeffect_VB from an image in Visual Basic. See DDB Effect for more information. Sample demonstrating how to use the Snowbound.Net Encrypt_csharp library in C# to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to use the Snowbound.Net Encrypt_VB library in Visual Basic to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to read an image file into memory and use the Snowbound .NET library in C# to FileMem_CSHARP decompress the image from memory. See FileMem for more information.

41 Chapter 2 - Quick Start

Sample Description Sample showing how to apply the image processing oper- ImageProcessing_CSHARP ator in C#. See Image Processing for more information. Sample showing how to apply the image processing oper- ImageProcessing_VB ator in Visual Basic. See Image Processing for more information. Sample demonstrating how to use the Snowbound .NET memcopy_csharp library in C# for saving and reading the image from mem- ory. See Memory Copy for more information. Sample demonstrating how to use the Snowbound .NET Memcopy_VB library in Visual Basic for saving and reading the image from memory. See Memory Copy for more information. Sample demonstrating how to merge two images. See mergeimage_CSHARP Merge Image for more information. Sample for displaying any page and using anti-aliasing if page_csharp desired in C#. See Page for more information. Sample for displaying any page and using anti-aliasing if Page_VB desired in Visual Basic. See Page for more information. Sample demonstrating panning in C#. See Panning for panning_csharp more information. Sample demonstrating panning in Visual Basic. See Pan- panning_VB ning for more information. Sample demonstrating printing and previewing in C# Print_CSHARP using the Snowbound product. See Print for more infor- mation. Sample demonstrating printing and previewing in Visual Print_VB Basic using the Snowbound product. See Print for more information. Sample demonstrating how to use the Snowbound .NET Scan_CSHARP library in C# for scanning functions. See Scan for more information. Sample demonstrating how to use the Snowbound .NET Scan_VB library in Visual Basic for scanning functions. See Scan for more information. Sample demonstrating how to split multiple pages in C#. SimpleMultiPages_CSHARP See Split to Multiple Pages for more information. Sample demonstrating how to split multiple pages in Vis- SimpleMultiPages_VB ual Basic. See Split to Multiple Pages for more infor- mation. Sample showing how to search text in the image in C#. textsearch_CSHARP See Text Search for more information. Sample showing how to search text in the image in Vis- textsearch_VB ual Basic. See Text Search for more information. Sample demonstrating how to use the Snowbound .NET TIFFTag_CSHARP library in C# for reading .tif tags. See Tiff Tag for more information.

42 Chapter 2 - Quick Start

Sample Description Sample demonstrating how to use the Snowbound .NET TIFFTag_VB library in Visual Basic for reading .tif tags. See Tiff Tag for more information.

Reading and Displaying Images

The following section describes how to read and display images and remove images from mem- ory.

Reading Images

To read an image, use the function below.

Syntax int SNBDAPI CIMG_decompress_bitmap(String *filename);

The input filename is a standard string pointing to an image file name. The RasterMaster .NET Imaging SDK always detects the format of an image (i.e. .TIF, .PCX, .GIF). The return value is an error code that determines if the .NET Snowbound object contains a valid image.

You may call this function as many times as desired.

See CIMG_decompress_bitmap() for more information on reading an image.

Displaying an Image

To display an image, use the function below.

Syntax int SNBDAPI CIMG_display_bitmap(Graphics *g, int x, int y, int width, int height);

This function displays the image referenced by the calling object at the x, y, width and height coordinates in pixels.

See CIMG_display_bitmap_aspect() for more information on automatic aspect ratio correction.

See bool repaintBackground() for more information on displaying an image.

Return Values and Error Codes

Snowbound file handles start with zero (0). The handle is simply an integer value to reference the image.

All negative values are errors. See Appendix H - Error Codes for a list of error codes and error descriptions.

43 Chapter 2 - Quick Start

System Overview

RasterMaster .NET Imaging SDK includes the technical specifications described below.

Determining System Requirements

System requirements to run the RasterMaster .NET Imaging SDK include:

l Supported Operating Systems - Any .NET Environment including the following:

l Vista

l Microsoft Windows XP

l Microsoft Windows XP/64*

l Microsoft Windows Server 2003

l Microsoft Windows 2008

l Microsoft Windows 7

Supported Platforms:

l Intel x86

l AMD

l AMD x64

Development Environments:

l Microsoft Visual Studio .NET

l SDKs supporting .NET

Minimum memory requirements are related to image size and necessary buffers. Buffers may require multiple megabytes if images are large. For more information, please see Determining Memory Requirements.

.NET Framework 4.0 Support

l RasterMaster .NET is compatible with .NET Framework 2.0 and above, including .NET Framework 4.0. If you build with Visual Studio 2010 and select the target platform as .NET Framework 4.0, then you must either:

44 Chapter 2 - Quick Start

l Set the project’s app.config file to support the previous version of .NET by setting the useLegacyV2RuntimeActivationPolicy parameter to true as shown in the following example:

useLegacyV2RuntimeActivationPolicy="true"

l Request a special Visual Studio 2010 .NET Framework 4.0 RasterMaster .NET build from Snowbound Software. You may do this by entering a support ticket at www.support.snowbound.com. Once you have the .NET 4.0 compatible Ras- terMaster library, you may reference it from your project. You do not have to set the useLegacyV2RuntimeActivationPolicy parameter to true.

Note: Please be careful about distinguishing the .NET 2.0 and .NET 4.0 RasterMaster libraries. Since the libraries have the same file names, please keep them in separate directories or rename the one you are not using..

Determining Memory Requirements

Generally, higher quality documents require more memory to process. Snowbound Software does not have a one-size-fits-all recommendation for memory because our customers have such a variety of documents and different tolerances for the level of output quality. However, you can try doubling the memory available to see if that resolves the issue. Keep increasing memory until you stop getting out of memory errors. If you hit a physical or financial limit on memory, then you can do the following:

l Decrease the quality of the images requested by decreasing bits per pixel, the res- olution, or the size.

l Decrease the number of documents you have open at any one time.

To calculate the amount of memory required for an image, you will need to know the size of the image in pixels and the number of bits per pixel in the image (black and white=1, grayscale=8, color=24). If you do not know the height or width in pixels, but you do know the size in inches and the dpi (dots per inch) of the image, then you can calculate the size in pixels as (width_in_ inches*dots_per_inch) = width_in_pixels.

To calculate the amount of memory (in bytes), multiply the height, width and number of bits per pixel. Then, divide by 8 to convert from bits to bytes. See the following example:

(height_in_pixels * width_in_pixels * bits_per_pixel)/ 8 = image_size_in_bytes

Table 2.2: Memory Requirements Based on Image Size

Image Size Required Memory 24-bit per pixel, 640 x 480 image 640 * 480 * (24 / 8) = 921600 bytes 1-bit per pixel, 8.5" x 11" image, at 300 dpi (2550 pixels 2550 * 3300 * (1 / 8) = 1051875 bytes by 3300 pixels)

45 Chapter 2 - Quick Start

Image Size Required Memory 24-bit per pixel, 8.5" x 11" image, at 300 dpi (2550 pixels 2550 * 3300 * (24 / 8) = 25245000 by 3300 pixels) bytes (25 megabytes)

46 Chapter 3 - Saving and Reading Multi-page Images

Chapter 3 - Saving and Reading Multi-page Images

This chapter describes how to decompress, determine page counts, save, and convert multi- page images in the RasterMaster .NET Imaging SDK.

Multi-page Images

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

Supported Multi-page Formats

The RasterMaster .NET Imaging SDK 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.

47 Chapter 3 - Saving and Reading Multi-page Images

Multi-page Format Functions

Table 3.1: Supported Multi-page Functions

Properties Description Detects the number of pages in a file. See CIM- CIMGLOW_get_pages() GLOW_get_pages() for more information. Reads pages. Specify the specific page to import. See CIMG_decompress_ CIMG_decompress_bitmap_page() 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 auto- matically appended to any file with the same name.

See CIMG_save_bitmap() for more informa-tion on these functions.

48 Chapter 4 - Printing Images

Chapter 4 - Printing Images

This chapter describes how to print images using the RasterMaster .NET Imaging SDK.

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 proc- essing 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.

49 Chapter 4 - 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 - Error Codes.

Syntax

int SNBDAPI CIMG_print_bitmap(Graphics *g, int x, int y, int width, int height);

Remark

Table 4.1: CIMG_print_bitmap Function Variables

Variable Description g Graphics object x Starting X coordinate for display of image y Starting Y coordinate for display of image width Horizontal width to display image height 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 - 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.

50 Chapter 4 - 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 - Error Codes for more information.

Syntax int SNBDAPI CIMG_print_bitmap_fast(Graphics *g, int x, int y, int width, int height);

Remark

Table 4.2: CIMG_print_bitmap_fast Function Variables

Variable Description g Graphics object x Starting X coordinate for display of image y Starting Y coordinate for display of image width Horizontal width to display image height 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 - Error Codes for a list of error codes.

51 Chapter 5 - Aspect Ratio Correction Function

Chapter 5 - Aspect Ratio Correction Func- tion

This chapter describes the function used for aspect ratio correction within the RasterMaster .NET Imaging SDK.

Aspect Ratio Correction Function

Table 5.1: Aspect Ratio Function Description

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

52 Chapter 6 - Display Quality

Chapter 6 - Display Quality

This chapter describes how to achieve the best display quality for an image using the Ras- terMaster .NET Imaging SDK.

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 dis- playing 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 pre- serve 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

53 Chapter 6 - Display Quality

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.

54 Chapter 7 - Image Compression

Chapter 7 - Image Compression

This chapter describes how to select the best compression for an image using the Ras- terMaster .NET Imaging SDK.

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

In the RasterMaster product line, the JPEG format works best for 24-bit color images.

8-Bit Gray Scale Images

In the RasterMaster product line, the JPEG format works best for 8-bit gray scale images.

1-bit Bi-Level Images

In the RasterMaster product line, the TIFF G4 format works best on 1-bit bi-level images. The JBIG format works about twenty percent better than the TIFF G4 format, but it can be much slower.

55 Chapter 8 - File Format Conversion

Chapter 8 - File Format Conversion

This chapter describes how to convert an image to a different file format.

Converting File Formats

The RasterMaster products support 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 for- mat is decompressed or imported and can be saved out to any supported format. See Appendix B for a complete list of supported file formats.

In general, RasterMaster handles details like file format, bit-depth, bit ordering and compression formats automatically. You will need only a few RasterMaster 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 products automatically detect the file format regardless of the file extension. File extensions are not mandatory.

RasterMaster 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 Ras- terMaster, however, the library automatically determines the bits per pixel for the destination for- mat and promotes accordingly.

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);

You can read in almost any type of image or document using the CIMGLOW_set_document_ input(int, int, int) method. RasterMaster 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 will still identify the format correctly.

56 Chapter 8 - 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 doc- uments 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 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 uses auto- matically vary by input format. For more inforation on file formats, please see Appendix B, Sup- ported File Formats.

You can tell RasterMaster to read in color documents as black and white to increase per- formance. You do this by calling CIMGLOW_set_document_input(int, int, int) with a bit-depth of 1. You can tell RasterMaster to read in black and white documents as color. However, that 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 the 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 Formats to compare the bit-depths supported by your input and output file formats. The goal is to find a bit-depth that the file for- mats 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 for- mat. If you are going from a black and white or grayscale to a color document that is color pro- motion because the bit-depth is going from low to high. Please see the Chapter 30, Color Promotion Functions for information on RasterMaster 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 Ras- terMaster 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:

57 Chapter 8 - 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 doc- ument 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_doc- ument_input(int, int, int).

If the input is grainy, then you may need to do some image enhancement techniques. Contact Snowbound Support at www.support.snowbound.com for help.

Color Reduction - Going from a Color Document to Black and White or Grayscale

RasterMaster 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 dif- ferent color promotion or color reduction methods to fine tune your results. Please see the Chap- ter 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 www.su- pport.snowbound.com.

Conversion Takes Too Long or Output Is Too Large

If you have selected high quality output y 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 proc- ess 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.

58 Chapter 9 - Class Snow.Snowbnd Methods

Chapter 9 - Class Snow.Snowbnd Methods

This chapter describes the available methods for the Snow.Snowbnd class. The chapter con- tains the following topics:

Snowbnd()

Snowbnd(int, int, int)

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 Contrast

l Conversion

l Convert_Doc

l DDB Effect

l DocClean

l Encryption

59 Chapter 9 - Class Snow.Snowbnd Methods

l FileMem

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

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);

Remark

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

Variable Description width Width of blank bitmap to create.

60 Chapter 9 - Class Snow.Snowbnd Methods

Variable Description height Height of bitmap to create. bitsperpixel Pixel depth of bitmap to create. Can be set to 1, 8, or 24.

61 Chapter 10 - SDK Class Specific Methods

Chapter 10 - SDK Class Specific Methods

This chapter describes the SDK class specific functions for the RasterMaster .NET Imaging SDK. The chapter contains the following topics: isValidImage() clearImage()

ToErrorMessage() 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);

62 Chapter 10 - 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 10.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 - Error Codes for a list of error codes.

63 Chapter 11 - SnowPanel Class Specific Methods

Chapter 11 - SnowPanel Class Specific Methods

This chapter describes the SnowPanel class specific methods. The chapter contains the fol- lowing topics:

Properties

CustomPaint()

OnPaint()

OnPaintBackground()

OnSizeChanged()

Properties

This section lists the properties used in the SnowPanel class specific methods:

Table 11.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 Type an ASPECT_ZOOM. DoubleBuffered Sets the double buffer display on or off

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 11.2: CustomPaint Variable

Variable Description g Graphics object

64 Chapter 11 - SnowPanel Class Specific Methods

Returns

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

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 11.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 Snow- bound error code. See Appendix H - 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 11.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 Snow- bound error code. See Appendix H - Error Codes for a list of error codes.

65 Chapter 11 - SnowPanel Class Specific Methods

OnSizeChanged()

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

Syntax protected virtual void OnSizeChanged(EventArgs *e);

Remark

Table 11.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 Snow- bound error code. See Appendix H - Error Codes for a list of error codes.

66 Chapter 12 - Scanning Functions

Chapter 12 - Scanning Functions

This chapter describes the scanning functions and parameters. This chapter contains the fol- lowing topics:

Scanning Constants

CIMG_scan_acquire()

CIMG_scan_acquire_feeder()

CIMG_scan_acquire_feeder_fast()

CIMG_scan_feeder_close()

CIMG_scan_get_cap()

CIMG_scan_open_source()

CIMG_scan_pages()

CIMG_scan_pages_fast()

CIMG_scan_set_cap()

CIMG_scan_set_caps()

CIMG_scan_setup()

Scanning Constants

Shown below is the structure for setting scanning parameters.

Syntax

Example 12.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 12.1: CSCAN_CAPS Variables

67 Chapter 12 - Scanning Functions

Variable Description 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

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.

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 12.2: CIMG_scan_acquire Function Variable

Variable Description win_control Window form control object 0 = Do not display TWAIN dialog box iShowUI 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 - 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.

68 Chapter 12 - Scanning Functions

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 iSho- wUI);

Remark

Table 12.3: CIMG_scan_acquire_feeder Function Variables

Variable Description win_control Window form control object 0 = Do not display TWAIN dialog box iShowUI 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 - 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 12.4: CIMG_scan_acquire_feeder_fast Function Variables

Variable Description win_control Window form control object iShowUI 0 = Do not display TWAIN dialog box

69 Chapter 12 - Scanning Functions

Variable Description 1 = Display TWAIN dialog box iDuplex 1 = set duplex scanning mode

Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H - 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.

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 - 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 12.5: CIMG_scan_get_cap Function Variables

Variable Description win_control Window form control object cap TWAIN scanner capability to retrieve

70 Chapter 12 - Scanning Functions

Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H - 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.

Syntax int SNBDAPI CIMG_scan_open_source(Control *win_control);

Remark

Table 12.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 - 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 file- name. 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.

71 Chapter 12 - Scanning Functions

Syntax

int SNBDAPI CIMG_scan_pages(Control *win_control, String strFile- Name, int iFileType, int iShowUI);

Remark

Table 12.7: CIMG_scan_pages Function Variables

Variable Description win_control Window form control object strFileName Output file name to create as a scanned image See Appendix B for file type formats in which to save com- iFileType pressed images 0 = Do not display TWAIN dialog box iShowUI 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 - 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 spec- ified 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 file- name 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);

72 Chapter 12 - Scanning Functions

Remark

Table 12-8 lists the CIMG_scan_pages_fast function variable descriptions.

Table 12.8: CIMG_scan_page_fast Function Variables

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

Returns

Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H - 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 12.9: CIMG_scan_set_cap Function Variables

Variable Description win_control Window form control object cap Current TWAIN capability to set value 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 - Error Codes for a list of error codes.

73 Chapter 12 - Scanning Functions

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 12.10: CIMG_scan_set_caps Function Variable

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 - 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 scan- ning 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 12.11: CIMG_scan_setup Function Variable

Variable Description win_control Window form control object

74 Chapter 12 - Scanning Functions

Returns

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

75 Chapter 13 - Scrollbar Default Functions

Chapter 13 - Scrollbar Default Functions

This chapter describes the RasterMaster .NET Imaging SDK scrollbar default functions. This chapter contains the following topics:

Properties

SnowbndCNet_HScrollBar()

SnowbndCNet_VScrollBar()

Properties

This section lists the properties used in the scrollbar default functions:

Table 13.1: Scrollbar Default Function Properties

Property Description Hsb Gets and sets the horizontal scrollbar Vsb Gets and sets the vertical scrollbar Status Gets the GENERAL_STATUS error codes StatusDetails 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 13.2: SnowbndCNet _HScrollBar Variables

Variable Description sender Standard .NET object ScrollEventArgs Standard .NET object

Returns

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

76 Chapter 13 - Scrollbar Default Functions

SnowbndCNet_VScrollBar()

This function controls how an image is scrolled.

Syntax

virtual void SnowbndCNet_VScrollBar(Object *sender, ScrollEventArgs *se);

Remark

Table 13.3: SnowbndCNet _VScrollBar Variables

Variable Description sender Standard .NET object ScrollEventArgs Standard .NET object

Returns

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

77 Chapter 14 - Image Decompression Functions

Chapter 14 - Image Decompression Func- tions

This chapter describes the RasterMaster .NET Imaging SDK image decompression functions. This chapter contains the following topics:

CIMG_decompress_bitmap()

CIMG_decompress_bitmap_display()

CIMG_decompress_bitmap_fd()

CIMG_decompress_bitmap_FlexSnap()

CIMG_decompress_bitmap_mem()

CIMG_decompress_bitmap_page()

CIMG_decompress_bitmap_url()

CIMG_decompress_bitmap_xps()

CIMG_decompress_fax()

CIMG_decompress_fax_mem()

CIMG_decompress_tiled_bitmap()

CIMG_decompress_bitmap()

This is the main function for loading a compressed or uncompressed image from disk. It con- verts the data to a Windows DIB format in memory.

This function is used to read in any supported format including MO:DCA, AFP, PCL, PDF, RTF, or Word. See Appendix B 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 doc- ument 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

78 Chapter 14 - Image Decompression Functions

l ASP Conversion

l ASP Image View

l ASP Memory Copy

l ASP Multiple Pages

l Contrast

l Conversion

l Convert_Doc

l DocClean

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

Syntax

int SNBDAPI CIMG_decompress_bitmap(String *filename);

79 Chapter 14 - Image Decompression Functions

Remark

Table 14.1: : CIMG_decompress_bitmap Function Variable

Variable Description filename File or path/filename of the image to load

Returns

Returns the status of the decompress bitmap operation. Any value less than zero is a Snow- bound error code. See Appendix I 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 infor- mation.

Syntax int SNBDAPI CIMG_decompress_bitmap_display(String *filename, Graph- ics* g, int xpos, int ypos, int width, int height, int aspect);

Remark

Table 14.2: CIMG_decompress_bitmap_display Function Variables

Variable Description filename File or path/filename of the image to load. g Graphics object. xpos Starting X coordinate for display of image. ypos Starting Y coordinate for display of image. width Width for display of image. height 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 aspect retained. This may make the height or width smaller than expected but never larger.

80 Chapter 14 - Image Decompression Functions

Returns

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

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 14.3: CIMG_decompress_bitmap_fd Function Variables

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

Returns

Returns the status of the decompress file handle operation. Any value less than zero is a Snow- bound error code. See Appendix H - 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 14.4: CIMG_decompress_bitmap_FlexSnap Function Variables

81 Chapter 14 - Image Decompression Functions

Variable Description strServer Server URL address strFileName The image file name to decompress page The desired page number starting at zero

Returns

Returns the status of the decompress bitmap FlexSnap operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 func- tion.

Syntax int SNBDAPI CIMG_decompress_bitmap_mem(Array *data, int page);

Remark

Table 14.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 page image files

Returns

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

82 Chapter 14 - Image Decompression Functions

CIMG_decompress_bitmap_page()

The function loads a compressed or uncompressed specific page of image file from disk. It con- verts 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 DocClean

l Page

l Scan

l Split to Multiple Pages

l Text Search

l Thumbnail

Syntax

int SNBDAPI CIMG_decompress_bitmap_page(String *filename, int page);

Remark

Table 14.6: CIMG_decompress_bitmap_page Function Variables

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

Returns

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

CIMG_decompress_bitmap_url()

The function decompresses an image from a Uniform Resource Locator (URL) address.

83 Chapter 14 - Image Decompression 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_decompress_bitmap_url(String *strURL, int page);

Remark

Table 14.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 multi- page page image files.

Example 14.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 - Error Codes for a list of error codes.

CIMG_decompress_bitmap_xps()

The function decompresses an XPS file.

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 14.8: CIMG_decompress_bitmap_xps Function Variables

84 Chapter 14 - Image Decompression Functions

Variable Description filename Path/filename of the XPS file iPage 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 - 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 14.9: CIMG_decompress_fax Function Variables

Variable Description filestream Handle returned from a Windows OpenFile() call xsize Horizontal width of the image after decompression ysize Vertical height of the image after decompression type 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 fill_order 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 - 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.

85 Chapter 14 - Image Decompression Functions

Syntax int SNBDAPI CIMG_decompress_fax_mem(Array *data, int xsize, int ysize, int type, int fill_order);

Remark

Table 14.10: CIMG_decompress_fax_mem Function Variables

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

Returns

Returns the status of the decompress fax memory operation. Any value less than zero is a Snowbound error code. See Appendix H - 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, unas- sembled file of tile images. Each tile is decompressed into a separate file.

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_decom- press_bitmap_fd() for more information.

Syntax int SNBDAPI CIMG_decompress_tiled_bitmap(String *filename, int page);

Remark

Table 14.11: CIMG_decompress_tiled_bitmap Function Variables

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

86 Chapter 14 - Image Decompression Functions

Returns

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

87 Chapter 15 - Image Decompression Option Functions

Chapter 15 - Image Decompression Option Functions

This chapter describes the RasterMaster .NET Imaging SDK image decompression option func- tions. This chapter contains the following topics:

CIMGLOW_set_auto_detect()

CIMGLOW_set_decomp_rect()

CIMGLOW_set_decomp_reduction()

CIMGLOW_set_decompsize()

CIMGLOW_set_jpeg_decompression

CIMGLOW_set_overlay_path()

CIMGLOW_set_pdf_input()

CIMGLOW_set_pdf_password()

CIMGLOW_unset_auto_detect()

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 15.1: CIMGLOW_set_auto_detect Function Variable

Variable Description format Image format type from the defined list in imglib.h

88 Chapter 15 - Image Decompression Option Functions

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 - Error Codes for a list of error codes.s.

** GLOBAL FUNCTION**

CIMGLOW_set_decomp_rect()

This global function decompresses and holds in memory only the data contained in the spec- ified 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.

Syntax

int SNBDAPI CIMGLOW_set_decomp_rect(int x, int y, int width, int height);

Remark

Table 15.2: CIMGLOW_set_decomp_rect Function Variables

Variable Description x Start of x cropping rectangle y Start of y cropping rectangle width Width of cropping rectangle height Height of cropping rectangle

Returns

Returns the status of the set decompressed rectangle operation. A value of 0 indicates suc- cess. Any value less than zero is a Snowbound error code. See Appendix H - 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);

89 Chapter 15 - Image Decompression Option Functions

Remark

Table 15.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 suc- cess. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

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 15.4: CIMGLOW_set_decompsize Function Variables

Variable Description width Width to decompress image height 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 - 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 decom- pression. These values will also be de-quantized. They will replace the internal RGB data nor- mally returned from decompressing a JPEG image.

90 Chapter 15 - Image Decompression Option Functions

The components will be in the same order as the uncompressed image, except they will be 32- bit integer values for each plane.

Syntax

int SNBDAPI CIMGLOW_set_jpeg_decompression(int mode);

Remark

Table 15.5: CIMGLOW_set_jpeg_decompression Function Variable

Variable Description 0 = normal JPEG decompression mode 1 = returns the array of 8x8 blocks of frequency com- ponents

Returns

Returns the status of the JPEG decompression. Any value less than zero is a Snowbound error code. See Appendix H - 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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

91 Chapter 15 - Image Decompression Option Functions

CIMGLOW_set_pdf_input()

This global function converts PDF files into a raster image when being decompressed into Ras- terMaster products. 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);

Remark

Table 15.6: CIMGLOW_set_pdf_input Function Variables

Variable Description Controls the width and height of the file. Set to 200 or 300 dpi for black and white images. Set to 100 or 200 for color images. Allows importing color or black and white images. bitsperpixel 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 - 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 15.7: CIMGLOW_set_pdf_password Function Variables

92 Chapter 15 - Image Decompression Option Functions

Variable Description String represented password to use to open a password filename protecting PDF file.

Returns

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

** GLOBAL FUNCTION**

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 15.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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

93 Chapter 16 - Image Creation Functions

Chapter 16 - Image Creation Functions

This chapter describes the RasterMaster .NET Imaging SDK image creation functions. This chapter contains the following topic:

CIMG_create_bitmap_class()

CIMG_create_handle()

CIMG_create_handle_ddb()

CIMG_create_handle_keep()

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 16.1: CIMG_create_bitmap_class Function Variable

Variable Description width Width of the bitmap object height 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 - 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 bit- sperpixel);

Remark

Table 16.2: CIMG_create_handle Function Variable

94 Chapter 16 - Image Creation Functions

Variable Description width Width of the handle height Height of the handle bitsperpixel Pixel depth of bitmap to create

Returns

Returns the status of the create handle operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 16.3: CIMG_create_handle_ddb Function Variables

Variable Description g Graphics object Bitmap GDI + Bitmap object hpal Windows palette for the bitmap image

Returns

Returns the graphics object. Any value less than zero is a Snowbound error code. See Appen- dix H - 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.

95 Chapter 16 - Image Creation Functions

Syntax int SNBDAPI CIMG_create_handle_keep(CDIB_HEADER *dib_header);

Remark

Table 16.4: CIMG_create_handle_keep Function Variable

Variable Description Pointer to a CDIB_HEADER structure that contains the dib_header 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 Snow- bound error code. See Appendix H - Error Codes for a list of error codes.

96 Chapter 17 - HTML Functions

Chapter 17 - HTML Functions

This chapter describes the HTML functions for the RasterMaster .NET Imaging SDK. This chapter contains the following topics:

CIMGLOW_set_html_capabilities()

CIMGLOW_set_html_home_dir()

CIMGLOW_set_html_image_capability()

CIMGLOW_set_html_input()

CIMGLOW_set_html_javascript_capability()

CIMGLOW_set_html_page_size()

CIMGLOW_set_html_page_size_ratio()

CIMGLOW_set_html_page_size_ratio_capability()

CIMGLOW_set_html_screen_dpi()

CIMGLOW_set_html_use_page_breaks_exclusively()

CIMGLOW_set_html_utf_bom()

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,

97 Chapter 17 - HTML Functions

Double dRatio);

Remarks

Table 17.1: CIMGLOW_set_html_capabilities Function Variables

Variable Description Set the value to 0 to disable. Set the value to 1 to enable. isImageEnabled The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. isJavascriptEnabled The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. isRatioEnabled The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. isPageBreaksExclusive The default value is 1. Sets the width/height ratio. The default value is 8.5/11.0. (i.e. US LETTER portrait-mode). dRatio 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 - 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 17.2: CIMGLOW_set_html_home_dir function variable descriptions.

Variable Description This value does not support double-byte characters dir (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 - Error Codes for a list of error codes.

98 Chapter 17 - 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 17.3: CIMGLOW_set_html_image_capability function variable descriptions.

Variable Description Set the value to 0 to disable. Set the value to 1 to ena- isEnabled ble. 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 - Error Codes for a list of error codes.

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 17.4: CIMGLOW_set_html_input function variable descriptions.

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

99 Chapter 17 - HTML Functions

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 - 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 ren- derer engine does not support all Microsoft Internet Explorer-only functions.

Syntax

int SNBDAPI CIMGLOW_set_html_javascript_capability(int isEnabled);

Remarks

Table 17.5: CIMGLOW_set_html_javascript_capability function variable descrip- tions.

Variable Description Set the value to 0 to disable. Set the value to 1 to enable. isEnabled 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 - 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 sug- gestion and will probably be over-written to more appropriate values during program execution.

Syntax

int SNBDAPI CIMGLOW_set_html_page_size(int w, int h);

Remarks

Table 17.6: CIMGLOW_set_html_page_size function variable descriptions .

100 Chapter 17 - HTML Functions

Variable Description Sets the width. The default value is 0. w Note: Setting the width to anything but zero will force the user-defined screen DPI to be ignored. h Sets the height. The default vaule is 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 - 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 doc- ument.

Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio(int ratio);

Remarks

Table 17.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 capabil- ity 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 - 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 doc- ument by forcing a page size ratio capability in the HTMLdocument.

Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio_capability(int isEn- abled);

101 Chapter 17 - HTML Functions

Remarks

Table 17.8: CIMGLOW_set_html_page_size_ratio_capability function variable descriptions .

Variable Description Set the value to 0 to disable. Set the value to 1 to enable. isEnabled 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 - 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 17.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 any- thing 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 - Error Codes for a list of error codes.

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 isEn- abled);

102 Chapter 17 - HTML Functions

Remarks

Table 17.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 - 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 Ras- termaster.

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 char- acter 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 envi- ronment.

Syntax int SNBDAPI CIMGLOW_set_html_utf_bom(int utf_bom);

Remarks

Table 17.11: CIMGLOW_set_html_utf_bom Function Variables

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

103 Chapter 17 - 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 17.12: Representations of byte order marks by encoding

Representation Representation Representation Encoding (hexadecimal) (decimal) (ISO-8859-1) UTF_8 EF BB BF 1 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 ??þÿ (? is the ascii null character) UTF_32LE FF FE 00 00 255 254 0 0 ÿþ?? (? is the ascii null character) 2B 2F 76, and one 43 47 117, and one of the +/v, and one of the following: 8 9 UTF_72 of the following: following: + / [ 38 | 39 | 2B | 2F ] [56 | 57 | 43 | 47 ] UTF_1 F7 64 4C 247 100 76 ÷dL UTF_ DD 73 66 73 221 115 102 115 Ýsfs EBCDIC ?þÿ (? is the ascii "shift out" char- SCSU 0E FE FF3 14 254 255 acter)

104 Chapter 17 - HTML Functions

Representation Representation Representation Encoding (hexadecimal) (decimal) (ISO-8859-1) FB EE 28 optionally 251 238 40 optionally fol- BOCU_1 ûî( optionally followed by ÿ followed by FF4 lowed by 255 □1■3 (□ and ■ are unmapped GB_17030 84 31 95 33 132 49 149 51 ISO-8859-1 characters)

1While 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.

2In 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 (non- BOM) 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.

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

4For 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 - Error Codes for a list of error codes.

105 Chapter 18 - Open Office 2007 XML (OOXML) Functions

Chapter 18 - Open Office 2007 XML (OOXML) Functions

This chapter describes the RasterMaster .NET Imaging SDK Office Open XML (OOXML) for- mat functions.

RasterMaster .NET Imaging SDK 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 Aspose.Words library has been installed and registered with Ras- terMaster. If the Aspose library is not found by RasterMaster, the system will return the error code DLL_NOT_LOADED (-24).

CIMGLOW_set_ooxml_license()

This function loads the OOXML license file.

Syntax int CIMGLOW_set_ooxml_license(String licenseFile);

Remark

Table 18.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 - Error Codes for a list of error codes.

106 Chapter 19 - Image Saving Functions

Chapter 19 - Image Saving Functions

This chapter describes the RasterMaster .NET Imaging SDK image saving functions. This chapter contains the following topics:

CIMG_save_bitmap()

CIMG_save_bitmap_fd()

CIMG_save_bitmap_mem()

CIMGLOW_write_tiff_stream()

CIMG_save_bitmap()

This function saves an image to disk in any format desired.

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 for details on what bit-depths are available for each for- mat.

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 Conversion

l Convert_Doc

l Encryption

l Merge Image

l Scan

l Split to Multiple Pages

Note: If the type is -1, the library looks at the file extension for determining the output file type.

107 Chapter 19 - Image Saving Functions

Syntax

int SNBDAPI CIMG_save_bitmap(String *filename, int format);

Remark

Table 19.1: CIMG_save_bitmap Function Variables

Variable Description filename File or path/filename for output image See Appendix B for all image types allowed and all files format shipped with the product

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 - 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 for- mat);

Remark

Table 19.2: CIMG_save_bitmap_fd Function Variables

Variable Description filestream Windows file handle obtained from OpenFile or _lopen format See Appendix B for all image types allowed

108 Chapter 19 - Image Saving Functions

Returns

Returns the status of the save bitmap file handle operation. Any value less than zero is a Snow- bound error code. See Appendix H - 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 19.3: CIMG_save_bitmap_mem Function Variables

Variable Description data Windows memory pointer already allocated format See Appendix B for all image types allowed

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.

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.

109 Chapter 19 - Image Saving Functions

Syntax

int SNBDAPI CIMGLOW_write_tiff_stream(CDIB_HEADER *dib_header, Array *arrData, int data_size, int file_type, String *strFileName);

Remark

Table 19.4: CIMGLOW_write_tiff_stream Function Variables

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

Returns

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

110 Chapter 20 - Image Saving Option Functions

Chapter 20 - Image Saving Option Func- tions

This chapter describes the RasterMaster .NET Imaging SDK image saving option functions. This chapter contains the following topics:

CIMG_set_encrypt()

CIMGLOW_set_comp_quality()

CIMGLOW_set_image_orientation()

CIMGLOW_set_jpeg2000_comp_ratio()

CIMGLOW_set_jpg_interleave()

CIMGLOW_set_pdf_output()

CIMGLOW_set_tiff_save_strips

CIMGLOW_set_tiff_tag()

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 20.1: CIMG_set_encrypt Function Variables

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

111 Chapter 20 - Image Saving Option Functions

Returns

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

** GLOBAL FUNCTION**

CIMGLOW_set_comp_quality()

This global function sets the compression ratio to quality factor when saving JPEG images.

Syntax

int SNBDAPI CIMGLOW_set_comp_quality(int quality);

Remark

Table 20.2: CIMGLOW_set_comp_quality Function Variable

Variable Description Integer between 1 - 100 quality 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 - 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 20.3: CIMGLOW_set_image_orientation Function Variable

Variable Description orient Integer value between 0 and 8

112 Chapter 20 - Image Saving Option Functions

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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

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 20.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 Snow- bound error code. See Appendix H - 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);

113 Chapter 20 - Image Saving Option Functions

Remark

Table 20.5: CIMGLOW_set_jpg_interleave Function Variables

Variable Description h_int Horizontal interleaving factor v_int 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 - 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 20.6: CIMGLOW_set_pdf_output Function Variables

Variable Description double width Width of image in points double height 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 - 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 ’, when saving to TIFF file formats with the following compression types:

114 Chapter 20 - Image Saving Option Functions

l Uncompressed

l LZW

l Packbits

l Group 4

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 20.7: CIMGLOW_set_tiff_save_strips Function Variable

Variable Description 0 = Off on_off 1 = On

Returns

Returns the status of stripped TIFFs. Any value less than zero is a Snowbound error code. See Appendix H - 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 mul- tiple times for adding multiple tags.

Note: Setting the tagID to -1 clears out all extra tags from being written to files.

Syntax int SNBDAPI CIMGLOW_set_tiff_tag(CTIFF_TAG *tag);

Remark

Table 20.8: CIMGLOW_set_tiff_tag Function Variable

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

115 Chapter 20 - Image Saving Option Functions

Returns

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

** GLOBAL FUNCTION**

116 Chapter 21 - Image Display Functions

Chapter 21 - Image Display Functions

This chapter describes the RasterMaster .NET Imaging SDK image display functions. This chapter contains the following topics: bool repaintBackground()

CIMG_display_bitmap()

CIMG_display_bitmap_aspect()

CIMG_display_bitmap_transp()

CIMG_display_ddb()

CIMG_display_fit_to_height()

CIMG_display_fit_to_width()

CIMG_set_croprect()

CIMG_set_croprect_scroll()

CIMG_zoom_bitmap()

CIMG_zoom_bitmap_1_to_1()

CIMG_zoom_bitmap_rect()

CIMGLOW_map_image_to_wnd()

CIMGLOW_map_wnd_to_image() double calcAspectZoom() removeScrollbars() bool repaintBackground()

This function predetermines if the background needs to be repainted.

Syntax bool repaintBackground(double zoom, int type);

Remark

Table 21.1: bool repaintBackground Variables

Variable Description Zoom factor: double zoom 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default

117 Chapter 21 - Image Display Functions

Variable Description type 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 - 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_medi- ancut_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

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

118 Chapter 21 - Image Display Functions

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 21.2: CIMG_display_bitmap Function Variables

Variable Description g Graphics object x Starting X coordinate for display of image y Starting Y coordinate for display of image width Horizontal width to display image height Vertical height to display image

Returns

Returns the status of the display bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 ver- tically 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

119 Chapter 21 - Image Display Functions

Syntax

int SNBDAPI CIMG_display_bitmap_aspect(Control *panel, Graphics *g, CIMG_RECT *view, double zoom, int type);

Remark

Table 21.3: CIMG_display_bitmap_aspect Variables

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

Returns

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

CIMG_display_bitmap_transp()

This function displays transparent GIF images. It only draws the foreground color when dis- playing, not the background color.

This function compares each pixel to the background color passed in and does not draw fore- ground 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 21.4: CIMG_display_bitmap_transp Function Variables

Variable Description g Graphics object xpos Starting X coordinate for display of image ypos Starting Y coordinate for display of image width Horizontal width to display image height Vertical height to display image tcolor Background color of image to ignore

120 Chapter 21 - Image Display Functions

Returns

Returns the status of the display bitmap tranparent GIF 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()

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 21.5: CIMG_display_ddb Function Variables

Variable Description Bitmap GDI + Bitmap object g Graphics object xpos Starting X position to display image ypos 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 I for a list of error codes.

Example 21.1 CIMG_display_ddb

C#:Bitmap Bmp = simage.CIMG_create_bitmap_class(pic- Display.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.

121 Chapter 21 - 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 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 21.6: CIMG_display_fit_to_height Function Variables

Variable Description g Graphics object win_control Window form control object xs X starting position to display ys Y starting position to display width width to display height 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 - 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_con- trol, int xs, int ys, int width, int height);

Remark

Table 21.7: CIMG_display_fit_to_width Function Variables

122 Chapter 21 - Image Display Functions

Variable Description g Graphics object win_control Window form control object xs X starting position to display ys Y starting position to display width width to display height 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 I for a list of error codes.

CIMG_set_croprect()

This function sets the current crop rectangle. After decompression the default cropping rec- tangle is the entire size 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 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 21.8: CIMG_set_croprect Function Variables

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

Returns

Returns the current crop rectangle for the image handle. Any value less than zero is a Snow- bound error code. See Appendix H - 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.

123 Chapter 21 - Image Display Functions

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 21.9: CIMG_set_croprect_scroll Function Variables

Variable Description win_control Window form control object xpos Starting X coordinate for cropping rectangle ypos Starting Y coordinate for cropping rectangle scr_width Width of cropping rectangle scr_height Height of cropping rectangle 1 or True = aspect ratio on aspect 0 = aspect ratio off

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_zoom_bitmap()

This function is the standard library zoom function. A zoom value of 100 tells the function to dis- play 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 21.10: CIMG_zoom_bitmap Function Variables

Variable Description win_ctrl Window form control object. zoom_factor Amount to zoom.

124 Chapter 21 - Image Display Functions

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_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 21.11: CIMG_zoom_bitmap_1_to_1 Function Variables

Variable Description win_control Window form control object. zoom_level Amount to zoom. center_flag 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 - 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 proc- essed when repainting the image with CIMG_display_bitmap(). The scaled image coor- dinates 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 21-12 lists the CIMG_zoom_bitmap_rect() function variable descriptions.

Table 21.12: CIMG_zoom_bitmap_rect Function Variables

Variable Description win_control Window form control object pRTZoom CIMG_RECT structure, rectangle in image to zoom

125 Chapter 21 - Image Display Functions

Variable Description Using image or screen coordinates mode 0 = Screen Coordinates 1 = Image Coordinates

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.

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);

Remark

Table 21.13: CIMGLOW_map_image_to_wnd Function Variables

Variable Description win_control Window form control object px Pointer to an integer of an X coordinate to convert py 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 - 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);

126 Chapter 21 - Image Display Functions

Remark

Table 21.14: CIMGLOW_map_wnd_to_image Function Variables

Variable Description win_control Window form control object px Pointer to an integer of an X coordinate to convert py 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 - 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 prop- erties.

Syntax double calcAspectZoom(CIMG_RECT *view, double zoom, int type);

Remark

Table 21.15: double calcAspectZoom Variables

Variable Description view The display area of interest Zoom factor: double zoom 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 type zoom value as an ASPECT_ZOOM.

Example 21.2 double calcAspectZoom

snowPanel1.Type = ZOOM_TYPE.ASPECT_DEFAULT; snowPanel1.Zoom = 0; CIMG_display_bitmap_aspect(?,?,?,?,?,snowPanel1.Zoom,snow- Panel1.Type);

EQUALS:

CIMG_RECT view = new CIMG_RECT(snowPanel1.Left,snowPanel1.Top,snowPanel1.Right,

127 Chapter 21 - Image Display Functions

snowPanel1. Bottom); double aspectzoom = snowPanel1.calcAspectZoom(view,snowPanel1.Zoom,snow- Panel1.Type); CIMG_display_bitmap_aspect(?,?,?,?,?,aspectzoom,ZOOM_TYPE.A- SPECT_ZOOM)

Returns

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

removeScrollbars()

This function removes scrollbars from the given control.

Syntax

int SNBDAPI RemoveScrollbars(Control *panel);

Remark

Table 21.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 - Error Codes for a list of error codes.

128 Chapter 22 - Image Display Option Functions

Chapter 22 - Image Display Option Func- tions

This chapter describes the RasterMaster .NET Imaging SDK image display option functions. This chapter contains the following topics:

CIMG_animate()

CIMG_bitmap_palette()

CIMG_display_ddb_effect()

CIMG_set_gamma()

CIMG_set_lut()

CIMG_window_level()

CIMGLOW_autocolor()

CIMGLOW_set_alias()

CIMGLOW_set_alias_quality()

CIMGLOW_set_dithermode()

CIMGLOW_set_imnet_page_size()

CIMGLOW_set_rop()

CIMGLOW_set_transp_color()

CIMGLOW_set_wipedelay()

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);

129 Chapter 22 - Image Display Option Functions

Remark

Table 22.1: CIMG_animate Function Variables

Variable Description g Graphics object bm_name Animated GIF filename to use xs Starting x position to draw ys Starting y position to draw xsize X size of image drawing rectangle ysize 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 - 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.

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 22.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.

130 Chapter 22 - Image Display Option 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 DDB Effect sample.

Syntax int SNBDAPI CIMG_display_ddb_effect(Graphics *g, int xpos, int ypos, int width, int height, int effect);

Remark

Table 22.3: CIMG_display_ddb_effect Function Variables

Variable Description g Graphics object xpos Starting X coordinate for display of image ypos Starting Y coordinate for display of image width Width of desired image to display height Height of desired image to display Display the following effect:

1 - (Default) Displays image with no image effects

2 - Displays image from the bottom to the top of the Win- 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 effect 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

131 Chapter 22 - Image Display Option Functions

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_set_gamma()

This function corrects for the gamma or response curve of the monitor. The default is 150. This drastically improves the quality of gray scale or 24-bit images.

Syntax

int SNBDAPI CIMG_set_gamma(int gamma);

Remark

Table 22.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 - Error Codes for a list of 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 22.5: CIMG_set_lut Function Variables

Variable Description contrast Integer value from -127 to 127 brightness Integer value from -127 to 127

132 Chapter 22 - Image Display Option Functions

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 - 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. The window-leveling function improves the con- trast to allow more details to be present in the image at display time.

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);

Remark

Table 22.6: CIMG_window_level Function Variables

Variable Description min_gray_value Starting pixel gray value max_gray_value Ending pixel gray value Turn Windows leveling on or off on_off 0 = Off 1 = On

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 - 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.

133 Chapter 22 - Image Display Option Functions

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 22.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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

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 22.8: CIMGLOW_set_alias_img Function Variable

Variable Description Sets the aliasing factor. Choose from: 0 = No aliasing alias 1 = Use the preserve black algorithm 2 = Use the scale to gray algorithm

134 Chapter 22 - Image Display Option Functions

Variable Description 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 - 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 func- tion 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);

Remark

Table 22.9: CIMGLOW_set_alias_quality Function Variable

Variable Description Alias Quality; 0 to 100 alias_quality 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 - 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 22.10: CIMGLOW_set_dithermode Function Variable

135 Chapter 22 - Image Display Option Functions

Variable Description Use the above values to decide how or how not to dither. mode 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 - Error Codes for a list of error codes.

Screen Display Dither Mode Constants

Example 22.1 CIMGLOW_set_dithermode

DITHER_NONE 0 /* Allows for Windows to do the color reduction. This is not recommended, but available. */ DITHER_BAYER 1 /* Uses the Bayer dithering algorithm for color reduction. */ DITHER_DIFFUSION 2 /* Use error diffusion for color reduc- tion. */

** 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 22.11: CIMGLOW_set_imnet_page_size Function Variables

Variable Description iWidth Sets the document’s width iHeight Sets the document’s height iDPI Sets the document in dots per inch (DPI)

136 Chapter 22 - Image Display Option Functions

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 - 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);

Remark

Table 22.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 des- tination 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 raster_operation 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.

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 bit-

137 Chapter 22 - Image Display Option Functions

Variable Description map with the destination bitmap using the Boolean OR operator.

PATCOPY = Copies the pattern to the destination bit- map.

PATPAINT = Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the des- tination bitmap using the Boolean OR operator.

PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR oper- ator.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.

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.

CIMGLOW_set_transp_color()

This function sets the transparent color for GIF images.

Syntax

int SNBDAPI CIMGLOW_set_transp_color(int color);

Remark

Table 22.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 - Error Codes for a list of error codes.

138 Chapter 22 - Image Display Option Functions

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 22.14: CIMGLOW_set_wipedelay Function Variable

Variable Description wipe_delay Delay time in seconds

Returns

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

139 Chapter 23 - Information Query Functions

Chapter 23 - Information Query Functions

This chapter describes the RasterMaster .NET Imaging SDK information query functions. This chapter contains the following topics:

CIMG_bitmap_info()

CIMG_get_bitmap_palette()

CIMG_get_croprect()

CIMG_get_display_rect()

CIMG_ifl_version()

CIMGLOW_get_anim_delay()

CIMGLOW_get_auto_detect()

CIMGLOW_get_bitmap_header()

CIMGLOW_get_bitmap_name()

CIMGLOW_get_custstring()

CIMGLOW_get_fileinfo()

CIMGLOW_get_fileinfo_fd()

CIMGLOW_get_fileinfo_page()

CIMGLOW_get_filetype()

CIMGLOW_get_filetype_fd()

CIMGLOW_get_filetype_mem()

CIMGLOW_get_filetype_url()

CIMGLOW_get_image_orientation_page()

CIMGLOW_get_pages()

CIMGLOW_get_pages_fd()

CIMGLOW_get_pages_mem()

CIMGLOW_get_pages_url()

CIMGLOW_get_tiff_tag()

CIMGLOW_get_tiff_tag_page()

CIMGLOW_get_tiff_tag_page_fd()

CIMGLOW_get_tile_info()

CIMGLOW_get_transp_color()

140 Chapter 23 - Information Query Functions

CIMGLOW_is_tiled_image()

CIMGLOW_read_pixel()

CIMGLOW_set_bitmap_header()

CIMGLOW_set_document()

CIMGLOW_set_document_input(int, int)

CIMGLOW_set_document_input(int, int, int)

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 con- tains 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 Contrast

l Convert_Doc

l DocClean

l DDB Effect

l Image Processing

l FileMem

141 Chapter 23 - Information Query Functions

l Panning

l Scan

l Text Search

l Thumbnail

l WPF Image

Syntax

LPDIB_HEADER SNBDAPI CIMG_bitmap_info(CDIB_HEADER *dib header);

Remark

Table 23.1: CIMG_bitmap_info Function Variable

Variable Description Pointer to a CDIB_HEADER structure in which to fill. For dib_header 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.

CIMG_get_croprect()

This function returns the current crop rectangle. After decompression, the default cropping rec- tangle is the height and width of the image.

Syntax int SNBDAPI CIMG_get_croprect(CIMG_RECT *rect);

142 Chapter 23 - Information Query Functions

Remark

Table 23.2: CIMG_get_croprect Function Variable

Variable Description Rectangle to hold new size of object. For more infor- rect mation, see public class CIMG_RECT.

Returns

Returns the current crop rectangle for the image handle. Any value less than zero is a Snow- bound error code. See Appendix H - 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 23.3: CIMG_get_display_rect Function Variables

Variable Description xs Starting x position (left) ys Starting y position (top) xsize Height of display ysize Width of display

Returns

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

CIMG_ifl_version()

This function returns version information for your RasterMaster .NET Imaging SDK.

Syntax

int SNBDAPI CIMG_ifl_version(int *major, int *minor);

Remark

Table 23.4: CIMG_ifl_version Function Variable

143 Chapter 23 - Information Query Functions

Variable Description major Pointer to 8 bytes of memory to receive the major version number minor 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 Appen- dix H - 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 23.5: 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 - Error Codes for a list of error codes.

CIMGLOW_get_auto_detect()

This global function returns the current auto-detect status for the specified file type.

Syntax int SNBDAPI CIMGLOW_get_auto_detect(int format);

Remark

Table 23.6: CIMGLOW_get_auto_detect Function Variable

Variable Description format Image format type from the defined list in imglib.h

144 Chapter 23 - 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 - 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 23.7: CIMGLOW_get_bitmap_header Function Variables

Variable Description Pointer to a CDIB_HEADER structure in which to fill. For dib_header 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 - 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 23.8: CIMGLOW_get_bitmap_name Function Variables

145 Chapter 23 - Information Query Functions

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

Returns

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

Example 23.1 CIMGLOW_get_bitmap_name

C#:simage.CIMGLOW_get_bitmap_name(ref strBMName, ref strDa- teInfo);

CIMGLOW_get_custstring()

This function returns a string stored in the RasterMaster product. The name of the corporation licensed to use this product is embedded in the RasterMaster product 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 23.9: CIMGLOW_get_custstring Function Variable

Variable Description custstring Pointer to string in which to store custom string data

Returns

Returns the string stored in the RasterMaster product. Any value less than zero is a Snow- bound error code. See Appendix H - 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).

146 Chapter 23 - Information Query Functions

Syntax

int SNBDAPI CIMGLOW_get_fileinfo(String *filename, CDIB_HEADER *dib_header);

Remark

Table 23.10: CIMGLOW_get_fileinfo Function Variables

Variable Description filename Any valid existing image on the disk Pointer to a CDIB_HEADER structure. For more infor- dib_header mation, see public class CDIB_HEADER.

Returns

Returns the image information. Any value less than zero is a Snowbound error code. See Appendix H - 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, CDIB- HEADER *dib_header);

Remark

Table 23.11: CIMGLOW_get_fileinfo_fd Function Variables

Variable Description filestream Pointer to FileStream object Pointer to a CDIB_HEADER structure in which to fill. For dib_header more information, see public class CDIB_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 - Error Codes for a list of error codes.

147 Chapter 23 - 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 23.12: 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 dib_header more information, see public class CDIB_HEADER. page Page number starts at 0

Returns

Returns the file information. Any value less than zero is a Snowbound error code. See Appendix H - 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 23.13: 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 dib_header more information, see ‘‘public class CDIB_HEADER’’.

148 Chapter 23 - 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 - 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 23.14: 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. Any value less than zero is a Snowbound error code. See Appendix H - 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 cur- rently open.

Syntax

int SNBDAPI CIMGLOW_get_filetype_fd(FileStream *filestream);

Remark

Table 23.15: CIMGLOW_get_filetype_fd Function Variable

Variable Description File handle obtained from OpenFile() or _lopen() filestream Windows call

149 Chapter 23 - 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, please see Appendix B. Any value less than zero is a Snowbound error code. See Appendix H - 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 23.16: 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. Any value less than zero is a Snowbound error code. See Appendix H - 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 Loca- tor (URL) address.

Syntax int SNBDAPI CIMGLOW_get_filetype_url(String *strURL);

Remark

Table 23.17: CIMGLOW_get_filetype_url Function Variable

Variable Description strURL The URL address to point to the image

150 Chapter 23 - 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 Appen- dix B. Any value less than zero is a Snowbound error code. See Appendix H - 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 23.18: CIMGLOW_get_image_orientation_page Function Variables

Variable Description filename Path/filename of image to return orientation information page 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 - 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.

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 Convert_Doc

l Page

l Scan

151 Chapter 23 - Information Query Functions

l Split to Multiple Pages

l Text Search

l Thumbnail

Syntax int SNBDAPI CIMGLOW_get_pages(String *filename);

Remark

Table 23.19: 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 - 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 23.20: CIMGLOW_get_pages_fd Function Variable

Variable Description filestream Handle returned from a Windows OpenFile() call

Returns

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

152 Chapter 23 - Information Query Functions

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 23.21: 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 - 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 23.22: CIMGLOW_get_pages_url Function Variable

Variable Description strURL The URL address to point to the image.

Example 23.2 CIMGLOW_get_pages_url

status = simage.CIMGLOWLOW_get_pages_url

153 Chapter 23 - Information Query Functions

("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 - 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 23.23: CIMGLOW_get_tiff_tag Function Variables

Variable Description tag TIFF tag number to return max_bytes Maximum bytes to read for string tags ptr_value Pointer to tag value returned strFileName Filename to read tags from strBuff 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 - Error Codes for a list of error codes.

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.

154 Chapter 23 - Information Query Functions

Example 23.3 IMGLOW_get_tiff_tag

int tag_no = 262; int max_bytes = 0; int[] value = new int[1]; byte[] data = null;

myFrame.Simage.IMGLOW_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 23.24: CIMGLOW_get_tiff_tag_page Function Variables

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

155 Chapter 23 - 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 - 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 23.25: CIMGLOW_get_tiff_tag_page_fd Function Variables

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

Returns

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

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 23.26: CIMGLOW_get_tile_info Function Variables

156 Chapter 23 - Information Query Functions

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

Example 23.4 CIMGLOW_get_tile_info

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

Returns

Returns the filename of a tiled image. Any value less than zero is a Snowbound error code. See Appendix H - 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 - 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 23.27: CIMGLOW_is_tiled_image Function Variable

157 Chapter 23 - Information Query Functions

Variable Description filename Path/filename of the file to return animation delay time

Returns

Returns the value of the tiled image. Any value less than zero is a Snowbound error code. See Appendix H - 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 23.28: CIMGLOW_read_pixel Function Variables

Variable Description xpos X coordinate of pixel to read ypos 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 - 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 23.29: CIMGLOW_set_bitmap_header Function Variables

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

158 Chapter 23 - Information Query Functions

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.

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 23.5 CIMG_decompress_bitmap

status = simage.CIMG_decompress_bitmap(filename.tif); sdibHeader = new CDIB_HEADER(); status = simage.CIMG_bitmap_info(sdibHeader);

sdibHeader.biXPelsPerMeter = 200; sdibHeader.biYPelsPerMeter = 200;

//resize image to what you want //status = simage.CIMG_resize_bitmap(newImageWidth, new- ImageHeight);

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 23.30: CIMGLOW_set_document Function Variables

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

159 Chapter 23 - Information Query Functions

Returns

Returns the status of the document. Any value less than zero is a Snowbound error code. See Appendix H - 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’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 input bits-per- pixel to 1 for black and white input without the extra overhead and performance costs of proc- essing 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 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_doc- ument_input(int, int, int) to set the input quality for a specific format, including Office 2007 for- mats.

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 23.31: 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 proc-

160 Chapter 23 - Information Query Functions

Variable Description ess and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents bits_pix 24 = color images See Appendix B 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 - Error Codes for a list of error codes.

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’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 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.

l Read in color or grayscale documents by setting a higher bits-per-pixel. Please see Appendix B 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 23.32: CIMGLOW_set_document_input Function Variable

161 Chapter 23 - Information Query Functions

Variable Description dpi Sets the input resolution in dots per inch. A higher dpi yields a higher quality document that takes longer to proc- ess and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents bits_pix 24 = color images See Appendix B for information on these and other pixel depths supported by each format. Sets the format parameter. A file format number as spec- format ified in Appendix B i.e. Word (DOC) is 86.

Returns

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

162 Chapter 24 - Text Search Functions

Chapter 24 - Text Search Functions

This chapter describes the RasterMaster .NET Imaging SDK text search functions. This chap- ter contains the following topics:

CIMG_save_document()

CIMGLOW_extract_text()

CIMGLOW_extract_text_mem()

CIMGLOW_extract_text_mem_pointer()

CIMGLOW_extract_text_pointer()

CIMGLOW_search_text()

CIMGLOW_search_text_pointer()

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_bit- map() function only creates a bitmap file. This currently only supports the PDF file as an out- put 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 24.1: CIMG_save_document Function Variables

Variable Description *strName Name of the output PDF file buff Buffer of extracted text, graphics, and bitmaps filetype 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 - Error Codes for a list of error codes.

163 Chapter 24 - Text Search Functions

Example 24.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 /PageNumber=X Page number being extracted. /PageWidth=X Width of page in points. (1/72 of an inch) /PageHeight=X Height of page in points. (1/72 of an inch) %%EOF Marks the end of this file. No more data to

process. /Font Start of font data and attributes. /FontName=Text Standard font face name. /FontHeight=X Font height in points (1/72 of an inch). /FontBold=X Set to 1 for bold font otherwise 0. /FontItalic=X Set to 1 for Italic font otherwise 0. /Xpos=X X starting coordinate of text string. /Ypos=X Y starting coordinate of text string. %%SOT Start of a text string after the carriage return. Text Data here %%EOT Ends a text string. /Image Start of image data and attributes. /ImageWidth=X Width in pixels of the image data. /ImageHeight=X Height in pixels of the image data. /Bitsperpixel=X Number of bits per pixel. /Compression=Text Compression type used. CCITT_G4, JPEG, or NONE. /Length=X Length of binary image data. %%SOI Starts the binary image data. Binary data here %%EOI Ends the binary image data. /DrawImage Xs Ys Width Height Draws the last defined image at the location specified by the arguments. /Moveto XS YS Moves current graphics drawing

164 Chapter 24 - Text Search Functions

position. /Line XS YS Draws a line from current graph- ics 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 Y3 Draws a curve from the current graphics drawing position to the end coordinates using the first 4 arguments as guide points.

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);

Remarks

Table 24.2: CIMGLOW_extract_text Function Variables

Variable Description *strFileName Name of file from which to extract text *arrBuffer Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted *ptrLength buffer page Page number of file from which to extract text

165 Chapter 24 - Text Search Functions

Returns

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

Example 24.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

Table 24.3: Extracted Text Variables

Variable Description %%SOF Signals the start of the buffer %%EOF Marks the end of extracted text Specified once at the beginning of the file to indicate the Page page number Specified once at the beginning of the file to indicate page Width width in pixels Specified once at the beginning of the file to indicate page Height height in pixels Font Name Name of font FontHeight 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

166 Chapter 24 - Text Search Functions

Variable Description Xpos X pos in pixels Ypos Y pos in pixels %%SOT Start of text block %%EOT End of text block

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 24.4: CIMGLOW_extract_text_mem Function Variables

Variable Description *arrImage Memory array to image data *arrBuffer Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted *ptrLength buffer 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 - Error Codes for a list of error codes.

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 24.5: CIMGLOW_extract_text_mem_pointer Function Variables

167 Chapter 24 - Text Search Functions

Variable Description *arrImage Memory array to image data *arrBuffer Pointer of buffer from which to receive extracted text Pointer to an integer to return the length of the extracted *ptrLength buffer 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 I for a list of error codes.

CIMGLOW_extract_text_pointer()

This function extracts text from PTOCA files. It returns the buffer pointer of extracted text in ASCII format. The returned buffer pointer can be used by CIMGLOW_search_text_ pointer. This function runs faster than CIMGLOW_search_text. It is supported by C++ and C#.

Syntax

int SNBDAPI CIMGLOW_extract_text_pointer(String *strFileName, char** pptrBuffer, int *ptrLength, int page);

Remarks

Table 24.6: CIMGLOW_extract_text_pointer Function Variables

Variable Description *strFileName Name of file from which to extract text **pptrBuffer Pointer from buffer from which to receive extracted text Pointer to an integer to return the length of the extracted *ptrLength buffer 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 - 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.

168 Chapter 24 - Text Search Functions

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 24.7: CIMGLOW_search_text Function Variables

Variable Description Array of CIMG_SEARCH_RESULT specifying the location sbdRCList of the string found. For more information, see ‘‘public class CIMG_SEARCH_RESULT’’. Character buffer to search. Returned from a call to CIM- txtBuffer GLOW_extract_text(). strSearch Search string instance Occurance of search string to find, start from 0 Is search case sensitive. case_sense 0 = Not case sensitive 1 = case sensitive ptrerror Error code pRecNum Number of items in search result array.

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 - Error Codes for a list of error codes.

CIMGLOW_search_text_pointer()

This function searches the specified character buffer, txtBuffer, for the instance occurance of the string specified by the search_string argument. The search result specifying the location of the string found is returned to an array of CIMG_SEARCH_RESULT. This rectangle in the search result can be used to highlight the searched string found on the displayed page.

169 Chapter 24 - Text Search Functions

Syntax

int SNBDAPI CIMGLOW_search_text_pointer(CIMG_SEARCH_RESULT[] sbdRCList, char *txtbuffer, String *strSearch, int case_sense, int *ptrerror, int *pRecNum);

Remark

Table 24.8: CIMGLOW_search_text_pointer Function Variables

Variable Description Array of CIMG_SEARCH_RESULT specifying the location sbdRCList of the string found. Returned from a call to CIMGLOW_ extract_text(). Pointer to the character buffer to search. Returned from a txtBuffer call to CIMGLOW_extract_text_pointer(). strSearch Search string Is search case sensitive. case_sense 0 = Not case sensitive 1 = case sensitive Is search case sensitive. case_sense 0 = Not case sensitive 1 = case sensitive ptrerror Error code pRecNum Number of items in search result array.

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 - Error Codes for a list of error codes.

170 Chapter 25 - AFP Font Mapping Functions

Chapter 25 - 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 bar- codes, then you can customize RasterMaster to use particular fonts when processing your AFP files. RasterMaster 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 rep- resentative sample AFP document to Snowbound Software by entering a support issue at www.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 automatically loads the snbd_map.fnt file if it is found in one of the following direc- tories:

l The \Windows directory

l The directory into which images are being read

l 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:

171 Chapter 25 - 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,Arial,14,0,1

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

Variable Description C0BC25I3 Font resource name in the AFP file. Courier New face name to map to. 10 New size in points or 1/72 of an inch. 0 Bold attribute, 0 - off , 1 - on. 0 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 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 Formats for details on which formats support color information at different bit- depths.

CIMGLOW_set_fontmap_path()

This function defines the path where Snowbound Software will look for the font mapping file, snbd_map.fnt.

Syntax

int SNBDAPI CIMGLOW_set_fontmap_path(String *strPath);

172 Chapter 25 - AFP Font Mapping Functions

Remarks

Table 25.2: CIMGLOW_set_fontmap_path Function Variables

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

The snbd_map.fnt file will be appended to the path name. strPath CIMGLOW_set_fontmap_path("c:\\temp");

This variable is limited to 50 bytes. Therefore, the path must be below 50 characters.

Example 25.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 - 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 25.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 var- iable overrides existing font mapping in the snbd_ map.fnt file. strFontMap The following are some examples of the data in this var- iable:

C0H400xx90,PrecisionID Postnet L DEMO,12,0,0

C0BPOSBX,CCodePostnet,10,0,0

173 Chapter 25 - AFP Font Mapping Functions

Variable Description mapLength The integer length of font mapping data

Example 25.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 - Error Codes for a list of error codes.

174 Chapter 26 - Housekeeping Functions

Chapter 26 - Housekeeping Functions

This chapter describes the RasterMaster .NET Imaging SDK housekeeping functions. This chapter contains the following topic:

CIMG_delete_bitmap()

CIMG_delete_bitmap_keep()

CIMG_unload_plugins()

CIMGLOW_set_bitmap_name()

CIMGLOW_set_tiff_indexing()

CIMG_delete_bitmap()

This function removes the image from memory when you are finished with it or when ter- minating 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 fin- ished 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);

175 Chapter 26 - Housekeeping Functions

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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

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_han- dle_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 Bit- map). The original image is not altered.

CIMG_unload_plugins()

This global function unloads all RasterMaster 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 plugins from memory. Any value less than zero is a Snow- bound error code. See Appendix H - 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 sup- ports it. Each buffer should be at least 200 bytes.

Syntax

int SNBDAPI CIMGLOW_set_bitmap_name(String *strName, String *strDate);

176 Chapter 26 - Housekeeping Functions

Remark

Table 26.1: CIMGLOW_set_bitmap_name Function Variables

Variable Description String to set name or author for any subsequent images to strName be saved strDate 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 - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

Example 26.1 CIMGLOW_set_bitmap_name

C#:status = simage.CIMGLOW_set_bitmap_name(strBMName, strDa- teInfo);

CIMGLOW_set_tiff_indexing()

This function sets the TIFF indexing page.

Syntax int SNBDAPI CIMGLOW_set_tiff_indexing(int pages);

Remark

Table 26.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 - Error Codes for a list of error codes.

177 Chapter 27 - DocClean Functions

Chapter 27 - DocClean Functions

This chapter describes the RasterMaster .NET Imaging SDK DocClean functions. DocClean is an optional extension of RasterMaster that provides a group of functions that are useful for cleaning up scanned color, grayscale and black and white images. This chapter contains the fol- lowing topics:

CIMG_auto_orient()

CIMG_deskew_bitmap()

CIMG_despeckle_bitmap()

CIMGLOW_auto_invert()

CIMGLOW_detect_blank_page()

CIMGLOW_image_dilation()

CIMGLOW_image_erosion()

CIMGLOW_remove_halftone()

CIMGLOW_remove_lines()

CIMGLOW_remove_holepunch()

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 27.1: CIMG_auto_orient Function Variables

Variable Description Angle returned as the current orientation. Number of pixels p_angle 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 - Error Codes for a list of error codes.

178 Chapter 27 - DocClean Functions

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);

Remark

Table 27.2: CIMG_deskew_bitmap Function Variable

Variable Description angle Angle value set.

Returns

Snowbound Error Code. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

Example 27.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);

179 Chapter 27 - DocClean Functions

Remark

Table 27.3: CIMG_despeckle_bitmap Function Variable

Variable Description Sets the coarseness of the amount of data to be filtered or removed. quality 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 zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

Example 27.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 27.4: CIMGLOW_auto_invert Function Variables

Variable Description 24-bpp: Red component of the detection color or the full background color for 1, 4 and 8-bit per pixel images. May red 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 non- green 24-bpp images. May have the value of [0-255].

180 Chapter 27 - DocClean Functions

Variable Description Blue component of the detection color. Ignored for non-24- blue bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear dis- colourTolerance tance value. Mismatch tolerance percentage. If negative, it will default to 75. An example of a valid value is 50.26. If the per- mismatchTolerance centage of background pixels on the page is less than the mismatch tolerance, the image will not be inverted.

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 - 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 isLow- Memory, Double* pctMismatch);

Remark

Table 27.5: CIMGLOW_detect_blank_page Function Variables

Variable Description Auto-detect the background color (0: no; 1: yes). 1 will force autodetect 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 red 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- green bpp images. May have the value of [0-255]. blue Blue component of the detection color. Ignored for non-24-

181 Chapter 27 - DocClean Functions

Variable Description bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear dis- tolerance tance value. Use this value in comparing background pix- els. 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 isLowQuality 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 algo- rithm (0: no; 1: yes). The low-memory version will not guar- isLowMemory antee 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 exam- ple, 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 - 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 con- tent 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 27.6: CIMGLOW_image_dilation Function Variable

Variable Description coarseness The coarseness or amount of dilation.

182 Chapter 27 - DocClean Functions

Returns

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

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 27.7: CIMGLOW_image_erosion Function Variable

Variable Description quality The coarseness or amount of erosion.

Returns

Returns the status of the image erosion operation. A value greater or equal to 0 indicates suc- cess and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H - 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 27.8: CIMGLOW_remove_halftone Function Variables

183 Chapter 27 - DocClean Functions

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

Returns

Returns the status of the halftone removal operation. A value greater or equal to 0 indicates suc- cess and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H - 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 27.9: CIMGLOW_remove_lines Function Variables

Variable Description horizontal If set to 1, removes horizontal lines. vertical If set to 1, removes vertical lines. min_value 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 - 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.

184 Chapter 27 - DocClean Functions

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.

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 27.10: CIMGLOW_remove_holepunch Function Variables

Variable Description Auto-detect the fill colour (0: no; 1: yes). 1 will force the sys- autoDetectFillColour tem 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 red 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. green Ignored for non-24-bpp images. May have the value of [0- 255]. Blue component of the detection color for 24-bit images. blue 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 autoFindHoles the system to ignore the passed holes. Array of hole punch spans to fill. If there are regions-of-inter- est (ROI), then all holes which do not completely lie within holes 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 holeNum autoFindHoles is 1. Array of regions-of-interest (ROI). ROIs are areas where ROIs holes may span. If ROIs is NULL and the holes are not

185 Chapter 27 - DocClean Functions

Variable Description 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 algo- rithmically. Number of elements in the ROIs array. May be 0 when ROIsNum ROIs is NULL. Minimum diameter in pixels of any holes. This is only used minHoleDiameter when holes are automatically found. Maximum diameter in pixels of any holes. This is only used maxHoleDiameter 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 - Error Codes for a list of error codes.

186 Chapter 28 - Image Processing Functions

Chapter 28 - Image Processing Functions

This chapter describes the RasterMaster .NET Imaging SDK image-processing functions. This chapter contains the following topics:

CIMG_antique_effect()

CIMG_apply_profile()

CIMG_auto_orient()

CIMG_autocrop_bitmap()

CIMG_create_thumbnail()

CIMG_deskew_bitmap()

CIMG_despeckle_bitmap()

CIMG_dib_to_ddb()

CIMG_dib_to_runs()

CIMG_erase_rect()

CIMG_flip_bitmapx()

CIMG_flip_bitmapy()

CIMG_get_deskew_angle()

CIMG_get_profile()

CIMG_histogram_equalize()

CIMG_invert_bitmap()

CIMG_merge_annotation()

CIMG_merge_bitmap()

CIMG_merge_bitmap_alpha()

CIMG_process_bitmap()

CIMG_remove_red_eye()

CIMG_resize_bitmap()

CIMG_resize_bitmap_bicubic()

CIMG_resize_bitmap_interp()

CIMG_rotate_bitmap()

CIMG_runs_to_dib()

CIMG_set_display_angle()

187 Chapter 28 - Image Processing Functions

CIMG_sharpen_bitmap()

CIMGLOW_get_palette()

CIMGLOW_get_raster()

CIMGLOW_put_palette()

CIMGLOW_put_raster()

CIMGLOW_set_fast_convert()

CIMG_antique_effect()

This function converts color images to look as though they are antique photos. It replaces col- ors 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 pro- file 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 28.1: CIMG_apply_profile Function Variables

Variable Description strInputProfile String buffer containing the input profile. strOutputProfile String buffer containing the output buffer. mode For mode choices, see below.

Table 28.2: CIMG_apply_profile Variable Modes

188 Chapter 28 - Image Processing Functions

Mode Description 0 Apply permanently to the image data. 1 Apply only at display time.* 2 Apply only at print time.* 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 - 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 28.3: CIMG_auto_orient Function Variable

Variable Description Angle returned as the current orientation. Number of pix- p_angle els 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 - 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 dis- carded 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

189 Chapter 28 - Image Processing Functions

not a 1-bit image, you will get a PIXEL_DEPTH_UNSUPPORTED (-21) error message. See Appendix H for more information.

Syntax

int SNBDAPI CIMG_autocrop_bitmap(int margin_numofpixels);

Remark

Table 28.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 - 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 cor- rect resize function for the image. See CIMG_resize_bitmap() and CIMG_resize_bitmap_bicu- bic() 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.

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 28.5: CIMG_create_thumbnail Function Variables

190 Chapter 28 - Image Processing Functions

Variable Description width New width of image in pixels height New height of image in pixels

Returns

Returns the status of the create thumbnail operation. Any value less than zero is a Snowbound error codeSee Appendix H - 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 rota- tion 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 28.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 - 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.

191 Chapter 28 - Image Processing Functions

Syntax

int SNBDAPI CIMG_despeckle_bitmap(int value);

Remark

Table 28.7: CIMG_despeckle_bitmap Function Variable

Variable Description Quality factor 1 - 100 value 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 - 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 Bit- map). The original image is not altered.

Syntax

DDB SNBDAPI CIMG_dib_to_ddb(int width, int height);

Remark

Table 28.8: CIMG_dib_to_ddb Function Variables

Variable Description width Width of desired DDB height 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 - Error Codes for a list of error codes.

Example 28.1 CIMG_dib_To_ddb

C#:IntPtr HBmp = simage.CIMG_dib_to_ddb(panImage.Width, pan- Image.Height);

192 Chapter 28 - Image Processing Functions

CIMG_dib_to_runs()

This function converts the internal library image format from Windows DIB format to a Snow- bound 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 - 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 28.9: CIMG_erase_rect Function Variables

Variable Description x X start of rectangle in pixels y Y start of rectangle in pixels width width of the rectangle in pixels height height of the rectangle in pixels color Color to draw 1 = Draw inside rectangle in_outflag 0 = Draw outside rectangle

Returns

Returns the status of the erase rectangle operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 per- manently changes the image in memory.

193 Chapter 28 - 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 - 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 per- manently 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 - 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 exam- ple 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 28.10: CIMG_get_deskew_angle Function Variables

Variable Description angle Pointer to integer to receive deskew angle

194 Chapter 28 - Image Processing Functions

Variable Description start_degree Starting angle for which to check end_degree 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 - 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 con- tain an embedded color profile.

Syntax char * SNBDAPI CIMG_get_profile(String *strFile, String **strBuffer, int page, Int32 *ptrLength);

Remarks

Table 28.11: CIMG_get_profile Function Variables

Variable Description strFile File name for the image to be read in from the profile. strBuffer String buffer of the profile. page Page number to be read in from the profile. ptrLength Length of the buffer.

Returns

Returns the character buffer. Any value less than zero is a Snowbound error code. See Appen- dix H - 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);

195 Chapter 28 - Image Processing Functions

Returns

Returns the status of the histogram equalize operation. Any value less than zero is a Snow- bound error code. See Appendix H - 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 invert- ing documents which have a black background. This permanently changes the image in mem- ory.

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 - Error Codes for a list of error codes.

CIMG_merge_annotation()

This function merges a current annotation to an image object.

Syntax

int SNBDAPI CIMG_merge_annotation(int iWidth, int iHeight);

Remark

Table 28.12: CIMG_merge_annotation Function Variables

Variable Description iWidth Image width. iHeight Image height.

Returns

Returns the status of the merge annotations operation. Any value less than zero is a Snow- bound error code. See Appendix H - 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 bool- ean function specified by raster_operation. This opcode allows ANDing and ORing over the current image.

196 Chapter 28 - 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 Merge Image sample.

Syntax int SNBDAPI CIMG_merge_bitmap(String *filename, int raster_oper- ation, int x, int y);

Remark

Table 28.13: CIMG_merge_bitmap Function Variables

Variable Description Path/filename of disk image to merge onto the image in filename 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 des- tination 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.

4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Bool- raster_operation ean 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

197 Chapter 28 - Image Processing Functions

Variable Description GXcopy GXandInverted GXnoop GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand

8 or MERGEPAINT = Combines the inverted source bit- map with the destination bitmap using the Boolean OR operator.

9 or PATCOPY = Copies the pattern to the destination bit- map.

10 or PATPAINT = - Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Com- bines the result of this operation with the destination bit- map 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.

14 or WHITENESS = Turns all output white. x Pointer to integer to receive the starting x coordinate. y 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 - 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 bool- ean function specified by raster_operation. This opcode allows ANDing and ORing over the current image.

198 Chapter 28 - Image Processing Functions

Syntax int SNBDAPI CIMG_merge_bitmap(Snowbnd *src, int raster_operation, int x, int y);

Remark

Table 28.14: CIMG_merge_bitmap Function Variables

Variable Description Merges the source Snowbnd object image into the calling src Snowbnd object at x and y with the specified raster oper- ation ROP opcode obtained from the list below or the Windows SDK manual.

0 or SRCCOPY = Copies the source bitmap to the des- tination 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.

4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Bool- ean AND operator. raster_operation 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 GXnoop

199 Chapter 28 - Image Processing Functions

Variable Description GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand

8 or MERGEPAINT = Combines the inverted source bit- map with the destination bitmap using the Boolean OR operator.

9 or PATCOPY = Copies the pattern to the destination bit- map.

10 or PATPAINT = - Combines the inverted source bit- map 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.

14 or WHITENESS = Turns all output white. x Pointer to integer to receive the starting x coordinate. y 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 - 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 trans- parency channel.

Syntax

int SNBDAPI CIMG_merge_bitmap_alpha(Snowbnd *src, CDIB_HEADER, *dib_header, int xpos, int ypos, int opaque);

Remark

Table 28.15: CIMG_merge_bitmap_alpha Function Variables

200 Chapter 28 - Image Processing Functions

Variable Description Standard for snowbnd object 32-bit alpha channel image src to merge Pointer to a CDIB_HEADER structure contains the image dib_header header. For more information, see public class CDIB_ HEADER. xpos Starting x coordinate for which to merge image ypos Starting y coordinate for which to merge image 1 = use transparency channel information to blend images opaque 0 = do not draw any pixels with transparency channel infor- mation 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 - 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 28.16: CIMG_process_bitmap Function Variables

Variable Description Specify the type of filter to be performed

0 = User defined 3 * 3 matrix 1 = Isolate points type 2 = Edge detection 3 = Horizontal edge detection 4 = Vertical edge detection 5 = 45 degree edge detection

201 Chapter 28 - Image Processing Functions

Variable Description 6 = -45 degree edge detection 7 = Laplacian 8 = Dialation 9 = Roberts Cross Array that contains the operator value to apply to the matrix 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 - 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 28.17: CIMG_remove_red_eye Function Variables

Variable Description x Starting top left area for x coordinate y Starting top left area for y coordinate width Width of area to search height Height of area to search

Returns

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

202 Chapter 28 - Image Processing Functions

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().

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 28.18: CIMG_resize_bitmap Function Variables

Variable Description width New width of image height New height of image

Returns

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

CIMG_resize_bitmap_bicubic()

This function uses a bicubic interpolation algorithm to scale down images. This is good for cre- ating 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 28.19: CIMG_resize_bitmap_bicubic Function Variables

203 Chapter 28 - Image Processing Functions

Variable Description width Width of image in pixels height 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 - 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 28.20: CIMG_resize_bitmap_interp Function Variables

Variable Description width New width of image height New height of image

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 - 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

204 Chapter 28 - Image Processing Functions

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 flips from portrait to land- scape (or vice-versa) and preserves the page content. If the image is rotated by some- thing other than 90 degrees, RasterMaster shrinks the page so that all the content is preserved. RasterMaster does not crop the edges during the rotation.

Syntax int SNBDAPI CIMG_rotate_bitmap(int angle);

Remark

Table 28.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 - Error Codes for a list of error codes.

CIMG_runs_to_dib()

The RasterMaster 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 Snow- bound error code. See Appendix H - 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_bit- map_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.

205 Chapter 28 - 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 Alpha sample.

Syntax

int SNBDAPI CIMG_set_display_angle(int rotate_angle);

Remark

Table 28.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 - Error Codes for a list of error codes.

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 28.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 - Error Codes for a list of error codes.

206 Chapter 28 - Image Processing Functions

CIMGLOW_get_palette()

This function returns the palette entries of the specified image into an array of RGBQUAD struc- tures.

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 28.24: CIMGLOW_get_palette Function Variables

Variable Description arrRGBQuad Array of RGBQUAD structures

Returns

Returns the get palette operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 28.25: CIMGLOW_get_raster Function Variables

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

207 Chapter 28 - Image Processing Functions

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 struc- tures.

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 28.26: CIMGLOW_put_palette Function Variables

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 - 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 28.27: CIMGLOW_put_raster Function Variables

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

208 Chapter 28 - Image Processing Functions

Returns

Returns the put raster operation. Any value less than zero is a Snowbound error code. See Appendix H - 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 func- tions, 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);

Remark

Table 28.28: CIMGLOW_set_fast_convert Function Variables

Variable Description 0 = Off off_on 1 = On format Sets the format

Returns

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

209 Chapter 29 - Document Conversion and Text Extraction Functions

Chapter 29 - Document Conversion and Text Extraction Functions

This chapter describes the functions used for document conversion and text extraction. The chapter contains the following topics:

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 search- able. The PDF file created can be searched for words or phrases with the use of a text search- ing 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

210 Chapter 29 - Document Conversion and Text Extraction Functions

Syntax

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

Remark

Table 29.1: CIMGLOW_extract_text Function Variables

Variable Description *strFileName Name of file from which to extract text *arrBuffer Buffer from which to receive extracted text *ptrLength Pointer to an integer to return the length of the extracted buffer page 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 - Error Codes for a list of error codes.

Example 29.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

Table 29.2: Extracted Text Variable

Variable Description %%SOF Signals the start of the buffer

211 Chapter 29 - Document Conversion and Text Extraction Functions

Variable Description %%EOF Marks the end of extracted text Specified once at the beginning of the file to indicate the Page page number Specified once at the beginning of the file to indicate page Width width in pixels Specified once at the beginning of the file to indicate page Height height in pixels Font Name Name of font FontHeight 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 Xpos X pos in pixels Ypos Y pos in pixels %%SOT Start of text block %%EOT End of text block

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 29.3: CIMGLOW_extract_text_mem Function Variables

Variable Description *arrImage Memory array to image data *arrBuffer Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted *ptrLength buffer page Page number of file from which to extract text

Table 29.4: Extracted Text Variable

Variable Description Ypos Y pos in pixels Xpos X pos in pixels

212 Chapter 29 - Document Conversion and Text Extraction Functions

Variable Description Specified once at the beginning of the file to indicate page Width width in pixels Specified once at the beginning of the file to indicate the Page page number Specified once at the beginning of the file to indicate page Height height in pixels Font to be drawn in normal or italic FontItalic 1 = italic 0 = normal FontHeight Font height in pixels Font to be drawn plain or in bold FontBold 1 = bold 0 = plain Font Name Name of font %%SOT Start of text block %%SOF Signals the start of the buffer %%EOT End of text block %%EOF Marks the end of extracted text

Returns

Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H - 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_bit- map() function only creates a bitmap file. This currently only supports the PDF file as an out- put 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);

Remarks

Table 29.5: CIMG_save_document Function Variables

213 Chapter 29 - Document Conversion and Text Extraction Functions

Variable Description *strName Name of the output PDF file buff Buffer of extracted text, graphics, and bitmaps filetype 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 - Error Codes for a list of error codes.

Example 29.2 Data Format for Extracted Text Buffer for both Windows and Java

The coordinates system is origined 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=X Page number being extracted. /PageWidth=X Width of page in points. (1/72 of an inch) /PageHeight=X Height of page in points. (1/72 of an inch) %%EOF Marks the end of this file. No more data to

process. /Font Start of font data and attributes. /FontName=Text Standard font face name. /FontHeight=X Font height in points (1/72 of an inch). /FontBold=X Set to 1 for bold font otherwise 0. /FontItalic=X Set to 1 for Italic font otherwise 0. /Xpos=X X starting coordinate of text string. /Ypos=X Y starting coordinate of text string. %%SOT Start of a text string after the carriage return. Text Data here %%EOT Ends a text string. /Image Start of image data and attributes. /ImageWidth=X Width in pixels of the image data. /ImageHeight=X Height in pixels of the image data. /Bitsperpixel=X Number of bits per pixel. /Compression=Text Compression type used. CCITT_G4, JPEG, or NONE. /Length=X Length of binary image data. %%SOI Starts the binary image data. Binary data here

214 Chapter 29 - Document Conversion and Text Extraction Functions

%%EOI Ends the binary image data. /DrawImage Xs Ys Width Height Draws the last defined image at the location specified by the arguments. /Moveto XS YS Moves current graphics drawing posi- tion. /Line XS YS Draws a line from current graph- ics 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 Y3 Draws 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 out- put 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 *bu- ffArray, int filetype));

Remarks

Table 29.6: CIMG_save_document_mem Function Variables

Variable Description *imgArray Memory array already allocated buffArray Buffer of extracted text, graphics, and bitmaps filetype Currently only supports PDF - file type 59

215 Chapter 29 - 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 Ras- terMaster .NET version 17.9.9 or later. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

216 Chapter 30 - Color Promotion Functions

Chapter 30 - Color Promotion Functions

This chapter describes the RasterMaster .NET Imaging SDK color promotion functions. Gen- erally 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 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 Formats for details on which formats support color information at different bit- depths.

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);

217 Chapter 30 - Color Promotion Functions

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_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 - 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 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);

218 Chapter 30 - 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 - 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. The RasterMaster products 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 spec- ifying 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 - 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 spec- ifying 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 30.1: CIMG_color_combine Function Variables

219 Chapter 30 - Color Promotion Functions

Variable Description Standard for 8-bit gray-scale image which represents the blue_handle blue plane (cyan). Standard for 8-bit gray-scale image which represents the green_handle green plane (magenta). Standard for 8-bit gray-scale image which represents the red_handle red plane (yellow). Standard for 8-bit gray-scale image which represents the k_handle black plane (black). If negative, creates a 24-bit RGB image. planes_num 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 - 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 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 spec- ifying the alias and alias quality.

Syntax

int SNBDAPI CIMG_color_separate(Snowbnd *dest, int plane);

Remark

Table 30.2: CIMG_color_separate Function Variables

Variable Description The plane can be one of the following:

For 32 bit cmyk planes are: 0 = cyan 1 = magenta 2 = yellow plane 3 = black

For 24-bit rgb planes are: 0 = blue 1 = green 2 = red

220 Chapter 30 - 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 - 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 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 30.3: CIMGLOW_get_tiff_tag Function Variables

Variable Description tag TIFF tag number to return max_bytes Maximum bytes to read for string tags ptr_value Pointer to tag value returned strFileName Filename to read tags from strBuff 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 - Error Codes for a list of error codes.

Example 30.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, st,

221 Chapter 30 - Color Promotion Functions

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

222 Chapter 31 - Color Reduction Functions

Chapter 31 - Color Reduction Functions

This chapter describes the RasterMaster .NET Imaging SDK 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 from the functions that save images with more color (largest output depth) to less color (smaller size):

CIMG_color_gray()

CIMG_resize_to_gray()

CIMG_popularity_color()

CIMG_mediancut_color()

CIMG_octree_color()

CIMG_bayer_color()

CIMG_bayer_mono()

CIMG_diffusion_mono()

CIMG_thresh_mono()

CIMG_halftone_mono()

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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able 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 - Error Codes for a list of error codes.

223 Chapter 31 - Color Reduction Functions

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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able in our library for photo type images.

Syntax

int SNBDAPI CIMG_resize_to_gray(int width, int height);

Remark

Table 31.1: CIMG_resize_to_gray Function Variables

Variable Description width Destination width of image to resize height 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 - 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 pop- ularity 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 spec- ifying the alias and alias quality.

224 Chapter 31 - Color Reduction Functions

We highly recommend the JPEG compression format as the best compression avail- able 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 - Error Codes for a list of error codes.

CIMG_mediancut_color()

This function permanently converts a 24-bit image to an 8-bit per pixel image using a com- bination of the popularity algorithm and error diffusion.

Note: The quality of the conversion to black and white or grayscale can be enhanced by spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able 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 - 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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able in our library for photo type images.

225 Chapter 31 - Color Reduction Functions

Syntax

int SNBDAPI CIMG_octree_color(int bits_per_pixel, IMG_RGBQUAD *input_prgb, int entries);

Remark

Table 31.2: CIMG_octree_color Function Variables

Variable Description bits_per_pixel Pixel depth to convert to: 4 or 8 input_prgb Pointer to array of RGBQUAD structures Number of colors to reduce entries 1 - 16 for 4-bit images 1 - 256 for 8-bit images

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.

Example 31.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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able 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 - Error Codes for a list of error codes.

226 Chapter 31 - Color Reduction Functions

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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able 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 - 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.

Note: The quality of the conversion to black and white or grayscale can be enhanced by spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able in our library for photo type images.

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 - 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.

227 Chapter 31 - Color Reduction Functions

Note: The quality of the conversion to black and white or grayscale can be enhanced by spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able in our library for photo type images.

Syntax

int SNBDAPI CIMG_thresh_mono(int threshhold);

Remark

Table 31.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 - 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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able 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 - Error Codes for a list of error codes.

228 Chapter 31 - 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 out- put document size by ensuring the black and white pages are saved as 1-bit per pixel (mono- chrome) 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 con- verting 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 spec- ifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression avail- able in our library for photo type images.

Syntax int IMGLOW_detect_color(void);

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 con- tains 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 - Error Codes for a list of error codes.

Example 31.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);

229 Chapter 31 - Color Reduction Functions

} CIMG_delete_bitmap();

230 Chapter 32 - ASCII Formats and Functions

Chapter 32 - 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.

Syntax

Example 32.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;

231 Chapter 32 - ASCII Formats and Functions

String *asciiTypeFace; CASCIITEXTATTR(); void reset(); };

Remark

Table 32.1: public class CASCIITEXTATTR Variables

Variable Default Description int asciiFlags 0 Determines which fields to use int asciiXDpi 200 Horizontal dots per inch int asciiYDpi 200 Vertical dots per inch if (asciiMargin == 0) asciiMargin = new CIMG_ RECT(); asciiMargin->left = CIMG_RECT *asciiMargin 1000; Margins in 1/1000 inches asciiMargin->right = 1000; asciiMargin->top = 750; asciiMargin->bottom = 750; Number of characters between tab int asciiTabStop 8 stops int asciiPageWidth 8500 Width of page in 1/1000 inches int asciiPageHeight 11000 Height of page in 1/1000 inches int asciiPointSize -1 Point size of the font int asciiCharsPerLIne 80 Number of characters per line int asciiLinesPerPage 60 Number of lines per page Normal=0 int asciiWeight 0 Bold=1 Normal=0 int asciiItalic 0 Italic=1 String *asciiTypeFace Courier New Name of the font to use

Table 32.2: ASCIITEXTATTR Function Flags

Flag Description ASCIIXDPI (1L<<0) ASCIIYDPI (1L<<1) ASCIIMARGIN (1L<<2) ASCIITABSTOP (1L<<3) ASCIIPAGEWIDTH (1L<<4) ASCIIPAGEHEIGHT (1L<<5)

232 Chapter 32 - ASCII Formats and Functions

Flag Description ASCIIPOINTSIZE (1L<<6) ASCIICHARSPERLINE (1L<<7) ASCIILINESPERPAGE (1L<<8) ASCIIWEIGHT (1L<<9) ASCIIITALIC (1L<<10) ASCIITYPEFACE (1L<<11)

Before you call CIMGLOW_set_ascii_attributes, you need to set attr.asciiFlags to indicate which field to update.

Please refer to Table 32-2 and the following example code to set attr.asciiFlags to indi- cate which field to update:

Example 32.2 attr.asciiFlags

attr.asciiFlags = 0xa40; attr.asciiWeight = 1; attr.asciiPointSize = 48; attr.asciiTypeFace = "Arial"; attr.asciiXDpi = maxResolution; attr.asciiYDpi = maxResolution; status = simage.CIMGLOW_set_ascii_attributes(attr);

Table 32.3: Standard Page Sizes

ASCIIXSIZELETTER 8500L /* 8 1/2" */ ASCIIYSIZELETTER 11000L /* 11" */

ASCIIXSIZELEGAL 8500L /* 8 1/2" */ ASCIIYSIZELEGAL 14000L /* 14" */

ASCIIXSIZEEXECUTIVE 7250L /* 7 1/4" */ ASCIIYSIZEEXECUTIVE 10500L /* 10 1/2" */

ASCIIXSIZEENVELOPE 4125L /* 4 1/8" */ ASCIIYSIZEENVELOPE 9500L /* 9 1/2" */

To get the page count for ASCII files, use IMGLOW_set_auto_detect(38) before getting the page count or decompressing.

Note: To get the page count for ASCII files, use CIMGLOW_set_auto_detect(38) before

233 Chapter 32 - ASCII Formats and Functions

getting the page count or decompressing. Please see CIMGLOW_set_auto_detect for more information,

Syntax

Please refer to Table 32-3 and the following example code to set standard page sizes:

Example 32.3 CIMGLOW_set_auto_detect

simage.CIMGLOW_set_auto_detect(38); asciiAttr = new CASCIITEXTATTR(); status = simage.CIMGLOW_get_ascii_attributes(asciiAttr); asciiAttr.asciiFlags = 0x1c3; asciiAttr.asciiPageWidth = 11000; asciiAttr.asciiPageHeight = 8300; asciiAttr.asciiLinesPerPage = 60; asciiAttr.asciiPointSize = 14; asciiAttr.asciiXDpi = 200; asciiAttr.asciiYDpi = 200; status = simage.CIMGLOW_set_ascii_attributes(asciiAttr); status = simage.CIMG_decompress_bitmap(fileName);

CIMG_import_ascii()

This function reads and converts ASCII data into a bitmap image. To use this function, you must turn on ASCII decompression using the CIMGLOW_set_auto_detect() function.

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)

Syntax

int SNBDAPI CIMG_import_ascii(String *filename, int page);

Remark

Table 32.4: CIMG_import_ascii Function Variables

Variable Description filename Path/filename of the ASCII file to convert page Page number to start at

234 Chapter 32 - ASCII Formats and Functions

Returns

Returns the standard library image handle. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix I for a list of error codes.

CIMGLOW_get_ascii_attributes()

This global function gets the current parameters for CIMG_import_ascii(). It allows you to get the font margins and other parameters when converting the ASCII data to a bitmap. See CIMG_import_ascii() for more information.

Syntax int SNBDAPI CIMGLOW_get_ascii_attributes(CASCIITEXTATTR *ascii);

Remark

Table 32.5: CIMGLOW_get_ascii_attributes Function Variable

Variable Description ascii Pointer to CASCIITEXTATTR structure

Returns

Returns the pointer to ASCIITEXTATTR structure. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

CIMGLOW_get_ascii_page_width()

This function calculates the minimum page width required to make a bitmap image from the given ASCII file.

Syntax long SNBDAPI CIMGLOW_get_ascii_page_width(String *filename);

Remark

Table 32.6: CIMGLOW_get_ascii_page_width Function Variable

Variable Description filename Path/filename of the ASCII file to convert

235 Chapter 32 - ASCII Formats and Functions

Returns

Returns the path/filename of the ASCII file to convert. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

CIMGLOW_set_ascii_attributes()

This global function sets the current parameters for CIMG_import_ascii(). It allows setting the font, margins, and other parameters when converting the ASCII data to a bitmap. See CIMG_import_ascii() for more information.

Syntax

int SNBDAP CIMGLOW_set_ascii_attributes(CASCIITEXTATTR *ascii);

Remark

Table 32.7: CIMGLOW_set_ascii_attributes Function Variable

Variable Description Pointer to CASCIITEXTATTR structure. For more infor- ascii mation, see public class CASCIITEXTATTR.

Returns

Returns the pointer to ASCIITEXTATTR structure. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

** GLOBAL FUNCTION**

236 Chapter 33 - Format For Decompressed Images

Chapter 33 - Format For Decompressed Images

This chapter describes the formats for decompressed images. All high-level and low-level func- tions which decompress or import images convert the data and store it in memory as the MS- Windows DIB format (Device Independent Bitmap).

The chapter contains the following topics:

Overview of Data Formats

All high-level and low-level functions that decompress or import images convert the data and store it in memory as the MS_Windows DIB (Device Independent Bitmap) format, which con- sists of the following:

l Header (DIB_Head)

l Palette

l Image data

All formats are converted to either 1, 4, 8, or 24-bits. All 1, 4, and 8-bit images have a palette. However, 24-bit images never have a palette. The raw uncompressed image data follows the palette specification.

RasterMaster Plus Options

For the RasterMaster plus options, 1-bit images are stored differently. The image format for 1- bit images is the normal DIB header, a palette consisting of 2 RGBQUAD structures, and then the compressed data. The image data is compressed and each raster is stored as a series of runs.

Each run is stored as a 32-bit integer. The first word is a byte count of the entire raster including the byte count word. This is followed by a white then black column. The line alternates from white to black until the end of the raster.

A line always starts with a white column. If the first pixel is black, the first white entry is then zero. The line must end with at least 3 entries for the horizontal width.

Example 33.1 RasterMaster Plus Options

For a raster of width 100.

WORD 0 - 12 Total byte count. WORD 1 - 5 White until pixel 5. WORD 2 - 10 Black from pixel 5 to pixel 10. WORD 3 - 100 White to end of raster.

237 Chapter 33 - Format For Decompressed Images

WORD 4 - 100 WORD 5 - 100

MS_Windows DIB Header Format

All images stored in memory start with the following header.

Example 33.2 MS_Windows DIB Header Format

typedef struct tagBITMAPINFOHEADER{

public int biSize; Size of this struc- ture, always 40. public int biWidth; Width of the image in pixels. public int biHeight; Height of the image in pixels. public short biPlanes; Always 1. (as per Microsoft) public short biBitCount; Bits per pixel 1,4, 8 or 24. public int biCompression; 0 or 99 for 1 bit runs images. public int biSizeImage; Height of the image X size of a raster in bytes. public int biXPelsPerMeter; Use this field to store dots per inch. public int biYPelsPerMeter; Use this field to store dots per inch. public int biClrUsed; Always set to 0. public int biClrImportant; Always set to 0. } BITMAPINFOHEADER;

Note: In RasterMaster V17.6, the pelsPerMeter attribute queries return the actual value con- tained in the attribute. In previous versions, the bi{X/Y}PelsPerMeter would return a default value of 100 if the value was not set in the image. This method resulted in there being no way to tell if RasterMaster was returning the default value or the actual value that was set. Beginning with RasterMaster V17.6, it will return the actual value even if it is 0. If you want to preserve the previous behavior, you can add a check to see if the bi {X/Y}pelsPerMeter attribute is valued at 0. If it is valued at 0, replace it with 100.

238 Chapter 33 - Format For Decompressed Images

MS_Windows DIB Palette Format

All images stored in memory except for 24-bit images have a series of the following RGBQUAD structures. An RGBQUAD structure exists for each possible color.

Table 33.1: MS_Windows DIB Palette Format

Image Size RGBQUAD Entries 1-bit 2 4 bit 16 8 bit 256 24-bit No Entries

All images stored in memory have the following palette format:

Example 33.3 RGBQUAD Entries

public class RGBQUAD { public byte rgbBlue; public byte rgbGreen; public byte rgbRed; public byte rgbReserved; {

MS_Windows DIB Image Data Format

1, 4, 8, and 24-bit images are stored as packed uncompressed raster data.

Table 33.2: MS_Windows DIB Image Data Format

Image Size Byte Size 1-bit 8 pixels 4-bit 2 pixels 8- bit 1 pixel 3 bytes equals 1 pixel, starting with the blue, green, then 24-bit red values

All rasters must end on a long or a multiple of 4 bytes. Extra bytes are added to rasters not meet- ing this criterion. They are stored with upside down or the last raster first up to the first or line 0.

239 Chapter 34 - Annotation and Redlining Toolkit

Chapter 34 - Annotation and Redlining Toolkit

This chapter describes the annotation and redlining toolkit and library.

The library is called from the developer’s application. Annotation objects are created through an interface and then stored in one or more annotation layers; each stored as a separate file. The annotation objects are registered with the underlying image permitting zooming and scrolling of the overall display without losing registration of the annotation information. The display of the underlying image can be managed through the use of Snowbound’s RasterMaster product or any other application or tool that displays images.

You can use annotations to create watermarks or redactions.

The chapter contains the following topics: public class CANN_GRAPHIC_STRUCT Structure

CSANN_activate_all_objects()

CSANN_activate_object()

CSANN_add_object()

CSANN_choose_color()

CSANN_choose_font()

CSANN_choose_line_style()

CSANN_choose_line_width()

CSANN_create_ann()

CSANN_deactivate_all_objects()

CSANN_deactivate_object()

CSANN_delete_all_objects()

CSANN_delete_object()

CSANN_display_annotations()

CSANN_draw_object()

CSANN_FlipX()

CSANN_FlipY()

CSANN_get_croprect()

CSANN_get_disprect()

240 Chapter 34 - Annotation and Redlining Toolkit

CSANN_get_object_bounds()

CSANN_get_object_data()

CSANN_get_object_info()

CSANN_get_object_num()

CSANN_highlight_object()

CSANN_map_image_to_wnd()

CSANN_map_wnd_to_image()

CSANN_mouse()

CSANN_move_object()

CSANN_print_annotations()

CSANN_read_ann()

CSANN_read_ann_FlexSnap()

CSANN_read_ann_mem()

CSANN_read_ann_mem_page()

CSANN_read_ann_page()

CSANN_resize_object()

CSANN_rotate()

CSANN_set_bcolor()

CSANN_set_croprect()

CSANN_set_disprect()

CSANN_set_fcolor()

CSANN_set_font()

CSANN_set_line_style()

CSANN_set_line_width()

CSANN_set_size()

CSANN_write_ann()

CSANN_write_ann_FlexSnap()

CSANN_write_ann_mem()

CSANN_write_ann_mem_page()

CSANN_write_ann_page()

241 Chapter 34 - Annotation and Redlining Toolkit

Annotation Constants public class CANN_GRAPHIC_STRUCT Structure

This structure represents an annotation object stored in its internal format within the Ras- terMaster Annotation SDK.

Structure

Below is the structure for the CANN_GRAPHIC_STRUCT function.

Example 34.1 CANN_GRAPHIC_STRUCT

public __gc class CANN_GRAPHIC_STRUCT { public CIMG_rect *rc; String *text; int data_size; String *font_name; int italic; int bold; int font_height; int fred; int fgreen; int fblue; int bred; int bgreen; int bblue; int width; int height; int bits_pix; int transp; int graphic_id; int line_width; int line_style; }

Variables

Table 34.1: CANN_GRAPHIC_STRUCT Class Variables

Variable Description CIMG_RECT rc Rectangle String text Byte array of text

242 Chapter 34 - Annotation and Redlining Toolkit

Variable Description Int data_size Size of data in bytes String font_name Name of font int italic Indicates italicized font int bold Indicates bold font int font_height Font height int fred Red plane of foreground color int fblue Blue plane of foreground color int fgreen Green plane of foreground int bred Red plane of background color int bblue Blue plane of background color int bgreen Green plane of background color int width Width of annotation object int height Height of annotation object int bits_pix Bits per pixel of image int transp Indicates transparency int graphic_id Annotation object type int line_width Line width int line_style Line style

CSANN_activate_all_objects()

This function is used on CSANN_EDIT and CSANN_POSTIT objects to allow editing of the text in the box. This makes the window active and usable. This call activates all objects on the page.

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 Annotation sample.

Notes: In this mode you cannot move or delete the object. You must call the CSANN_deactivate_object first.

Syntax

int SNBDAPI CSANN_activate_all_objects();

CSANN_activate_object()

This function is currently used on CSANN_EDIT and CSANN_POSTIT objects to allow editing of the text in the box. This makes the window active and usable.

243 Chapter 34 - Annotation and Redlining Toolkit

Notes: In this mode you cannot move or delete the object. You must call the CSANN_deactivate_object first.

Syntax int SNBDAPI CSANN_activate_object(int graphic_num);

Remark

Table 34.2: CSANN_activate_objectFunction Variables

Variable Description graphic_num The object to activate

CSANN_add_object()

This function adds a new object to the current annotation. Use data size, data for text, and free- hand annotations to point to the text of array of points for freehand annotations. The size must be in image coordinates. Use CSANN_map_wnd_to_image to convert from screen to image coordinates.

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 Annotation sample.

Syntax int SNBDAPI CSANN_add_object(int graphic_id, CIMG_RECT *imgRect, Array *data, int data_size);

Remark

Table 34.3: CSANN_add_object Function Variables

Variable Description graphic_id A unique number for each graphic object Pointer to rectangle defining outline of points for most imgRect graphics functions in the current images coordinates data Data for text, freehand annotations, and edits data_size The size in bytes for text, freehand, or edits

244 Chapter 34 - Annotation and Redlining Toolkit

CSANN_choose_color()

This function displays a dialog box suitable for selecting a color with which to draw. It returns the selected color in 3 bytes of red, green, and blue.

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

Syntax

int SNBDAPI CSANN_choose_color(int iColor);

Remark

Table 34.4: CSANN_choose_color Function Variable

Variable Description The selected color returned in 3 bytes order, red, green, iColor and blue.

CSANN_choose_font()

This function displays a dialog box for choosing the font type and height for the annotation. If the OK button is pressed, the current font height and name is set in the current annotation group.

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

Syntax

int SNBDAPI CSANN_choose_font();

CSANN_choose_line_style()

This function displays a dialog box for selecting and setting the current line style in the anno- tations.

245 Chapter 34 - Annotation and Redlining Toolkit

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

Syntax int SNBDAPI CSANN_choose_line_style(int *iLineStyle);

Remark

Table 34.5: CSANN_choose_line_style Function Variable

Variable Description iLineStyle Line style returned.

CSANN_choose_line_width()

This function displays a dialog box for selecting and setting the current line width in the anno- tations.

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

Syntax int SNBDAPI CSANN_choose_line_width(int *iLineWidth);

Remark

Table 34.6: CSANN_choose_line_width Function Variable

Variable Description iLineWidth Line width returned.

CSANN_create_ann()

This function creates a new annotation handle if it is not reading an annotation from a file.

246 Chapter 34 - Annotation and Redlining Toolkit

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

Syntax

int SNBDAPI CSANN_create_ann(Control *win_control, int width, int height);

Remark

Table 34.7: CSANN_create_ann Function Variables

Variable Description win_control Window form control object width Width in pixels of image to annotate height Height in pixels of image to annotate

CSANN_deactivate_all_objects()

This function is used on CSANN_EDIT and CSANN_POSTIT objects to stop the editing of text in the box. It makes the window inactive and now draws the object as any other data object. This call deactivates all objects on the page.

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 Annotation sample.

Notes: In this mode you can move or delete the object. You must call the CSANN_activate_object to edit the text.

Syntax

int SNBDAPI CSANN_deactivate_all_objects();

CSANN_deactivate_object()

This function is used on CSANN_EDIT and CSANN_POSTIT objects to stop the editing of text in the box. It makes the window inactive and draws the object as any other data object. In this mode, you can move or delete the object.

247 Chapter 34 - Annotation and Redlining Toolkit

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 Annotation sample.

Note: You must call the CSANN_activate_object to edit the text.

Syntax int SNBDAPI CSANN_deactivate_object(int graphic_num);

Remark

Table 34.8: CSANN_deactivate_object Function Variables

Variable Description graphic_num Specify the object to deactivate

CSANN_delete_all_objects()

This function deletes all graphics and memory associated with the annotations.

Syntax int SNBDAPI CSANN_delete_all_objects();

CSANN_delete_object()

This function deletes a graphic from the current list.

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 Annotation sample.

Syntax int SNBDAPI CSANN_delete_object(int graphic_num);

Remark

Table 34.9: CSANN_delete_object Function Variables

Variable Description This is an internal number for each graphic returned by CSANN_get_object_num. It is the number in a linked graphic_num list of graphics. Use this number after the call to CSANN_ get_object_number as CSANN_delete_object.

248 Chapter 34 - Annotation and Redlining Toolkit

Variable Description This may change the number of existing graphics.

CSANN_display_annotations()

This function displays the current annotation to the device context pointed by graphics. This function always assumes that the image is aspect ratio corrected into the coordinates xs, ys, xz, and yz.

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

Note: Before calling you may want to call CSANN_set_croprect to allow for zooming and scrolling.

Syntax

int SNBDAPI CSANN_display_annotations(Graphics *g, int xs, int ys, int xz, int yz);

Remark

Table 34.10: CSANN_display_annotations Function Variables

Variable Description g Graphics object xs Starting X position ys Starting Y position xz X size of window yz Y size of window

CSANN_draw_object()

This function draws the object (graphic_num) at the coordinates passed that are image coor- dinates.

Syntax

int SNBDAPI CSANN_draw_object(Graphics *g, int graphic_num, int xs, int ys, int xz, int yz);

249 Chapter 34 - Annotation and Redlining Toolkit

Remark

Table 34.11: CSANN_draw_object Function Variables

Variable Description g Graphics object graphic_num Specify the object to draw xs X position to start drawing ys Y position to start drawing xz X size to draw object yz Y size to draw object

CSANN_FlipX()

This function flips the current annotation objects horizontally.

Syntax int SNBDAPI CSANN_FlipX();

CSANN_FlipY()

This function flips the current annotation objects vertically.

Syntax int SNBDAPI CSANN_FlipY();

CSANN_get_croprect()

This function returns the annotations cropping area, which should be the same as the annotated images.

Syntax int SNBDAPI CSANN_get_croprect(int *xs, int *ys, int *xsize, int *ysize);

Remark

Table 34.12: CSANN_get_croprect Function Variables

Variable Description xs X starting coordinate to be returned ys Y starting coordinate to be returned xsize X crop rectangle size to be returned

250 Chapter 34 - Annotation and Redlining Toolkit

Variable Description ysize Y crop rectangle size to be returned

CSANN_get_disprect()

This function gets the annotation display rectangle in a client window. By default, the rectangle is the whole window area.

Syntax

int SNBDAPI CSANN_get_disprect(int *xs, int *ys, int *xe, int *ye);

Remark

Table 34.13: CSANN_get_disprect Function Variables

Variable Description xs Pointer of the left coordinate of display rectangle ys Pointer of the top coordinate of display rectangle xe Pointer of the right coordinate of display rectangle ye Pointer of the bottom coordinate of display rectangle

CSANN_get_object_bounds()

This function returns the bounding box of the object (graphic_num) in image pixel coor- dinates.

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 Annotation sample.

Syntax

int SNBDAPI CSANN_get_object_bounds(int graphic_num, CIMG_RECT *objRect);

Remark

Table 34.14: CSANN_get_object_bounds Function Variables

Variable Description graphic_num Specify the object to return the bounding box objRect Rectangle of bounding box

251 Chapter 34 - Annotation and Redlining Toolkit

CSANN_get_object_data()

This function returns the data of the object (graphic_num). The function returns the size of the data in bytes. This function is currently only implemented for CSANN_EDIT and CSANN_ POSTIT to return the text input into the object.

Syntax int SNBDAPI CSANN_get_object_data(int graphic_num, String *data- string);

Remark

Table 34.15: CSANN_get_object_dataFunction Variables

Variable Description graphic_num Specify the object from which to return data datastring String in which to put data

CSANN_get_object_info()

This function returns as instance of the CANN_GRAPHIC_STRUCT class, which is the internal wrapper for the object number passed in. This has information about the size, color, and object attributes.

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 Annotation sample.

Syntax

ANN_GRAPHIC_STRUCT CSANN_get_object_info(int graphic_num, CANN_ GRAPHIC_STRUCT* cannGraphic);

Remark

Table 34.16: CSANN_get_object_info Function Variables

Variable Description graphic_num Specify the object for which to return a structure pointer cannGraphic The graphic class pointer used to get the information

CSANN_get_object_num()

This function tries to find a graphic whose bounding box surrounds the points xpos and ypos. If the graphic is found, this function returns the graphic number usable by CSANN_delete_

252 Chapter 34 - Annotation and Redlining Toolkit

object and other 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 Annotation sample.

Syntax

int SNBDAPI CSANN_get_object_num(int Control *win_control, int xpos, int ypos, int* iGID);

Remark

Table 34.17: CSANN_get_object_numFunction Variables

Variable Description win_control Window form control object xpos X coordinate in the windows coordinates ypos Y coordinate in the windows coordinates iGID The Graphic ID returned

CSANN_highlight_object()

This function highlights the bound box of the graphic specified by graphic_num. This number is found by CSANN_get_object_num.

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 Annotation sample.

Syntax

int SNBDAPI CSANN_highlight_object(Control *win_control, int graphic_num);

Remark

Table 34.18: CSANN_highlight_object Function Variables

Variable Description win_control Window form control object graphic_num Graphic to highlight

CSANN_map_image_to_wnd()

This function converts the internal graphics coordinates relative to the image coordinates rel- ative to the current window.

253 Chapter 34 - Annotation and Redlining Toolkit

Syntax int SNBDAPI CSANN_map_image_to_wnd(CIMG_RECT *imgRect, int *xs, int *ys);

Remark

Table 34.19: CSANN_map_image_to_wnd Function Variables

Variable Description imgRect Displays current rectangle xs Set the X coordinate to convert ys Set the Y coordinate to convert

CSANN_map_wnd_to_image()

This function converts the window coordinates to the current annotated image coordinates.

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 Annotation sample.

Syntax int SNBDAPI CSANN_map_wnd_to_image(CIMG_RECT *imgRect, int *xpos, int *ypos);

Remark

Table 34.20: CSANN_map_wnd_to_image Function Variables

Variable Description imgRect Displays current rectangle xpos Set the X coordinate to convert ypos Set the Y coordinate to convert

CSANN_mouse()

This function is part of the annotation toolkit user interface handling routines. It handles the user interface for adding, deleting, and moving annotations and puts it into the main windows mes- saging handling loop.

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 Annaction sample.

254 Chapter 34 - Annotation and Redlining Toolkit

Notes: Not necessary to call. You may do your own user interface with all of the above calls.

Syntax

int SNBDAPI CSANN_mouse(Control *win_control, Graphics *g, ing msg, int wParam, int lParam, int *graphic_id, String *strBuffer);

Remark

Table 34.21: CSANN_mouse Function Variables

Variable Description win_control Window form control object g Graphics object msg Window handling function message parameter wParam Window handling function wParam parameter lParam Window handling function lParam parameter graphic_id Current graphic id to add Extra data to add to EDIT or POSTIT objects or name of strBuffer bitmap to import

CSANN_move_object()

This function moves or resizes the object graphic_num. Use the rectangle passed in as objRect.

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 Annotation sample.

Syntax

int SNBDAPI CSANN_move_object(IMG_RECT *objRect, int graphic_num);

Remark

Table 34-22 lists the CSANN_move_object function variable descriptions.

Table 34-22: CSANN_move_object Function Variables

Variable Description objRect Rectangle for new object position and size graphic_num Specify the object to move

255 Chapter 34 - Annotation and Redlining Toolkit

CSANN_print_annotations()

This function prints the current annotation to the device context pointed by the graphics object. It always assumes that the image is aspect ratio corrected into the coordinates xs, ys, xz, and yz.

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 Annotation sample.

Syntax int SNBDAPI CSANN_print_annotations(Graphics *g, int xs, int ys, int xz, int yz);

Remarks

Table 34.22: CSANN_print_annotations Function Variables

Variable Description g Graphics object xs Starting X position ys Starting Y position xz X size of window yz Y size of window

CSANN_read_ann()

This function reads an annotation file from disk and returns a handle to it. You do not need to call CSANN_create_ann if you call this function.

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

Syntax int SNBDAPI CSANN_read_ann(Control *win_control, String *filename);

Remark

Table 34.23: CSANN_read_ann Function Variables

256 Chapter 34 - Annotation and Redlining Toolkit

Variable Description win_control Window form control object filename Refers to the name of the file in which to read

CSANN_read_ann_FlexSnap()

This function reads the annotation from Snowbound’s FlexSnap server.

Syntax

int SNBDAPI CSANN_read_ann_FlexSnap(Array *data, String *strServer, String *StrFileName);

Remark

Table 34.24: CSANN_read_ann_FlexSnap Function Variables

Variable Description data Memory pointer to return annotation data strServer FlexSnap server URL address strFileName Image file name the annotation is associated with

CSANN_read_ann_mem()

This function reads the first page of an annotation from memory and returns a handle to it.

Syntax

int SNBDAPI CSANN_read_ann_mem(Control *win_control, Array *data);

Remark

Table 34.25: CSANN_read_ann_mem Function Variables

Variable Description win_control Window form control object data Memory pointer to compress image data

CSANN_read_ann_mem_page()

This function reads the first page of an annotation from memory and returns a handle to it.

Syntax

int SNBDAPI CSANN_read_ann_mem_page(Control *win_control, Array *data, int page);

257 Chapter 34 - Annotation and Redlining Toolkit

Remark

Table 34.26: CSANN_read_ann_mem_page Function Variables

Variable Description win_control Window form control object data Memory pointer to compress image data page Desired page number starting at zero

CSANN_read_ann_page()

This function reads an annotation file from disk and returns a handle to it.

Syntax int SNBDAPI CSANN_read_ann_page(Control *win_control, String *fil- ename, int page);

Remark

Table 34.27: CSANN_read_ann_page Function Variables

Variable Description win_control Window form control object filename Refers to the name of the file in which to read page Desired page number starting at zero

CSANN_resize_object()

This function resizes an annotation object specified by the ID. The new size is specified in the CIMG_RECT 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 Annotation sample.

Syntax int SNBDAPI CSANN_resize_object(CIMG_RECT *objRect, int graphic_ num);

Remark

Table 34.28: CSANN_resize_object Function Variables

258 Chapter 34 - Annotation and Redlining Toolkit

Variable Description objRect Rectangle for new object position to resize graphic_num The ID of the object to resize

CSANN_rotate()

This function rotates all annotations in the current handle by the specified angle: 90, 180, or 270 degrees.

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 Annotation sample.

Syntax

int SNBDAPI CSANN_rotate(int angle);

Remark

Table 34.29: CSANN_rotate Function Variables

Variable Description angle Angle by which to rotate the annotation

CSANN_set_bcolor()

This function sets the current background drawing color for all graphics. Currently only used by the text graphic.

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

Syntax

int SNBDAPI CSANN_set_bcolor(int iRed, int iGreen, int iBlue);

Remark

Table 34.30: CSANN_set_bcolor Function Variables

Variable Description iRed Red value 0 - 255

259 Chapter 34 - Annotation and Redlining Toolkit

Variable Description iGreen Green value 0 - 255 iBlue Blue value 0 - 255

CSANN_set_croprect()

This function allows proper zooming, panning, and scrolling for annotations. The annotation toolkit needs to know the images’ current cropping rectangle to work properly.

Syntax int SNBDAPI CSANN_set_croprect(int xs, int ys, int xsize, int ysize);

Remarks

Table 34.31: CSANN_set_croprect Function Variables

Variable Description xs Set the X starting coordinate ys Set the Y starting coordinate xsize Set the X crop rectangle size ysize Set the Y crop rectangle size

CSANN_set_disprect()

This function sets the annotation display rectangle in a client window. By default, the rectangle is the whole window area. This function is used by CSANN_mouse to get the correct image dis- play area.

Syntax int SNBDAPI CSANN_set_disprect(int xs, int ys, int xe, int ye);

Remarks

Table 34.32: CSANN_set_disprect Function Variables

Variable Description xs Left coordinate of display rectangle ys Top coordinate of display rectangle xe Right coordinate of display rectangle ye Bottom coordinate of display rectangle

CSANN_set_fcolor()

This function sets the current foreground drawing color for all graphics.

260 Chapter 34 - Annotation and Redlining Toolkit

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

Syntax

int SNBDAPI CSANN_set_fcolor(int iRed, int iGreen, int iBlue);

Remark

Table 34.33: CSANN_set_fcolor Function Variables

Variable Description iRed Red value 0 - 255 iGreen Green value 0 - 255 iBlue Blue value 0 - 255

CSANN_set_font()

This function sets the current type of font to use. It uses the values returned from the CHOOS- EFONT common dialog box LOGFONT data structure.

Syntax

int SNBDAPI CSANN_set_font(String *fontname, int italic, int bold, int font_height);

Remark

Table 34.34: CSANN_set_font Function Variables

Variable Description fontname Name of font to use italic Use an italic font bold Use a bold font font_height Size of the font to use

CSANN_set_line_style()

This function sets current line style for lines, ellipses, rectangles, and freehand drawings.

261 Chapter 34 - Annotation and Redlining Toolkit

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

Syntax int SNBDAPI CSANN_set_line_style(int style);

Remark

Table 34.35: CSANN_set_line_style Function Variables

Variable Description Line drawing style. Currently, the RasterNote® Snow- bound Annotation Toolkit supports the following line styles: style PS_DASH 1 PS_DASHDOT 3 PS_DASHDOTDOT 4 PS_DOT 2 PS_SOLID 0

CSANN_set_line_width()

This function sets current line width for lines, ellipses, rectangles, and freehand drawings.

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

Syntax int SNBDAPI CSANN_set_line_width(int width);

Remark

Table 34.36: CSANN_set_line_width Function Variables

262 Chapter 34 - Annotation and Redlining Toolkit

Variable Description width Width of lines in pixels

CSANN_set_size()

This function sets the height and width of the current image being annotated. The internal for- mat for Snowbound annotations contains this information.

When reading in other annotation file formats, you need to call this function to set the height and width of the current annotation image being annotated after reading in the annotation file.

Syntax

int SNBDAPI CSANN_set_size(int width, int height);

Remark

Table 34.37: CSANN_set_size Function Variables

Variable Description width Width of current image being annotated height Height of current image being annotated

CSANN_write_ann()

This function writes out annotations to disk file. The extra_size and extra_data variables allow the embedding of other data into the file such as company name, data, or other elements one would like to put into the file.

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

Syntax

int SNBDAPI CSANN_write_ann(String *filename, int extra_size, Array *extra_data);

Remark

Table 34.38: CSANN_write_ann Function Variables

263 Chapter 34 - Annotation and Redlining Toolkit

Variable Description filename Pathname or file to write extra_size Size of extra data to write after the first header extra_data Pointer to extra data to write

CSANN_write_ann_FlexSnap()

This function writes out annotations to Snowbound’s FlexSnap server. The extra_size and extra_data variables allow the embedding of other data into the file such as company name, data, or other elements one would like to put into the annotation.

Syntax int SNBDAPI CSANN_write_ann_FlexSnap(Array *arrAnnData, int iAnn- DataLen, String *strServer, String *strFileName);

Remark

Table 34.39: CSANN_write_ann_FlexSnap Function Variables

Variable Description strAnnData Memory pointer to annotation data iAnnDataLen Size of annotation data strServer FlexSnap server URL address strFileName Image file name

CSANN_write_ann_mem()

This function writes out current annotations to memory. The extra_size and extra_data variables allow the embedding of other data into the file such as company name, data, or other elements one would like to put into the annotation.

Syntax int SNBDAPI CSANN_write_ann_mem(Array *data, int extra_size, Array *extra_data);

Remark

Table 34.40: CSANN_write_ann_mem Function Variables

Variable Description Array *data Pathname or file to write extra_data Pointer to extra data to write extra_size Size of extra data to write after the first header

264 Chapter 34 - Annotation and Redlining Toolkit

CSANN_write_ann_mem_page()

This function writes out a page of annotations to disk file. The extra_size and extra_data variables allow the embedding of other data into the file such as company name, data, or other elements one would like to put into the file.

Syntax

int SNBDAPI CSANN_write_ann_mem_page(Array *data, int extra_size, Array *extra_data, int page);

Remark

Table 34.41: CSANN_write_ann_mem_page Function Variables

Variable Description data Memory pointer to annotation data extra_size Size of extra data to write after the first header extra_data Pointer to extra data to write page Page number starting at zero

CSANN_write_ann_page()

This function writes out annotations to disk file. The extra_size and extra_data variables allow the embedding of other data into the file such as company name, data, or other elements one would like to put into the file.

Syntax

int SNBDAPI CSANN_write_ann_page(String *filename, int extra_size, Array *extra_data, int page);

Remark

Table 34.42: CSANN_write_ann_page Function Variables

Variable Description filename Pathname or file to write extra_size Size of extra data to write after the first header extra_data Pointer to extra data to write page Page number starting at zero

Annotation Constants

Table 34.43: Annotation Constants

265 Chapter 34 - Annotation and Redlining Toolkit

The annotation and redlining toolkit also comes with pre-determined annotation constants. They are as follows:

Annotation Constant CSANN_FILLED_RECT 1 CSANN_HIGHLIGHTED_RECT 2 CSANN_RECTANGLE 3 CSANN_LINE 4 CSANN_ELLIPSE 5 CSANN_FILLED_ELLIPSE 6 CSANN_FREEHAND 7 CSANN_BITMAP 8 CSANN_POSTIT 9 CSANN_POLYGON 10 CSANN_FILLED_POLYGON 11 CSANN_ARROW 12 CSANN_EDIT 13

266 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

This chapter describes the RasterMaster .NET Imaging SDK WPF and Microsoft .NET Frame- work 4.0 supported functions.

Microsoft’s .NET Framework 4.0 provides the Windows Presentation Foundation (WPF) con- trols and tools. Microsoft .NET also provides support for XML Paper Specification (XPS) doc- uments. RasterMaster .NET provides functions and samples to enable you to use RasterMaster’s powerful features with:

l WPF System::Windows::Media::Visual control - the hub of all drawing related activity in WPF.

l BitmapSource to use RasterMaster images in an Image control.

l XPS documents in memory or in a file.

You will need to use the .NET 4.0 build of the SbdNetAnn library in order to use the meth- ods and samples described in this chapter. The .NET 4.0 build is included with the Ras- terMaster .NET SDK.

The Samples directory in RasterMaster .NET has a WPF subdirectory that includes the fol- lowing samples:

l Document and Image Conversion with WPF controls

l Annotation with WPF controls

l Scanning in images with WPF controls

l WPF image

l XPS document in memory

l XPS document batch conversion

This chapter contains the following topics:

Working with .NET Bitmapsource for the WPF Image Control

Annotating with .NET WPF controls

Working with XML Paper Specification (XPS) Documents

267 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Working with .NET Bitmapsource for the WPF Image Control

CIMG_create_bitmapsource_class()

This function converts the Snowbound object to the BitmapSource object. It is used to support WPF.

Syntax

BitmapSource* CIMG_create_bitmapsource_class(int width, int height);

Remark

Table 35.1: CIMG_create_bitmapsource_class Function Variable

Variable Description width Image width of the created object. height Image height of the created object.

Returns

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

CIMG_create_bitmapsource_class()

This function converts the Snowbound object to the BitmapSource object. It is used to support WPF.

Syntax

BitmapSource* CIMG_create_bitmapsource_class(int width, int height, int dpi);

Remark

Table 35.2: CIMG_create_bitmapsource_class Function Variable

Variable Description width Image width of the created object. height Image height of the created object. dpi DPI of the created object.

268 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

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

CIMG_create_bitmapsource_annotation()

This function creates the BitmapSource WPF object from the current Snowbound object and annotation. It is used to support WPF.

Syntax

BitmapSource* CIMG_create_bitmapsource_annotation(int width, int height);

Remark

Table 35.3: CIMG_create_bitmapsource_annotation Function Variables

Variable Description width Image width of the created object. height Image height of the created object.

Returns

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

CIMG_scan_acquire_WPF()

This TWAIN scanning routine scans a single page image from a scanner. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax int SNBDAPI CIMG_scan_acquire_WPF(System::Windows::Media::Visual *visual, int iShowUI);

Remark

Table 35.4: CIMG_scan_acquire_WPF Function Variables

Variable Description WPF rendering class System::Windows::Media::Visual visual object. iShowUI On/Off display of the Twain UI Dialog box.

269 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Variable Description 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

Returns

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

CIMG_scan_acquire_feeder_WPF()

This TWAIN scanning routine allows scanning from a scanner with an automatic document feeder. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax

int SNBDAPI CIMG_scan_acquire_feeder_WPF(::Windows::Media::Visual *visual, int iShowUI);

Remark

Table 35.5: CIMG_scan_acquire_feeder_WPF Function Variables

Variable Description WPF rendering class System::Windows::Media::Visual visual object. On/Off display of the Twain UI Dialog box.

iShowUI 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

Returns

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

CIMG_scan_acquire_feeder_fast_WPF()

This TWAIN scanning routine allows for new fast memory transfer scanning. A parameter can also be set to duplex scanning if your scanner supports it. It is used to support WPF.

Syntax

int SNBDAPI CIMG_scan_acquire_feeder__fast_WPF(Sys- tem::Windows::Media::Visual *visual, int iShowUI, int iDuplex);

270 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Remark

Table 35.6: CIMG_scan_acquire_feeder_fast_WPF Function Variables

Variable Description WPF rendering class System::Windows::Media::Visual visual object. On/Off display of the Twain UI Dialog box. iShowUI 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box Sets duplex scanning mode. iDuplex 1 = set duplex scanning mode.

Returns

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

CIMG_scan_open_source_WPF()

This TWAIN scanning routine displays a dialog box for selecting the available Twain drivers. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax int SNBDAPI CIMG_scan_open_source_WPF(Sys- tem::Windows::Media::Visual *visual);

Remark

Table 35.7: CIMG_scan_open_source_WPF Function Variable

Variable Description System::Windows::Media::Visual class for WPF ren- visual dering.

Returns

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

CIMG_scan_pages_fast_WPF()

This function allows for new fast memory transfer scanning. A parameter can also be set to allow duplex scanning if your scanner driver supports it. It is used to support WPF.

271 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Syntax

int SNBDAPI CIMG_scan_pages_fast_WPF(System::Windows::Media::Visual *visual, String *strFileName, int iFileType, int iShowUI, int iDu- plex);

Remark

Table 35.8: CIMG_scan_pages_fast_WPF Function Variable

Variable Description WPF rendering support System::Windows::Media::Visual visual class. strFileName The output file name to create as a scanned image. Saves the file type. See Appendix B for file type formats in iFileType which to save compressed images. On/Off display of the Twain UI Dialog box.

iShowUI 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box Sets duplex scanning mode. iDuplex 1 = set duplex scanning mode.

Returns

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

CIMG_scan_pages_WPF()

This TWAIN scanning routine scans all pages from the currently selected scanner or TWAIN drivers and saves them to the path/filename specified by the filename in the image format file type. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax

int SNBDAPI CIMG_scan_pages_WPF(System::Windows::Media::Visual *vi- sual, String *strFileName, int iFileType, int iShowUI);

Remark

Table 35.9: CIMG_scan_pages_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class.

272 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Variable Description strFileName The output file name to create as a scanned image. Saves the file type. See Appendix B for file type formats in iFileType which to save compressed images. On/Off display of the Twain UI Dialog box. iShowUI 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box

Returns

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

CIMG_scan_get_cap_WPF()

This function TWAIN scanning routine returns the value of the current specified TWAIN capabil- ity. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax int SNBDAPI CIMG_scan_get_cap_WPF(System::Windows::Media::Visual *visual, int cap, int value);

Remark

Table 35.10: CIMG_scan_get_cap_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. cap The current TWAIN capability to retrieve.

Returns

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

CIMG_scan_set_cap_WPF()

This function TWAIN scanning routine sets the value of the specified TWAIN capability. It is used to support WPF.

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 WPFScanning_CSHARP sample.

273 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Syntax

int SNBDAPI CIMG_scan_set_cap_WPF(System::Windows::Media::Visual *visual, int cap, int value);

Remark

Table 35.11: CIMG_scan_set_cap_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. cap The current TWAIN capability to set. value New setting for TWAIN capability.

Returns

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

CIMG_scan_setup_WPF()

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 scan- ning occurs unless one of the other scan acquiring functions are called. It is used to support WPF.

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 WPFScanning_CSHARP sample.

Syntax

int SNBDAPI CIMG_scan_setup_WPF(System::Windows::Media::Visual *vi- sual);

Remark

CIMG_scan_setup_WPF Function Variable

Variable Description WPF rendering support System::Windows::Media::Visual visual class.

Returns

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

274 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Annotating with .NET WPF controls

CSANN_create_ann_WPF()

This function creates a new annotation handle if it is not reading an annotation from a file. It is used to support WPF.

Syntax int SNBDAPI CSANN_create_ann_WPF(System::Windows::Media::Visual *vi- sual, int width, int height);

Remark

Table 35.12: CSANN_create_ann_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. width Width in pixels of image to annotate height Height in pixels of image to annotate.

Returns

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

CSANN_get_object_num_WPF()

This function tries to find a graphic whose bounding box surrounds the points xpos and ypos. If the graphic is found, this function returns the graphic id usable by CSANN_delete_object() and other functions. It is used to support WPF.

Syntax int SNBDAPI CSANN_get_object_num_WPF(System::Windows::Media::Visual *visual, int xpos, int ypos, Int32* iGID);

Remark

Table 35.13: CSANN_get_object_num_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. xpos X coordinate in the windows coordinates. ypos Y coordinate in the windows coordinates. iGID The Graphic ID returned

275 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

Returns the graphic id. A value of 0 indicates success. Any value less than zero is a Snow- bound error code. See Appendix H - Error Codes for a list of error codes.

CSANN_highlight_object_WPF()

This function highlights the bound box of the graphic specified by graphic_num. This graphic id number is found by CIMG_decompress_bitmap_xps_mem(). It is used to support WPF.

Syntax

int SNBDAPI CSANN_highlight_object_WPF(Sys- tem::Windows::Media::Visual *visual, int graphic_num);

Remark

Table 35.14: CSANN_highlight_object_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. graphic_num Graphic object id to highlight

Returns

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

CSANN_read_ann_WPF()

This function reads an annotation file from disk and returns a handle to it. You do not need to call CIMG_decompress_bitmap_xps_mem() if you call this function. It is used to support WPF.

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 WPFScanning_CSHARP sample

Syntax

int SNBDAPI CSANN_read_ann_WPF(System::Windows::Media::Visual *vi- sual, String *filename);

Remark

Table 35.15: CSANN_read_ann_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. filename Refers to the name of the file in which to read.

276 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

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

CSANN_read_ann_page_WPF()

This function reads an annotation file from disk and returns a handle to it. It is used to support WPF.

Syntax int SNBDAPI CSANN_read_ann_page_WPF(System::Windows::Media::Visual *visual, String *filename, int page);

Remark

Table 35.16: CSANN_read_ann_page_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. filename Refers to the name of the file in which to read. page Desired page number starting at zero

Returns

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

CSANN_read_ann_mem_page_WPF()

This function reads the first page of an annotation from memory and returns a handle to it. It is used to support WPF.

Syntax int SNBDAPI CSANN_read_ann_mem_page_WPF(Sys- tem::Windows::Media::Visual *visual, Array *data, int page);

Remark

Table 35.17: CSANN_read_ann_mem_page_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. data Memory pointer to compress image data. page Desired page number starting at zero.

277 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

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

CSANN_read_ann_mem_WPF()

This function reads the first page of an annotation from memory and returns a handle to it. It is used to support WPF.

Syntax

int SNBDAPI CSANN_read_ann_mem_WPF(System::Windows::Media::Visual *visual, Array *data);

Remark

Table 35.18: CSANN_read_ann_mem_WPF Function Variables

Variable Description WPF rendering support System::Windows::Media::Visual visual class. data Memory pointer to compress image data.

Returns

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

Working with XML Paper Specification (XPS) Documents

CIMG_get_pages_xps()

This function returns the number of pages for the XPS file format.

Syntax

int SNBDAPI CIMG_get_pages_xps(String *strDocName);

Remark

Table 35.19: CIMG_get_pages_xps Function Variable

Variable Description strDocName The path/filename of the image to return page information.

278 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

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

CIMG_get_pages_xps_mem()

This function returns the number of pages in the pointer passed as the first argument for the XPS file 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:

Batch_XPS_Convert

XPSMem_CSHARP

Syntax int SNBDAPI CIMG_get_pages_xps_mem(Array* data);

Remark

Table 35.20: CIMG_get_pages_xps_mem Function Variable

Variable Description data Pointer to image in memory.

Returns

Returns the number of pages from an XPS document stored in the pointer passed as the first argument. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

CIMG_decompress_bitmap_xps()

The function decompresses and loads an XPS file.

Syntax int SNBDAPI CIMG_decompress_bitmap_xps(String *strDocName, int iPage);

Remark

Table 35.21: CIMG_decompress_bitmap_xps Function Variables

Variable Description strDocName The path/filename of the XPS file. iPage The page index of the XPS document to render.

279 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions

Returns

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

CIMG_decompress_bitmap_xps_mem()

The function decompresses and loads an XPS file from 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:

Batch_XPS_Convert

XPSMem_CSHARP

Syntax

int SNBDAPI CIMG_decompress_bitmap_xps_mem(Array *data, int iPage);

Remark

Table 35.22: CIMG_decompress_bitmap_xps_mem Function Variables

Variable Description data Pointer to image in memory. The page index of the XPS document to render. starting iPage from 0.

Returns

Returns the status of the decompress XPS document stored in the pointer passed as the first argument. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes.

280 Chapter 36 - Working with PDF and Other Document File Formats

Chapter 36 - Working with PDF and Other Document File Formats

This chapter describes how to work with PDF and other document file formats in Snowbound Software’s RasterMaster Imaging SDK products. The chapter contains the following topics:

Working with Document File Formats

Snowbound Software supports many document file formats in most of its viewing, converting, and RasterMaster SDK products.

The supported file formats include:

l PDF - Adobe portable file

l PCL - Hewlett Packard printer format

l DOC - Microsoft Word processor format

l XLS - Microsoft Excel spreadsheet format

l PPT - Microsoft PowerPoint presentation format

l RTF - Rich text file format

l AFP and MODCA - IBM advanced printing format

These like any other file formats supported by Snowbound Software’s products are read in using a call such as CIMG_decompress_bitmap(). For ActiveX, use the Image property. Snowbound Software’s products auto-detect the file format so there is no need to specify which format you are reading. You do not even need a specific extension.

These formats contain graphics commands such as line and text drawing. This differs from bit- map formats that are a 2-dimensional array of bytes forming a picture. Normally, documents are drawn or “rendered” to a bitmap in RasterMaster, but RasterMaster can also produce search- able text documents.

The rendering size for the bitmap can be set by the following call to our library: CIMGLOW_set_document(int dpi, int bits_pix, int format);

Table 36.1: CIMGLOW_set_document Function Variables

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

281 Chapter 36 - Working with PDF and Other Document File Formats

Saving

This 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 bit- map or searchable text.

You can specify the output size with PDF using the following call: CIMGLOW_set_pdf_output(int width, int height);

Table 36.2: CIMGLOW_set_pdf_output Function Variables

Variable Description width Width of image in points height Height of image in points

Reading and Writing Support for PDF File Formats

Reading and writing support for PDF formats is included in the following RasterMaster Imaging SDK products:

l RasterMaster Imaging SDK for Windows DLL

l RasterMaster Imaging SDK for ActiveX

l RasterMaster Imaging SDK for .NET

l RasterMaster Imaging SDK for the Java™ Platform

Currently, Snowbound Software does not provide PDF reading support in UNIX and Macintosh products. Snowbound Software does provide PDF writing support for its UNIX and Macintosh products.

PDF reading is available as a separate option. For the RasterMaster Imaging SDK for Java, a special PDF version is available. For the other RasterMaster products, the pdfplug.dll file is required for PDF reading support. This file must be included in the same directory as the Acti- veX, .NET library, or RasterMaster DLL. You can also include the file in the following directory: \Windows\system.

Reading or Decompressing a PDF Document

To read in or decompress a PDF document, use any of the decompression calls such as CIMG_decompress_bitmap(). For ActiveX, use the Image property. All RasterMaster Imaging SDK products automatically detect the file format and do not use the extension on the file name.

The default size for decompressing PDF documents is 200 dots per inch (DPI) and 24 bits per pixel. To alter this or to convert PDF files, you can call the CIMGLOW_set_pdf_input(dpi,

282 Chapter 36 - Working with PDF and Other Document File Formats dots_per_inch) function. For RasterMaster Imaging SDK for ActiveX, call the PdfDpi and PdfBitsPerPixel properties.

Saving to a PDF Document

All RasterMaster Imaging SDK products support writing PDF files. There are two types of PDF files; raster and vector PDF. Both types of files use the same file format id. The type of file that is saved depends on the RasterMaster methods used to create the output document.

Raster PDF contains a snapshot image of each page. The input resolution (DPI) from CIM- GLOW_set_document affects the quality of the page image. To create a raster PDF read the input document in using CIMG_decompress_bitmap. This supports reading in almost all doc- ument formats. Save to PDF using IMG_save_bitmap with a format id of 59 (or using the more descriptive CIMG_FORMAT_HASH.getFormatCode("PDF")). The Conversion_CSHARP sample can be used to create a raster PDF document from almost any supported input doc- ument.

Vector PDF contains searchable text, graphics and images on each page. This type of PDF does not have a resolution DPI so the document can be zoomed and remain high quality. The input document must contain searchable text in order for the output document to contain search- able text. To create a vector PDF, read the input document in using CIMGLOW_extract_text, then save the document using CIMG_save_document with the file format set to 59.

Working with Black and White Images

If you are working with black and white documents, you will save a lot of memory and increase performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading PDF images. For 1-bit or black and white images, RasterMaster will write out or save a PDF with CCITT - G4 compression for black and white images.

Working with Color Images

For color bitmaps, a PDF will be created with JPEG compression.

Changing Output Page Size

The default page size is set to 8.5 x 11. The bitmap image saved is centered at this page. To alter the output page size use the call CIMGLOW_set_pdf_output. For RasterMaster Imag- ing SDK for ActiveX, use the PdfXPageSize and PdfYPageSize properties. The xsize and ysize parameters are the page size in points or 1/72 of an inch.

Performance

If you are working with black and white documents, you will save a lot of memory and increase performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading all doc- ument formats.

283 Appendix A - Classes and Support Values

Appendix A - Classes and Support Values

This appendix describes the classes and support values for the RasterMaster .NET Imaging SDK. The chapter contains the following topics:

Type Property Define Values

General Error Define Values Retrieved from Status Property public class CIMG_RECT public class CIMG_SEARCH_RESULT public class CASCIITEXTATTR public class CSEARCH_TEXT public class CDIB_HEADER public class CTIFF_TAG public class CSNBDTILESTRUCT

Type Property Define Values

Table A.1: Type Property Define Values

Value Description Zoom value will preserve aspect and every unit will increase or ZOOM_ASPECT.ASPECT_DEFAULT = 0 decrease image by that amount (1- 1)% Preserves aspect ratio regardless ZOOM_ASPECT.ASPECT_PRESERVE = 1 of zoom value Fit image to width regardless of ZOOM_ASPECT.ASPECT_FIT_TO_WIDTH = 2 zoom value Fit image to height regardless of ZOOM_ASPECT.ASPECT_FIT_TO_HEIGHT = 3 zoom value Fit one pixel to one pixel regard- ZOOM_ASPECT.ASPECT_ONE_TO_ONE = 4 less of zoom value 0 is equal to one to one. 100 is equal to 100% zoom or 1 pixel will be displaying in the view area. Use ZOOM_ASPECT.ASPECT_ZOOM = 5 calcAspectZoom(view,zoom, ASPECT_..PRESERVE/FIT_TO_ WIDTH) to return the zoom value of that particular tag and to pass to

284 Appendix A - Classes and Support Values

Value Description display with the ASPECT_ZOOM type.

General Error Define Values Retrieved from Status Prop- erty

Note: Older error define values are retrieved from the StatusDetails Property.

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

Value Description If an internal exception is GENERAL_STATUS.SYSTEM_CRASH = -100 thrown, this is the resulting value. GENERAL_STATUS.DELETE_ERROR = -101 Image data of the object failed What the internal values are ini- GENERAL_STATUS.DEFAULT = -102 tially set to Operation completed suc- GENERAL_STATUS.SNOWBND_OK = 1 cessfully Operation failed. See Stat- GENERAL_STATUS.SNOWBND_ERROR = -1 usDetails property. Internal image data available GENERAL_STATUS.IMAGE_NOT_AVAILABLE = -103 when trying to complete an operation GENERAL_STATUS.SNOWBND_API_NOT_ API is not implemented AVAILABLE = -104 GENERAL_STATUS.NOT_VALID = -105 Parameter is not valid GENERAL_STATUS.DISPLAY_ERROR = -106 General error display

public class CIMG_RECT

Syntax

public class CIMG_RECT { public: CIMG_RECT(){}; CIMG_RECT(double inleft, double intop, double inright,double inbottom); double left;

285 Appendix A - Classes and Support Values

double top; double right; double bottom; };

Remark

Table A.3: public class CIMG_RECT Variables

Variable Description double left Left most position double top Top most position double right Width=right-left double bottom Height=bottom-top public class CIMG_SEARCH_RESULT

Syntax public __gc class CIMG_SEARCH_RESULT { public: CIMG_SEARCH_RESULT() { iInstance = 0; pSnbdRect = 0; }; String *before; String *after; int iInstance; CIMG_RECT* pSnbdRect; };

Remark

Table A.4: public class CIMG_SEARCH_RESULT Variables

Variable Desription before String. Reserved, not used now. after String. Reserved, not used now. iInstance Occurrence of search string to find, start from 0. pSnbdRect Rectangle point to the text string position found.

286 Appendix A - Classes and Support Values

public class CASCIITEXTATTR

Syntax

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 A.5: public class CASCIITEXTATTR Variables

Variable Description int asciiFlags Determines which fields to use int asciiXDpi Horizontal dots per inch int asciiYDpi Vertical dots per inch CIMG_RECT *asciiMargin Margins in 1/1000 inches int asciiTabStop Number of characters between tab stops int asciiPageWidth Width of page in 1/1000 inches int asciiPageHeight Height of page in 1/1000 inches int asciiPointSize Point size of the font int asciiCharsPerLIne Number of characters per line int asciiLinesPerPage Number of lines per page int asciiWeight Normal=0, Bold=1 int asciiItalic Normal=0, Italic=1 String *asciiTypeFace Name of the font to use

287 Appendix A - Classes and Support Values public class CSEARCH_TEXT

Syntax public class CSEARCH_TEXT { public: String *search_string; bool populate_location_rect; int count; CIMG_RECT *location_rect; }; public class CDIB_HEADER

Syntax public class CDIB_HEADER { public: int biSize; int biWidth; int biHeight; signed short biPlanes; signed short biBitCount; int biCompression; int SizeImage; int biXPelsPerMeter; int biYPelsPerMeter; int biClrUsed; int biClrImportant; };

Note: If an image’s resolution is not explicitly set, the resolution is now specified as 0 dots per inch (DPI). In older versions, it was set as 100 DPI. To avoid errors or unexpected behavior, set the resolution of the image explicitly when saving in the biXPelsPerMeter and biYPelsPerMeter properties. public class CTIFF_TAG

Syntax public class CTIFF_TAG {

288 Appendix A - Classes and Support Values

public: int tag; int tagvalue; Byte buff[]; int buff_max_bytes; };

Remark

Table A.6: public class CTIFF_TAG Variables

Variable Description int tag TIFF tag number to return or to write int tagvalue Tag value to write or to read Byte buff[] String buffer for returning string tags int buff_max_bytes Maximum bytes of the buffer to write and to read

public class CSNBDTILESTRUCT

Syntax

public class CSNBDTILESTRUCT { public: long width; long height; long tile_width; long tile_height; long num_tiles; };

289 Appendix B - Supported File Formats

Appendix B - Supported File Formats

This appendix describes the file type number and read/write capabilities of all supported file for- mats.

RasterMaster is a powerful conversion tool that can transform your documents and images into many different formats. Some format types are limited in the amount of color (bit-depth) they support in an image. Some file formats read and write only black and white (1-bit deep) and other file formats support only color images (8+ bits deep). For many of these cases, Ras- terMaster automatically converts the pixel depth to the appropriate value, based on the output format specified. The chart below will help you determine whether your black and white or color document will be able to convert straight to the desired output format with no additional proc- essing.

You can open a document in almost any supported input format by using CIMG_decompress_ bitmap(). You do not have to pass in the format type, it is automatically recognized. You can save a document to almost any supported output format by using CIMG_save_bitmap(). You pass the format type number from the chart below to indicate the format you want. Please see Chapter 8, ‘‘File Format Conversion’’ for more details.

Table B.1: File Format Key

File Format Description 1-bit Black and white or monochrome images Grayscale images, that may appear to be black and 4-bit, 8-bit, 16-bit white, but contain much more information, and are much larger than 1-bit 8-bit, 16-bit,24-bit, 32-bit Full color images

When saving to a format, if the error returned is PIXEL_DEPTH_UNSUPPORTED (-21), the output format does not support the current bits per pixel of the image you are trying to save. The chart below will help you identify formats with compatible bit depths.

Please note that the higher the bit depth (bits per pixel), then the larger the size of the image on the disk or in memory. The higher bit depth may offer more quality, but the performance may suffer because there is a lot more image data to process. Many users may have images that appear to be black and white, however, they are stored in 24-bit color. Converting these doc- uments to a 1-bit file format will decrease the size of the file and improve performance with no perceivable loss in quality.

If you have any questions about what format to select you may contact Snowbound Technical support on the web at www.support.snowbound.com.

Descriptions of Supported File Formats

The data type CIMG_IMAGE_TYPE in .NET library includes all current image types defined in library.

290 Appendix B - Supported File Formats

When using the .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 find out the format of any file by calling CIMGLOW_get_filetype(). It will return a file type number which you can look up in Table B-2.

You can find the bit depth/bits per pixel of your image by calling CIMG_bitmap_info() and look- ing at the value in biBitCount.

Table B.2: Supported File Format Descriptions

File Type Input Bit Output Bit File Fomat Description Number Depth Depth IBM image compression for scanned ABIC (reading) * 46 1 1 checks. AFP (MO:DCA) See MO:DCA. This is a multi-page 74 1 1 * file format. Snowbound reads in ASCII text files and converts them to a bitmap. 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 ASCII 38 1 No format. To enable auto-detection of the ASCII text format, call the CIM- GLOW_set_auto_detect() function with the file type number set to 38 for the ASCII file format before you get pages or decompress. BMP_COM- Originated by Microsoft, BMP sup- 12 4, 8 4, 8 PRESSED ports 1, 4, 8, and 24-bit images. BMP_UNCOM- 1, 4, 8, 16, 1, 4, 8, 16, Originated by Microsoft, BMP sup- 1 PRESSED 24 24 ports 1, 4, 8, and 24-bit images. BROOK_ 29 1 1 Brooktrout FAX format. TROUT CALS 18 1 1 Government specified format.

Group 3 compression for bitonal (1- CCITT_G3 33 1 1 bit) image data.

Group 3 compression for bitonal (1- CCITT_G3_FO 53 1 1 bit) image data.

CCITT_G4 34 1 1 Group 4 compression for bitonal (1-

291 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

bit) image data.

Group 4 compression for bitonal (1- CCITT_G4_FO 52 1 1 bit) image data. Compact Font Format is a lossless compaction of the Type 1 format using Type 2 charstrings. It is designed to use less storage space than Type 1 fonts by using operators CFF 83 1 , 8, 24 1 , 8, 24 with multiple arguments, various pre- defined default values, more efficient allotment of encoding values and shared subroutines within a FontSet (family of fonts). Camera Image File Format is a raw CIFF 81 1 , 8, 24 1 , 8, 24 image format designed by Canon. Check Image Management System. CIMS (ABIC) 80 1 No Developed by Carreker. Same as ABIC. 1, 4, 8, 24, CLIP 27 1, 4, 8, 24 Microsoft Windows clipboard format. 32 COD 72 1 No Liberty IMS black and white format. Cut images are only 8 bits per pixel CUT 31 8 No and the palette is stored in a separate file. Originated by Media Cybernetics. The DCS format is a standard Quark DCS 62 32 32 Express Format. Each plane is stored as an EPS record. Intel created this format as a multi- page .PCX format. Each page is a DCX 11 1, 4, 8, 24 1, 4, 8, 24 .PCX file in whole which can be 1, 4, 8, and 24-bit. This is a multi-page file format. Standard Windows Device Inde- 1, 4, 8, 16, DIB 48 1, 4, 8, 24 pendent Bitmap. Supports 1, 4, 8 and 24, 32 24-bits. Medical image format supporting 1, DICOM 55 8, 16, 24 No 12, 16, and 24 pixel images. Microsoft Word format. Supports DOC * 86 1, 8, 24, 32 No Microsoft Word 97, version 8 or later.

292 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth Supports 1-bit images. Cannot decompress (view) document while open in MS Word. The following fea- tures have not yet been implemented: right-to-left text flow, underlined URLs, section and paragraph borders and shading, text boxes, multi-col- umn paragraph, Windows Meta Files (WMF) clip art, autoshapes, and embedded OLE objects. Incon- sistencies exist between MS Word and the Word plugin with regards to character and line spacing. Reading support only. This is a multi-page file format. The .docx format is part of a family of open office XML-based formats devel- oped by Microsoft. It is the default document format for saving appli- DOCX * 93 1, 8, 24, 32 No cations in Microsoft Word starting with Office 2007. It is based on XML rather than Microsoft’s .doc format. Reading support only. This is a multi- page file format. Autodesk® AutoCAD® format. Used DWG 90 0 24 for computer aided design (CAD) data and metadata. Autodesk® AutoCAD® format. Used for computer aided design (CAD) data and metadata. See the following, for DXF 91 0 24 the full specification: http://us- a.autodesk.com/adsk/servlet/item? siteID=123112&id=8446698 E- message created with MS Out- EMAIL * 89 1 1 look. Encapsulated Postscript originated by Adobe. Postscript is an interpreted language. Snowbound does not sup- EPS (preview) 14 1, 4, 8, 24 1, 8, 24, 32 port full Postscript but will extract an embedded .TIF file in the image. Sometimes called a bitmap rep- resentation file. EPS Compressed bitmap format. It is 11, 8, 24, EPS_BITMAP 63 8, 24, 32 an Adobe encapsulated Postscript 321 file with either G4 or JPEG data

293 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

embedded.

EPS Compressed bitmap format. It is EPS_BITMAP_ an Adobe encapsulated Postscript 64 No 1, 8, 24, 321 G4 file with either G4 or JPEG data embedded. EPS Compressed bitmap format. It is EPS_BITMAP_ 1, 8, 24, 321, an Adobe encapsulated Postscript 69 No LZW 8, 24, 32 file with either G4 or JPEG data embedded. Image format developed by FileNet FILENET 78 1 1 Corporation for viewing documents.

24-bit tiled JPEG format that includes FLASHPIX 54 8, 24 No multiple resolution images. Created by CompuServe for com- 2, 3, 4, 5, pressing 2, 3, 4, 5, 6, 7, and 8-bit pal- GIF 4 4, 8 6, 7, 8 ette images. Uses the LZW algorithm. GIF_INTER- 1, 2, 3, 4, Same as GIF except stores the raster 44 4, 8 LACED 5, 6, 7, 8 data in an interlaced order.

Originated by Brightbill Roberts for ShowPartner DOS applications. Sup- GX2 22 4, 8 No ports 4 and 8-bit images. Simple run length encoding technique. Hyperlink Text Markup Language (HTML) is a tag-based language used to create documents for the Web. HTML * 82 0 24 HTML forms are often used to cap- ture information from web sites. Full HTML, Javascript and CSS support. Microsoft icon format. Contains a ICONTYPE 25 1, 4 No standard device independent bitmap. Supports 1 and 4 bits uncompressed. Used on the Commodore Amiga com- puters for native bitmap format. Uses IFF_ILBM 26 1, 4, 8, 24 1, 4, 8, 24 a run length format for 1, 4, and 8-bit palette images. Originated by Digital Research for IMG 28 1 No storing 1-bit images.

294 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

IMNET 42 1 No IMNET G4 compressed format. Image object content architecture. IOCA (MO:DCA) IBM format which uses CCITT G3, 24 1 1 * G4, and IBM MMR formats. 1-bit only. This is a multi-page file format. Joint bi-level Image Experts Group. 1 (with plu- This is a highly compressed format JBIG * 71 1 gin) ** which is stored in a TIFF header. It supports 1 or 8-bit gray scale images. JBIG2 is a highly-compressed black and white image format that uses symbol recognition and substitution for very dramatic compression 1 (with plu- JBIG2 77 1 results. Snowbound's viewers and gin) ** conversion programs can be used to directly view JBIG2 documents or convert those documents to a variety of output formats. US Military CCITT G4 tiled image for- mat for storing Government doc- JEDMICS 56 1 1 uments and drawings. Supports 1-bit per pixel. Joint Photographics Experts Group. This was a group spearheaded by Kodak for 24, 32, and 8-bit gray scale JPEG 13 8, 24, 32 8, 24, 32 lossy compression. This is by far the best compression available for these types of images supported in the cur- rent Snowbound library. JPEG 2000 specification. This is sim- ilar to JPEG but produces much better compression with better qual- JPEG2000 * 70 8, 24 8, 24 ity. It is supported as a separate plu- gin. An option exists to set the compression level for saving. KOFAX 23 1 No Kofax Format. Compression for documents orig- LASERDATA 19 1 No inated by LaserData Corp. 1-bit images only. Presents data for each variable on a LINE_DATA 75 1 1 single line.

MACPAINT 21 1 No Original Apple bitmap file format. All

295 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

MacPaint images are 720 x 576 pix- els 1 bit.

MAG 61 1 No Mag Format. Image object content architecture. IBM format which uses CCITT G3, MODCA_IOCA * 49 1 1 G4, and IBM MMR formats. 1-bit only. This is a multi-page file format. program bitmap file format. Supports 1-bit images. Uses MSP 30 1 No a type of RLE compression found also in compressed .BMP files. A simple header with CCITT group 4 NCR 65 1 No data. Open Document Format is an XML- based file format for representing elec- ODF 98 No No tronic documents such as spread- sheets, charts, presentations and word processing documents. Open Document Format for pre- ODP 101 No No sentations. Open Document Format for spread- ODS 97 No No sheets. Open Document Format for word proc- ODT 96 No No essing (text) documents. Office Open Extended Markup Lan- guage or Office Open XML (also infor- mally known as OOXML or OpenXML) is a zipped, XML-based file format developed by Microsoft for OOXML * 94 No No representing spreadsheets, charts, presentations and word processing documents that is intended for use with the 2007 and later versions of the Microsoft Office suite. Hewlett Packard printer file format.

PCL_1 (with plu- Support for color and grayscale out- 57 1, 24 1 gin) * put. Supported as a separate plugin. This is a multi-page file format. Hewlett Packard printer file format. PCL_1 (without 57 No 1 RasterMaster converts all images to plugin) * a 1-bit raster image. Supported as a

296 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

separate plugin. This is a multi-page file format.

Hewlett Packard printer file format. PCL_5 * 76 No 1 Support for color and grayscale out- put. This is a multi-page file format. Zsoft bitmap file format. Similar to PCX 2 1, 4, 8, 24 1, 4, 8, 24 pack bits compression. Supports 1, 4, 8, and 24-bit images. Portable Document Format. File for- mat developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted doc- uments and have them appear on the recipient's monitor or printer as they were intended. Compatible with the PDF/A specification and conforms to PDF(with plugin) 1, 2, 4, 8, 59 1, 24 PDF v1.4. Does not currently support * 16, 24, 32 JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations, however does not sup- port XFA annotations. Does not sup- port corrupt PDF documents. Snowbound Software requires that the fonts needed be available on the system. This is a multi-page file for- mat. Portable Document Format. File for- mat developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted doc- uments and have them appear on the recipient's monitor or printer as they PDF (without plu- were intended. Compatible with the 59 No 1, 24 gin) PDF/A specification. Supports some types of Adobe specified PDF anno- tations, however does not support XFA annotations. Does not support corrupt PDF documents. Snowbound Software requires that the fonts needed be available on the system. This is a multi-page file format.

297 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth Portable Document Format. File for- mat developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted doc- uments and have them appear on the recipient's monitor or printer as they were intended. Compatible with the PDF_15 79 No 1, 24 PDF/A specification. Supports some types of Adobe specified PDF anno- tations, however does not support XFA annotations. Does not support corrupt PDF documents. Snowbound Software requires that the fonts needed be available on the system. This is a multi-page file format. Portable Document Format. File for- mat developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted doc- uments and have them appear on the recipient's monitor or printer as they PDF_16 92 No 1, 24 were intended. Compatible with the PDF/A specification. Supports some types of Adobe specified PDF anno- tations, however does not support XFA annotations. Does not support corrupt PDF documents. Snowbound Software requires that the fonts needed be available on the system. Kodak photo CD format. Supports only 24-bit images. This format con- tains at least 5 images. Get these images as you would a multi-page file format.

PhotoCD 39 24 No Page 0 - 768 x 512 Page 1 - 384 x 256

Page 2 - 192 x 128

Page 3 - 1536 x 1024

Page 4 - 3072 x 2048

298 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth Images are uncompressed until the 1536 x 1024 images or greater. All images are stored as YCC data which is luminance then blue and red chrominance channels. The large image must be built from the smaller images by interpolation then adding the residual data stored by Huffman encoding. Adobe Photoshop format for storing 1, 4, 8, 16, 24, and 32-bit images. 1, 4, 8, 24, Photoshop 41 1, 8, 24, 32 Can be compressed or uncom- 32 pressed. Images may also be stored as CMYK data or RGB. Apple Macintosh bitmap file format. These images may contain vector information such as lines and circles. 1, 2, 4, 8, PICT 15 1, 4, 8, 24 Only the bitmap portion of data is 16, 24, 32 decompressed. Uses pack bits com- pression. Supports 1, 2, 3, 4, 8, 16, 24, and 32-bit images. Originated by CompuServe to replace the .GIF file format. Uses the Huff- 1, 4, 8, 16, 1, 4, 8, 16, PNG 43 man encoding variant. Supports 1, 4, 24, 32 24, 32 8, 15, 16, 24, and 32-bit images. Also supports interlaced and transparency. Microsoft PowerPoint Binary File For- mat which is the binary file format used by Microsoft PowerPoint 97, Microsoft PowerPoint 2000, Micro- PPT * 85 1, 8, 24, 32 No soft PowerPoint 2002, and Microsoft Office PowerPoint 2003. Reading sup- port only. This is a multi-page file for- mat. The .pptx format is part of a family of open office XML-based formats devel- oped by Microsoft. It is the default document format for saving appli- PPTX * 100 1, 8, 24, 32 No cations in Microsoft PowerPoint start- ing with Office 2007. It is based on XML rather than Microsoft's .ppt for- mat. Reading support only. This is a multi-page file format. Sun raster format. Supports 1, 8, 24, RAST 37 1, 8, 24 1, 8, 24 and 32-bits. Run length encoded for-

299 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

mat.

The Rich Text Format is a method of encoding formatted text and graphics RTF * 87 1, 8, 24, 32 No for easy transfer between appli- cations. This is a multi-page file for- mat. The SCITEX format is a proprietary format originated from SCITEX Cor- SCITEX 60 24, 32 24, 32 poration. Gray scale color and CMYK color images. Usually compressed. The SCITEX format is a proprietary 8, 16, 24, TARGA 3 8, 16, 24, 32 format originated from SCITEX Cor- 32 poration. The SCITEX format is a proprietary TARGA16 32 16 24, 32 format originated from SCITEX Cor- poration. Tagged image file format. Created by an independent group and was sup- ported 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 for- mat. The bytes may also be filled TIFF_2D 17 1 No from right to left or left to right. Com- pression 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. This is a multi-page file format. TIFF file with Arithmetic Binary encod- ing. Requires a special ABIC version of our tools. Very popular for check TIFF_ABIC 46 4, 8 No imaging. BW is used for 1-bit bi-level and TIFF_ABIC is for 4-bit gray scale images. This is a multi-page file for- mat. TIFF file with Arithmetic Binary encod- ing. Requires a special ABIC version of our tools. Very popular for check TIFF_ABIC_BW 47 1 No imaging. BW is used for 1-bit bi-level and TIFF_ABIC is for 4-bit gray scale images. This is a multi-page file for-

300 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth

mat.

ANSI baseline Group 3 or Group 4 TIFF_G3_FAX 8 1 1 compression embedded in a TIFF. This is a multi-page file format. ANSI baseline Group 3 or Group 4 TIFF_G4_FAX 10 1 1 compression embedded in a TIFF. TIFF_G4_FAX_ ANSI baseline Group 3 or Group 4 51 1 1 FO compression embedded in a TIFF. ANSI baseline Group 3 or Group 4 TIFF_G4_FAX_ 67 No 1 compression embedded in a TIFF. STRIP This is a multi-page file format. TIFF file compressed using the Huff- TIFF_HUFF- 7 1 1 man compression algorithm This is a MAN multi-page file format.. Standard ANSI baseline JBIG com- TIFF_JBIG 66 1 1 pression embedded in a TIFF. This is a multi-page file format. TIFF_JPEG

If you have issues viewing, Standard ANSI baseline JPEG please 40 8, 24 8, 24, 32 embedded in a TIFF. This is a multi- see Appendix I, page file format. ‘‘Trou- bleshooting’’. Black and white gray scale format. TIFF_JPEG7 73 1, 8 1, 8 This is a multi-page file format. TIFF file compressed using the LZW compression algorithm. The LZW 1, 4, 8, 24, 1, 4, 8, 16, TIFF LZW 9 algorithm includes the look-up table of 32 24, 32 codes as part of the compressed file. This is a multi-page file format. 1, 4, 8, 16, Simple run length encoding algorithm. TIFF_PACK 16 1, 8 24, 32 This is a multi-page file format. TIFF UNCOM- 1, 2, 4, 8, 1, 4, 8, 16, Uncompressed raw binary data. This 0 PRESSED 16, 24, 32 24, 32 is a multi-page file format. Snowbound reads in ASCII text files and converts them to a bitmap. The TXT 38 1 No ASCII text format is not auto- detected by default. You may get a -7

301 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth FORMAT_NOT_ALLOWED error when trying to convert the ASCII text format. To enable auto-detection of the ASCII text format, call the CIM- GLOW_set_auto_detect() function with the file type number set to 38 for the ASCII file format before you get pages or decompress. Windows file format for wireless WBMP 68 1 1 devices. A simple header with CCITT group 3 WINFAX 58 1 No compression. Microsoft Windows Metafile format. These may contain vector information such as lines and circles. Only the bit- map data is extracted. This is in the 1, 4, 8, 16, WMF 6 1, 4, 8, 24 form of a standard windows DIB. May 24, 32 be 1, 4, 8, and 24-bit. The 4 and 8-bit images may be compressed using Microsoft RLE compression as in .BMP files. WordPerfect’s metafile format. This is similar to the WMF file format in WPG * 5 1, 4, 8, 24 1, 4, 8 that it may contain vector information. Supports 1, 4, 8, and 24-bit images. Only the bitmap data is extracted. Xwindows file format which encodes XBM 20 1 1 each pixel as an ASCII byte. Only supports 8-bits per pixel.

Xerox_EPS 45 1 No Encapsulated Postscript for Xerox.

Microsoft Excel Spreadsheet format for structuring and analyzing data. This is the binary file format used by Microsoft Excel 97, Microsoft Excel XLS * 84 1, 8, 24, 32 No 2000, Microsoft Excel 2002, and Microsoft Office Excel 2003. Reading support only. This is a multi-page file format. The .xlsx format is part of a family of open office XML-based formats devel- XLSX * 95 1, 8, 24, 32 No oped by Microsoft. It is the default document format for saving appli- cations in Microsoft Excel starting

302 Appendix B - Supported File Formats

File Type Input Bit Output Bit File Fomat Description Number Depth Depth with Office 2007. It is based on XML rather than Microsoft's .xls format. Reading support only. This is a multi- page file format. Xwindows bitmap file format stored XPM 35 1, 4, 8 8 as ASCII data. Each pixel is stored as an ASCII byte. UNIX XWD Raster format. Each XWD 36 1, 4, 8 1, 8, 24, 32 pixel is stored as an ASCII byte.

* = optional only

File Type Constants Listed by File Type Number

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

File Type Number File Type Name 0 TIFF_UNCOMPRESSED 1 BMP_UNCOMPRESSED 2 PCX 3 TARGA 4 GIF 5 WPG 6 WMF 7 TIFF_HUFFMAN 8 TIFF_G3_FAX 9 TIFF_LZW 10 TIFF_G4_FAX 11 DCX 12 BMP_COMPRESSED 13 JPEG 14 EPS 15 PICT 16 TIFF_PACK 17 TIFF_2D 18 CALS 19 LASER_DATA 20 XBM 21 MACPAINT 22 GX2

303 Appendix B - Supported File Formats

File Type Number File Type Name 23 KOFAX 24 IOCA 25 ICONTYPE 26 IFF_ILBM 27 CLIP 28 IMG 29 BROOK_TROUT 30 MSP 31 CUT 32 TARGA16 33 CCITT_G3 34 CCITT_G4 35 XPM 36 XWD 37 RAST 38 ASCII 39 PHOTOCD 40 TIFF_JPEG 41 PHOTOSHOP 42 IMNET 43 PNG 44 GIF_INTERLACED 45 Xerox_EPS 46 TIFF_ABIC 47 TIFF_ABIC_BW 48 DIB 49 MO:DCA_IOCA 51 TIFF_G4_FAX_FO 52 CCITT_G4_FO 53 CCITT_G3_FO 54 FLASHPIX 55 DICOM 56 JEDMICS 57 PCL_1 58 WINFAX 59 PDF 60 SCITEX 61 MAG 62 DCS 63 EPS_BITMAP 64 EPS_BITMAP_G4 65 NCR 66 TIFF_JBIG 67 TIFF_G4_FAX_STRIP

304 Appendix B - Supported File Formats

File Type Number File Type Name 68 WBMP 69 EPS_BITMAP_LZW 70 JPEG2000 71 JBIG 72 COD 73 TIFF_JPEG7 74 AFP 75 LINE_DATA 76 PCL_5 77 JBIG2 78 FILENET 79 PDF_15 80 CIMS 81 CIFF 82 HTML 83 CFF 84 XLS 85 PPT 86 DOC 87 RTF 88 PDF_LZW 89 EMAIL 90 DWG 91 DXF 92 PDF_16 93 DOCX 94 OOXML 95 XLSX 96 ODT 97 ODS 98 ODF 100 PPTX 101 ODP

305 Appendix C - Software Installation

Appendix C - Software Installation

This appendix describes how to install the evaluation or full copy of the RasterMaster .NET Imaging SDK software. The appendix contains the following topics:

Overview of the Installation Process

Installing the Software

Directory Structure

Installed Files

Overview of the Installation Process

The RasterMaster .NET Imaging SDK is easy to install as an evaluation, developer, or run-time version. The evaluation copy is delivered as a .zip archive that can be manually extracted to an installation directory chosen by the user.

You can get an evaluation by contacting a member of our sales team at sales@sno- wbound.com or 1-617-607-2010. The evaluation copy expires at the end of each month.

Both the developer and runtime version of the RasterMaster .NET Imaging SDK ship as fully serialized builds which are very easy to install. This product is fully enabled as either a devel- oper or runtime product.

The RasterMaster .NET Imaging SDK is delivered as a .zip archive that can be manually extracted to an installation directory chosen by the user. For example: C:\Program Files\Snowbound\RMNET

Note: For the RasterMaster .NET Imaging SDK, Snowbound requests that you place all Snow- bound components in a non-common directory within Windows. They should NOT be placed in the \windows or \windows\system directory or other such common area.

When a developer's license is purchased, a Developer’s Version banner appears. You must interactively select the notification box for the program to continue. Contact sales if you need to eliminate this notification for your development purposes.

When a distribution license is purchased, all banners disappear.

Notes: You are running an evaluation version of the software if an evaluation banner appears on the screen. Contact support at ([email protected]) for help with these issues.

306 Appendix C - Software Installation

If you download an update or receive one from Snowbound technical support, please ensure that you obtain a serialized version of the product before you go into distribution.

Redistributing Snowbound Files

Your application will link to one or more Snowbound dlls, including SbdNetAnn.dll and plug- in .dlls. When your application is deployed, the Snowbound files should be placed in either the same directory as your application or in a Snowbound directory where the application can find them. These files should not be placed in a Windows\System directory or other common Win- dows directory.

If more than one Snowbound dll is used, they should all be kept at the same version. If one dll is updated or upgraded they should all be updated or upgraded.

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

What to Expect When Installing an Evaluation Version

Your evaluation is a full version of the product with the following limitations:

l You will see a pop up banner when you view or convert your first document. Subsequent documents in the same session will not elicit the banner.

l You will see large thin Xs across each page after the first 50 pages or thumbnails.

l After your expiration date, you will see a banner stating the evaluation has expired. You will not see any output.

Other than that you will have full use of the product including support for all document formats.

What to Expect in a Production Version

When you purchase the RasterMaster DLL Imaging SDK, you will receive a set of fully licensed binary files. The files will include snbd*.dll and .lib and .dlls for each purchased option. Please see Installed Files for a list of the files installed with RasterMaster .NET.

Installing the Production Version of RasterMaster .NET

Install and configure the evaluation version of the product on your target production system. Ensure it is working as you intended. Extract the binary files from the production version pack- age and use those to replace the same files in the evaluation version that you have installed. Once the production files are in place you will no longer see banners or Xs. You will only see expiration messages if you try to view a document of a type that you did not purchase, for exam- ple MS Office or AFP/MO:DCA.

307 Appendix C - Software Installation

Installing the Software

To install the RasterMaster .NET Imaging SDK:

1. Double-click on the downloaded executable. In this example, double-click on rmDot- Net17.exe to display the Welcome dialog.

2. After reading the dialog, click Next to display the License Agreement dialog.

308 Appendix C - Software Installation

3. Read the license agreement.

l If you agree with the license agreement, select “I accept the license agreement” and click Next to display the Readme Information dialog (Figure C-4).

l If you do not agree with the license agreement, you cannot proceed with the installation.

309 Appendix C - Software Installation

4. Accept the default destination folder and click Next to display the Ready to Install dialog.

310 Appendix C - Software Installation

5. Click Next to begin the installation. Installation begins. This may take a few seconds.

6. You will see a warning message if you do not have the Visual C++ 2005 Redistibutable prerequisite file installed. If you want to use the RasterMaster Imaging SDK Microsoft Office plugin to convert Word 2007 (.docx) documents, you need to click Yes to install the Visual C++ 2005 Redistributable prerequisite file and continue the RasterMaster DLL installation.

311 Appendix C - Software Installation

7. Once installation is complete, the Successful Installation dialog displays.

312 Appendix C - Software Installation

8. Click Finish to complete the installation..

Directory Structure

The installation of the .NET Imaging SDK creates a new directory called C:\Program Files\Snowbound\RM. The example below is a version 17 .NET directory.

RM17Net Docs Images Marketing Samples

Installed Files

This section describes the files that are installed during the .NET Imaging SDK installation. The main installation directory is RMNet. For example, if you install the ver- sion 17 .NET, the directory will be RM17Net. There is also a Docs, Marketing, and Samples subdirectory.

313 Appendix C - Software Installation

Main Directory Files

The files installed into the main directory are defined in Table C-1.

Table C.1: RasterMaster .NET Imaging SDK Default Directory File

File Description abicplug.dll ABIC plugin file containing the PDF plugin. Aspose.Cells.dll Aspose.Cells library file. Aspose.Total.Product.Family.lic Aspose product license. Aspose.Words.dll Aspose.Words library file. CsHtml.dll HTML plugin file. docplug.dll MS Word plugin file. dwgplg.dll DWG plugin file. HtmlHelper.dll HTML plugin file. htmlplg.dll HTML plugin file. icudt38.dll HTML plugin file. jb2plug.dll JBIG2 plugin file. jp2plug.dll JPEG2 plugin file. ooxmlplug.dll Open Office XML (OOXML) plugin file. pclplug.dll PCL plugin file containing the PCL plugin. pdfplug.dll PDF plugin file containing the PDF plugin. SbdNetAnn.dll Main Snowbound file.

Strong Name Support

The .NET library is assigned a cryptographic signature, called a strong name. The strong name can be uniquely identified and installed to the Global Assembly Cache (GAC) to allow multiple applications to reference and use it.

Locate the strong name tool, sn.exe, on your computer. For example: C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn.exe

The following are some commands to use when working with the strong name:

To verify the strong name: sn -v sbdnetann.dll

To display the public key information: sn -Tp sbdnetann.dll

To skip strong name verification: sn -Vr sbdnetann.dll

314 Appendix C - Software Installation

For more information about using a strong name, please refer to the following Microsoft.net doc- ument:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpco- nassigningassemblystrongname.asp

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

Docs Directory Files

The files installed into the Docs directory are defined in Table C-2.

Table C.2: RasterMaster .NET Imaging SDK Docs Directory Files

File Description Aspose end user license agree- Aspose_LicenseAgreement.pdf ment. Snowbound Software com- install_instructions-component.pdf ponent installation instructions. Open source sofware license Open Source Software Licenses Used With Certain Snow- agreement bundled with Snow- bound Products_2009.05.pdf bound Software products. Complete .NET programmers RMDotNETProgrammersGuideV17.9.pdf guide. RMDoctNETReleaseNotes17.9.pdf NET Release Notes.

Marketing Directory Files

The files installed into the Marketing directory are defined in Table C-3.

Table C-3. RasterMaster .NET Imaging SDK Marketing Directory Files

File Description Provides an overview of Snowbound Software including CompanyOverview.pdf company facts, products, and formats. Provides an overview of Snowbound Software’s Ras- RasterMasterOverview.pdf terMaster products.

Sample Directory Files

The samples directory contains the .NET Imaging SDK samples that are described in Table C- 4. All of the .NET samples include C#.NET and VB.NET source code. For more information about each sample, see Appendix F.

Table C.3: RasterMaster .NET Imaging SDK SamplesDirectory

315 Appendix C - Software Installation

Sample Description Sample for using the .NET library in C# to load, display Alpha_csharp the image, and use basic operations like zoom and rotate to manipulate the image. See Alpha for more information. Sample for using the .NET library in Visual Basic to load, display the image, and use basic operations like zoom Alpha_VB and rotate to manipulate the image. See Alpha for more information. Sample for displaying an animated GIF image in C#. See Animate_CSHARP Animate for more information. Sample for displaying an animated GIF image in Visual Animate_VB Basic. See Animate for more information. Sample for using the .NET library in C# mouse handler to annaction_csharp add an annotation. See Annaction for more information. Sample for using the .NET library in Visual Basic mouse annaction_VB handler to add an annotation. See Annaction for more information. Sample for using the .NET library in C# to add an anno- Annotation_CSHARP tation. See Annotation for more information. Sample for using the .NET library in Visual Basic to add Annotation_VB an annotation. See Annotation for more information. Sample for demonstrating a simple conversion in C#. See ASPConversion_CSHARP ASP Conversion for more information. Sample for demonstrating a simple conversion in Visual ASPConversion_VB Basic. See ASP Conversion for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in C# to load, display the ASPImageView_CSHARP image, and use basic operations like zoom and rotate to manipulate the image. See ASP Image View for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in Visual Basic to load, display ASPImageView_VB the image, and use basic operations like zoom and rotate to manipulate the image. See ASP Image View for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in C# for saving and reading ASPMemCopy_CSHARP the image from memory. See ASP Memory Copy for more information. Sample for demonstrating how to use the ASP .NET and Snowbound .NET libraries in Visual Basic for saving and ASPMemCopy_VB reading the image from memory. See ASP Memory Copy for more information. Sample for demonstrating how to use the ASP .NET and ASPMultiPage_CSHARP Snowbound .NET libraries in C# to browse multiple page images. See ASP Multiple Pages for more information. ASPMultiPage_VB Sample for demonstrating how to use the ASP .NET and

316 Appendix C - Software Installation

Sample Description Snowbound .NET libraries in Visual Basic to browse mul- tiple page images. See ASP Multiple Pages for more infor- mation. Sample for comparing an image that had the brightness Contrast_CSHARP and contrast changed with the original/unmodified image in C#. See Contrast for more information. Sample for comparing an image that had the brightness Contrast_VB and contrast changed with the original/unmodified image in Visual Basic. See Contrast for more information. Sample for demonstrating a simple conversion in C#. See Conversion_CSHARP Conversion for more information. Sample for demonstrating a simple conversion in Visual Conversion_VB Basic. See Conversion for more information. Sample for showing how to get the DDB display effect ddbeffect_CSHARP from an image in C#. See DDB Effect for more infor- mation. Sample for showing how to get the DDB display effect ddbeffect_VB from an image in Visual Basic. See DDB Effect for more information. Sample demonstrating how to use the Snowbound.Net Encrypt_csharp library in C# to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to use the Snowbound.Net Encrypt_VB library in Visual Basic to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to read an image file into memory and use the Snowbound .NET library in C# to FileMem_CSHARP decompress the image from memory. See FileMem for more information. Sample showing how to apply the image processing oper- ImageProcessing_CSHARP ator in C#. See Image Processing for more information. Sample showing how to apply the image processing oper- ImageProcessing_VB ator in Visual Basic. See Image Processing for more infor- mation. Sample demonstrating how to use the Snowbound .NET memcopy_csharp library in C# for saving and reading the image from mem- ory. See Memory Copy for more information. Sample demonstrating how to use the Snowbound .NET Memcopy_VB library in Visual Basic for saving and reading the image from memory. See Memory Copy for more information. Sample demonstrating how to merge two images. See mergeimage_CSHARP Merge Image for more information. Sample for displaying any page and using anti-aliasing if page_csharp desired in C#. See Page for more information. Sample for displaying any page and using anti-aliasing if Page_VB desired in Visual Basic. See Page for more information.

317 Appendix C - Software Installation

Sample Description Sample demonstrating panning in C#. See Panning for panning_csharp more information. Sample demonstrating panning in Visual Basic. See Pan- panning_VB ning for more information. Sample demonstrating printing and previewing in C# Print_CSHARP using the Snowbound product. See Print for more infor- mation. Sample demonstrating printing and previewing in Visual Print_VB Basic using the Snowbound product. See Print for more information. Sample demonstrating how to use the Snowbound .NET Scan_CSHARP library in C# for scanning functions. See Scan for more information. Sample demonstrating how to use the Snowbound .NET Scan_VB library in Visual Basic for scanning functions. See Scan for more information. Sample demonstrating how to split multiple pages in C#. SimpleMultiPages_CSHARP See Split to Multiple Pages for more information. Sample demonstrating how to split multiple pages in Vis- SimpleMultiPages_VB ual Basic. See Split to Multiple Pages for more infor- mation. Sample showing how to search text in the image in C#. textsearch_CSHARP See Text Search for more information. Sample showing how to search text in the image in Visual textsearch_VB Basic. See Text Search for more information. Sample demonstrating how to use the Snowbound .NET TIFFTag_CSHARP library in C# for reading .tif tags. See Tiff Tag for more information. Sample demonstrating how to use the Snowbound .NET TIFFTag_VB library in Visual Basic for reading .tif tags. See Tiff Tag for more information.

318 Chapter D - Set Up for ASP .NET Samples

Chapter D - Set Up for ASP .NET Samples

This appendix describes how to set up your system to work with ASP .NET samples. The appendix contains the following topics:

Overview of the Set Up Process

Setting Up the Environment to Run Web Applications

Setting Up Samples on a Web Server

Running ASP.NET Samples

Overview of the Set Up Process

ASP.NET web applications can be integrated with the Microsoft server, programming, data access, and security tools. Under the Microsoft Visual Studio .NET development environment, it is easier to create, debug, and deploy web applications.

The purpose of the ASP.NET samples is to demonstrate how to use the Snowbound .NET library within Microsoft Visual Studio .NET projects for web applications development. All of the ASP.NET samples are web form based projects and have to be deployed on an IIS web server.

Web applications can provide image manipulation from a web server to client machines over the internet. Users can upload images to a web server, view all kinds of the images through a web browser, process images, and download converted images back to their local computers.

To view images through the internet, all of these samples convert images to a standard web browser supported image format, such as JPEG, bitmap, or PNG. No special software needs to be installed on the client site.

The ASP.NET samples use the Snowbound standard .NET library dll. No special component installation is needed. Since the .NET library is not a web component, it can be used by either Windows applications or web applications. No web control is displayed on the toolbar within these sample projects.

Currently, Snowbound Software provides VB.Net and C#.Net sample source code. You can simply copy the source code to your own web application project or setup and run the samples on your web server and modify them to your own applications. See Appendix F, .NET Samples for more information.

The .NET library supports Microsoft’s newly released version of .NET Framework 2.0, Visual Studio 2005, and ASP .NET 2.0.

All of Snowbound Software’s samples were written under Visual Studio .NET 2003. When you use Visual Studio 2005 to open a sample project file, Visual Studio 2005 will prompt you to con- vert the project to the new version.

If you have more questions about installing or running these samples, please contact Snow- bound Software’s technical support at http://support.snowbound.com.

319 Chapter D - Set Up for ASP .NET Samples

Setting Up the Environment to Run Web Applications

The following environments are required to debug and run the web applications projects:

IIS 5.1 or later .NET Framework 2.0 ASP.NET 2.0 Visual Studio .NET 2003 Visual Studio 2005

If you can use Visual Studio .NET to create your own web applications, you are already able to run the samples on your environment and you can skip this step. Otherwise, install the above software first.

To check that IIS is installed on your system, select the > Administrative Tools. If the window displays the icon for Internet Information Services, your system already has IIS installed. Another way to check that you have IIS installed on your system is to select the Control Panel > Administrative Tools > Services and check the system to see if IIS services is started.

To register ASP.NET on IIS, select the Windows Directory and locate where your .NET frame- work is installed. For example: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322. Run the command: aspnet_regiis /i (Figure D-1).

Figure D-1. Running the aspnet_regiis /i Command

Note: Refer to Microsoft’s website, www.microsoft.com, for more information about software installation and troubleshooting.

320 Chapter D - Set Up for ASP .NET Samples

Setting Up Samples on a Web Server

To set up samples on a web server, follow the steps below:

1. Copy all of the samples to your local computer. For example: C:\ASPSample.

2. Setup a virtual directory for the samples. Select the Control Panel > Administrative Tools and open Internet Information Service. (Figure D-2)

Figure D-2. Internet Information Service Icon

3. Right click on the default website. 4. Select New > Virtual Directory. (Figure D-3)

321 Chapter D - Set Up for ASP .NET Samples

Figure D-3. Selecting the Virtual Directory

5. In the Alias field, enter ASPSample as the alias name, and click Next. (Figure D-4)

Figure D-4. Entering the Alias Name

6. Browse and locate the local directory that contains your ASP.NET samples. Click Next. (Figure D-5)

322 Chapter D - Set Up for ASP .NET Samples

Figure D-5. Locating the Directory

7. Click the check box and select Execute, Write Permissions, and Finish. 8. Create the ASPSample application on IIS.

After you create the ASPSample virtual directory, the system should display ASP- Sample under the default web site in Internet Information Service.

Click ASPSample to see the samples directories.

Right click on a sample name. For example: ASPConversion_CSHARP.

Select Properties.

In the Execute Permissions field, select Script and Executables and click the Create button. (Figure D-6)

323 Chapter D - Set Up for ASP .NET Samples

Figure D-6. Creating an ASPSample Application on IIS

9. Create all ASPSample applications on IIS.

Follow step 3 to create applications on IIS for all ASP.NET Samples and close Internet Information Service.

10. Add the .NET library DLL reference to projects.

Use Microsoft Visual Studio .Net to open a sample project.

Under the Solution Explorer, right click Reference.

11. Select Add Reference and the browser directory to locate the .NET library dll on your computer. Click OK. (Figure D-7, Figure D-8)

Figure D-7. Add Reference

Figure D-8. Selecting .NET library dll

324 Chapter D - Set Up for ASP .NET Samples

Build and run your sample application.

Running ASP.NET Samples

If you are running the samples with the evaluation version of the .NET dll and the page freezes the first time that you try to connect, select the web server site and click OK for the evaluation message box.

To see the correct image using Internet Explorer, you will need to adjust the following settings:

1. Select Internet Explorer > Tools > Internet Options.

2. In the Temporary Internet Files section, click Settings.

3. In the check for newer version of stored pages section, choose Every visit to the page.

When running these .NET samples, you might encounter a problem when loading large file size images to the web server. The default allowed size is 4MB. To check your web server setting, follow the steps below:

1. Under the .NET framework directory, open the machine.config file. 2. Search for the httpruntime attribute. 3. Set the maxlength to the maximum file size you need. (Figure D-9)

Figure D-9. Adjusting the File Size

325 Chapter E - Set Up for the Web Image Viewer Component

Chapter E - Set Up for the Web Image Viewer Component

This appendix describes how to set up the web image viewer component.

Introduction to the Web Image Viewer

The .NET user control component can be embedded in an HTML file running on the client side. It provides better security than an ActiveX object. SnbdImageViewer is a web image viewer control sample that uses the Snowbound .NET library to view web images. The advantage of the component is it allows the user to view 32-bit images and types of images that are not sup- ported by the browser but supported by the Snowbound library through the internet.

Steps to Run the Web Image Viewer Control in Internet Explorer

To run the web image viewer control in Internet Explorer, follow the steps below:

1. Compile and build the SnbdImageViewer sample to create the control component SnbdImageViewer.dll.

2. Create an HTML file and then add the component to the HTML file. A sample HTML file is included with the samples that are included with Snowbound’s RasterMaster SDK .NET product. It is located in the SnbdImageViewer folder where the samples are installed. For example: C:\Program Files\Sno- wbound\RM16PlatExtNetAnn\AnnSamples\ SnbdImageViewer.

Example E.1 Run the Component in Internet Explorer

Example E.2 Create a Pop Up Window to Run the Component

3. Do the following to deploy the component on your web server:

l Use IIS to create a virtual directory. For example: tempview.

l Set the execution permissions on the virtual directory to scripts.

l Copy SnbdImageViewer.dll, your html file, and the Snowbound .NET library SbdNetAnn.dll to the folder.

4. Do the following to configure color access permissions:

l Configure the virtual directory security to allow read and execute.

l Configure Internet Explorer to trust the web site you created.

l Navigate to Control Panel > Administrative Tools > Microsoft .NET Frame- work 1.1 Configuration.

l Configure the .NET framework security policy to trust the snbdim- ageviewer.dll file and the sbdnet.dll file that you load from.

5. Go to the web site where you deploy the component and run the HTML file.

For example: http://localhost/tempview/snbdimageviewer_embedded.html

http://mywebserver/tempview/snbdimageviewer_embedded.html

Note: If you are upgrading from the RasterMaster base library to the new RasterMaster 18.0 library, you will need to replace references to sbdnet.dll with SbdNe- tAnn.dll.

Troubleshooting

The following steps explain how to troubleshoot problems that you may experience.

1. If you have problem loading the control, check that the Snowbound library can be loaded from the control. You can do the following to troubleshoot this problem:

l Edit the source code SnbdViewer.cs and add the following line:

327 Chapter E - Set Up for the Web Image Viewer Component

Assembly a = Assembly.LoadFrom("SbdNetAnn.dll"); before line simage = new SbdNetLib.Snowbnd();

l Rebuild the component and select Run.

If you catch the exception, the .NET library cannot be loaded. The system will dis- play an error message. You should solve the problem first. This problem can be caused by the security setting or a .NET library dependency.

2. When you run the control, it will be downloaded to your local cache automatically.

To view the cache, run the following command: gacutil /ldl

To clean the cache, run the following command: gacutil /cdl

3. When you have problem running the component, do the following:

l Try to clean the cache.

l Close Internet Explorer and restart it.

Note: If you have the evaluation version of the .NET library, you might experience a problem running it in Internet Explorer 6.0. In this case, Snowbound Software suggests that you use Internet Explorer 6.1 or the runtime version of our .NET library.

328 Appendix F - .NET Samples

Appendix F - .NET Samples

This appendix describes the .NET samples included with the RasterMaster .NET Imaging SDK.

If you do not find the sample that you are looking for in this manual, please open a support ticket at http://support.snowbound.com to request a specific sample. We are dedicated to helping our customers succeed and we are constantly enhancing our products based on feedback from cus- tomers like you.

The appendix contains the following topics:

Overview of the .NET Samples

Running a Sample

Alpha

Animate

Annaction

Annotation

ASP Conversion

ASP Image View

ASP Memory Copy

ASP Multiple Pages

Batch_XPS_Convert

Contrast

ConsoleApp

Conversion

Convert_Doc

DDB Effect

DocClean

Encryption

FileMem

Image Processing

Memory Copy

Merge Image

Page

329 Appendix F - .NET Samples

Panning

Print

Scan

Split to Multiple Pages

Text Search

Thumbnail

Tiff Tag

WPFAnnotation_CSHARP

WPFConversion_CSHARP

WPFScanning_CSHARP

Web Image Viewer Component

WPF Image

XPSMem_CSHARP

Overview of the .NET Samples

There are several samples included with the RasterMaster .NET SDK. All of the .NET samples include C#.NET and VB.NET source code. They are used to manipulate images in many ways, such as load, display, save images, zoom, rotate, convert, print, preview, or to split the image to use in another format.

Running a Sample

To compile these samples, you need to install Microsoft Visual Studio .NET 2003. Use Win- dows Explorer to point to the project file. Double click on the project to open it.

To run the sample, use Windows Explorer to point to the application.exe file and double click on the file.

Building 32-bit Application Running on a 64-bit Oper- ating System

Snowbound Software’s 32-bit .NET library supports running on 64-bit operating systems by run- ning in compatibility mode.

Note: Snowbound Software supports running RasterMaster .NET 32-bit applications on 64-bit

330 Appendix F - .NET Samples

systems. However, we do not support mixing and matching 32-bit and 64-bit code or dlls.

To build a 32-bit application for a 64-bit operating system, follow the steps below:

1. In your project, add a reference to the .NET library 32-bit build 2. Under build configuration, create and select the X86 option.

This will allow your program to work in 32-bit or 64-bit systems.

Here is a Microsoft article with more details: http://msdn.microsoft.com/en-us/library/ms241064.aspx

Building for a 64-bit Operating System

Snowbound Software’s 64-bit .NET library supports running on 64-bit operating systems.

To build a 64-bit application for a 64-bit operating system, follow the steps below:

1. In your project, add a reference to the .NET library 64-bit build. 2. Under build configuration, create and select the X86 option.

This will allow your program to work in 64-bit systems.

Building a RasterMaster .NET x64 sample with .NET 4.0

To build a RasterMaster .NET x64 sample with .NET 4.0, follow the steps below:

1. In Visual Studio, open the sample .sln and switch the solution target platform to Any CPU. 2. Remove the old SbdNetAnn reference and add a reference to .NET x64 .NET 4.0 SbdNetAnn.dll. 3. Build the sample. For example: Conversion_CSHARP. 4. Copy all the dlls from .NET x64 to the \bin\debug directory where the .exe is built. For example: \Bin\debug. 5. Run the sample application. You should be able to load any supported document type.

Building a RasterMaster .NET x32 sample with .NET 2.0

To build a RasterMaster .NET x32 sample with .NET 2.0, follow the steps below:

331 Appendix F - .NET Samples

1. In Visual Studio, open the sample .sln and switch the solution target platform to x86. 2. Remove the old SbdNetAnn reference and add a reference to .NET x32 .NET 2.0 SbdNetAnn.dll. 3. Build the sample. For example: Conversion_CSHARP. 4. Copy all the dlls from .NET x32 to the \bin\x86\debug directory where the .exe is built. For example: \Bin\debug. 5. Run the sample application. You should be able to load any supported document type.

Alpha

This sample demonstrates how to use the .NET library to load, display the image, and use basic operations like zoom and rotate to manipulate the image. You can select Zoom In, Zoom Out, and Zoom Restore. You can rotate the image 90, 180, or 270 degrees. You can rotate the screen 0 or 180 degrees.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET Evaluation\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_set_display_angle() forces rotation of the image at display time.

CIMG_rotate_bitmap() rotates image data.

CIMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.

Animate

This sample demonstrates how to display an animated GIF image.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMG_animate() draws all of the frames of the animated GIF.

332 Appendix F - .NET Samples

CIMG_display_fit_to_width() displays the full width of the image.

CIMG_display_fit_to_height() displays the full height of the image.

Annaction

This sample demonstrates how to use the .NET library mouse handler to add an annotation.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets the image header information.

CIMG_delete_bitmap() deletes image related allocation.

CSANN_display_annotations() displays annotation objects.

CSANN_create_ann() loads the Init annotation.

CSANN_read_ann() reads an annotation object from a file.

CSANN_write_ann() saves an annotation object to a file.

CSANN_mouse() selects the mouse handler to add an annotation object.

CSANN_choose_color() selects the color.

CSANN_set_fcolor() sets the foreground color.

CSANN_set_bcolor() sets the background color.

CSANN_choose_font() selects and sets the font.

CSANN_choose_line_width() selects the line width.

CSANN_set_line_width() sets the line width.

CSANN_choose_line_style() selects the line style.

CSANN_set_line_style() sets the line style.

Annotation

This sample demonstrates how to use the .NET library to add an annotation.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

333 Appendix F - .NET Samples

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets the image header information.

CIMG_delete_bitmap() deletes image related allocation.

CSANN_display_annotations() displays annotation objects.

CSANN_create_ann() loads the Init annotation.

CSANN_read_ann() reads an annotation object from a file.

CSANN_write_ann() saves an annotation object to a file.

CSANN_choose_color() selects the color.

CSANN_set_fcolor() sets the foreground color.

CSANN_set_bcolor() sets the background color.

CSANN_choose_font() selects and sets the font.

CSANN_choose_line_width() selects the line width.

CSANN_set_line_width() sets the line width.

CSANN_choose_line_style() selects the line style.

CSANN_set_line_style() sets the line style.

CSANN_print_annotations() prints the annotation.

CSANN_activate_all_objects() activates all of the objects.

CSANN_add_object() adds the annotation object.

CSANN_deactivate_all_objects() deactivates all of the objects.

CSANN_rotate() rotates the annotation.

CSANN_delete_object() deletes the annotation object.

CSANN_get_object_info() gets the object information.

CSANN_get_object_num() gets the annotation object ID.

CSANN_map_wnd_to_image() converts window coordinates to image coordinates.

CSANN_deactivate_object() deactivates an annotation object.

CSANN_highlight_object() highlights an object.

CSANN_get_object_bounds() gets the object bounding rectangle.

CSANN_move_object() moves an annotation object.

CSANN_resize_object() resizes an annotation object.

334 Appendix F - .NET Samples

ASP Conversion

This web application sample demonstrates a simple conversion. It takes the path to the image you want to convert and the Snowbound integer format value for the type of file format you want to output. It can upload the image to a web server and download the converted image from a web server.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_bitmap_info() gets information about the decompressed image.

ASP Image View

This web application sample demonstrates how to use the ASP .NET and Snowbound .NET libraries to load, display the image, and use basic operations like zoom and rotate to manipulate the image.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET Evaluation\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMG_rotate_bitmap() rotates image data.

CIMG_display_bitmap_aspect() displays the current bitmap with corrected aspect ratio.

ASP Memory Copy

This web application sample demonstrates how to use the ASP .NET and Snowbound .NET libraries for saving and reading the image from memory.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

335 Appendix F - .NET Samples

CIMG_save_bitmap_mem() saves an image to memory in the desired format.

CIMG_decompress_bitmap_mem() reads the image from memory.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_bitmap_info() gets information about the decompressed image.

ASP Multiple Pages

This web application sample demonstrates how to use the ASP .NET and Snowbound .NET libraries to browse multiple page images.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_bitmap_info() gets information about the decompressed image.

Batch_XPS_Convert

This sample demonstrates how to decompress from memory for the XPS file format.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET Evaluation\Net\Sample\WPF.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap_xps_mem() decompresses xps file from memory.

CIMG_bitmap_info() gets information about the decompressed image.

CIMG_get_pages_xps_mem() gets the XPS page number from current file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_save_bitmap() saves the image to the disk in any available format.

ConsoleApp

This sample is a simple command line application to load the Snowbound .NET library, sbdne- tann.dll. It can be used to see if the .NET library can be loaded on a machine or not. If there is

336 Appendix F - .NET Samples an exception when loading the .NET library, all other samples will not run properly. The excep- tion is most likely caused by a dependency problem such as the Microsoft distribution package is not installed on the machine or the .NET library is not assigned a strong name.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Note: In the sample code, be sure to update the Assembly.LoadFrom call to the location of the RasterMaster .NET library on your machine. Also, this sample requires the directory C:\user\ to exist on your machine.

Contrast

This sample compares an image that had the brightness and contrast changed with the orig- inal/unmodified image. You can select to adjust the contrast and brightness from -127 to 127.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMG_set_lut() sets the contrast and brightness of an image.

Conversion

This sample demonstrates a simple conversion. It takes the path to the image you want to con- vert and the Snowbound integer format value for the type of file format you want to output. It allows you to load an image, select the Previous Page or Next Page, and select the file format that you want to convert the image to.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_display_bitmap() displays the current image.

337 Appendix F - .NET Samples

Convert_Doc

This sample demonstrates how to save the output as a text searchable PDF.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets the image header information.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_display_bitmap() displays the current image.

CIMGLOW_extract_text() extracts text from an image file.

CIMG_save_document() takes a buffer passed in with text, graphics, and position information to create the document file output.

CIMG_save_document_mem() takes a buffer passed in with text, graphics, and position infor- mation obtained from CIMGLOW_extract_text_mem() to save the document file output to mem- ory.

DDB Effect

This sample shows how to get the DDB display effect from an image.

Listed below are the functions used in this sample.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Snowbnd() loads the Init Snowbound .NET component.

clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMGLOW_set_wipedelay() sets up the delay time for an image to display.

CIMG_display_ddb_effect() displays the image with the desired effect.

338 Appendix F - .NET Samples

DocClean

This sample demonstrates how to use the Image Library DocClean functions.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_bitmap_info() gets the image header information.

CIMGLOW_detect_blank_page() detects blank pages.

CIMGLOW_remove_holepunch() removes hole punch.

CIMGLOW_remove_halftone() removes halftone.

CIMGLOW_remove_lines() removes lines.

CIMGLOW_auto_invert() detects blank pages.

CIMGLOW_image_erosion() detects image erosion.

CIMGLOW_image_dilation() detects image dilation.

CIMG_delete_bitmap() deletes image related allocation.

Encryption

This sample demonstrates how to use the Snowbound.NET library to transparently decom- press and display images. It allows you to load an image, enter a transparency key, and save the image.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component. clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_set_encrypt() sets the encrypting image.

CIMG_save_bitmap() saves the image to the disk in any available format.

339 Appendix F - .NET Samples

FileMem

This sample demonstrates how to read an image file into memory and use the Snowbound .NET library to decompress the image from memory. You can load an image file or load an image from memory.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET Evaluation\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap_mem() reads the image from memory.

CIMG_bitmap_info() gets the image header information.

CIMG_display_bitmap() displays the current image.

clearImage() removes the image from memory.

Image Processing

This sample shows how to apply the image processing operator.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMG_process_bitmap() processes the image.

Memory Copy

This sample demonstrates how to use the Snowbound .NET library for saving and reading the image from memory. You can select the Load Image File button to load the image and select the Load Image from Memory button to display the image from memory.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

340 Appendix F - .NET Samples clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_save_bitmap_mem() saves an image to memory in the desired format.

CIMG_display_bitmap() displays the current image.

CIMG_decompress_bitmap_mem() reads the image from memory.

Merge Image

This sample demonstrates how to merge two images.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET Evaluation\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMGLOW_get_bitmap_header() gets the image header information.

CIMG_display_fit_to_height() displays the full height of the image.

CIMG_promote_24() converts an image to a 24-bit image.

CIMG_merge_bitmap() merges two images.

CIMG_save_bitmap() saves the image to the disk in any available format.

Page

This sample displays any page and uses anti-aliasing if desired.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_display_bitmap() displays the current image.

CIMGLOW_set_alias() displays scaled-down 1 bit and color images.

341 Appendix F - .NET Samples

Panning

This sample demonstrates panning.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMG_set_croprect() sets the crop rectangle from the image.

Print

This sample demonstrates printing and previewing using the Snowbound product. You can select the Load Image button to load the image. You can select the Print Preview button to view the image before printing it. The Print Preview screen allows you to zoom in on the image and select multiple page views. You can select the Print button to print the image.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMG_print_bitmap() prints the current image.

Scan

This sample demonstrates how to use .NET library scanning functions.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets the image header information.

342 Appendix F - .NET Samples

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_display_bitmap() displays the current image.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_scan_open_source() selects the available input device.

CIMG_scan_acquire() scans an image on the currently selected scanner.

CIMG_scan_acquire_feeder() scans from a scanner with an automatic document feeder.

CIMG_scan_pages() scans all pages from the currently selected scanner.

CIMG_scan_feeder_close() closes the scanner after calls to CIMG_scan_acquire_feeder ().

CIMG_scan_get_cap() returns the value of the current specified TWAIN capability.

CIMG_scan_set_cap() sets the value of the specified TWAIN capability.

CIMG_scan_set_caps() sets the scanning parameters.

CIMG_scan_setup() displays the TWAIN driver’s user interface to set scanning parameters.

Split to Multiple Pages

This sample demonstrates how to split multiple pages. It splits a given multi-page file into sin- gle page (.sbd) files. You can select the Load Image button to load the image. You can select the Split to Multiple Pages button to split the image to multiple pages. You can select the format that you want to save the split image as.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample.

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_display_bitmap() displays the current image.

CIMG_save_bitmap() saves the image to the disk in any available format.

Text Search

This sample shows how to search text in the image.

343 Appendix F - .NET Samples

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_decompress_bitmap_page() loads one page of an image from the disk.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_display_bitmap() displays the current image.

CIMG_bitmap_info() gets the image header information.

CIMGLOW_extract_text() extracts text from an image file.

CIMGLOW_search_text() searches text from a text buffer.

Thumbnail

This sample demonstrates how to display thumbnails of all pages in a document in C# .NET.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMGLOW_set_alias() sets the aliasing factor.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMG_display_bitmap() displays the current image.

CIMG_delete_bitmap() deletes image related allocation.

CIMG_decompress_bitmap_page() loads one page of an image from the disk.

CIMG_create_thumbnail() creates a thumbnail with the correct pixel depth and automatically selects the correct resize function for the image.

Tiff Tag

This sample demonstrates how to use the Snowbound .NET library for reading .tif tags. You can select the Load Image button to load the image. You can select the Get TIFF Tag button to

344 Appendix F - .NET Samples get the .tif tag.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component. clearImage() removes the image from memory.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_display_bitmap() displays the current image.

CIMGLOW_get_tiff_tag() reads a tag from the file specified.

WPFAnnotation_CSHARP

This sample demonstrates how to display images and annotations with the Windows Pre- sentation Foundation (WPF) image functions.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() loads one page of an image from the disk.

CSANN_read_ann_WPF() reads annotation objects from a file.

CSANN_write_ann() saves an annotation object to a file.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_merge_annotation() merges the annotation to image.

WPFConversion_CSHARP

This sample demonstrates how to convert with the Windows Presentation Foundation (WPF) image functions.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

345 Appendix F - .NET Samples

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMGLOW_get_pages() retrieves the page count of an image file.

CIMG_decompress_bitmap_page() loads one page of an image from the disk.

CIMG_save_bitmap() saves the image to the disk in any available format.

WPFScanning_CSHARP

This sample demonstrates how to apply scanning with the Windows Presentation Foundation (WPF) image functions.

Note: Snowbound Software supports scanners with TWAIN drivers, but not TWAIN 2 drivers. If you are using RasterMaster .NET x32, you will need an x32 TWAIN driver.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMGLOW_get_pages() retrieves the page count of an image file..

CIMG_decompress_bitmap_page() loads one page of an image from the disk.

CIMG_save_bitmap() saves the image to the disk in any available format.

CIMG_scan_open_source_WPF() selects the available input devices.

CIMG_scan_acquire_WPF() scans an image on the currently selected scanner.

CIMG_scan_acquire_feeder_WPF() scans from a scanner with an automatic document feeder.

CIMG_scan_pages_WPF() scans all pages from the currently selected scanner.

CIMG_scan_get_cap_WPF() returns the value of the current specified TWAIN capability.

CIMG_scan_set_cap_WPF() sets the value of the specified TWAIN capability.

CIMG_scan_setup_WPF() brings up the TWAIN driver’s user interface to set scanning param- eters.

346 Appendix F - .NET Samples

Web Image Viewer Component

This is a windows form control sample that demonstrates how to create a control component which can be embedded in an HTML file that uses the Snowbound library to view web images.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Samples.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap_url() loads an image from a URL address.

CIMG_get_pages_url() gets the document’s page number from a URL address.

CIMGLOW_set_document_input() sets the document input resolution.

CIMGLOW_set_alias() sets the aliasing factor.

CIMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio

CIMG_flip_bitmapx() flips the image horizontally.

CIMG_flip_bitmapy() flips the image vertically.

WPF Image

This sample demonstrates how to the Windows Presentation Foundation (WPF) image func- tions.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample.

Listed below are the functions used in this sample:

CIMG_decompress_bitmap() loads an image from the disk.

CIMG_bitmap_info() gets information about the decompressed image.

CIMG_delete_bitmap() deletes image related allocation.

XPSMem_CSHARP

This sample demonstrates how to decompress from memory for the XPS file format.

You can find the samples in the following directory C:\Program Files\Snowbound Soft- ware\RasterMaster® .NET\Net\Sample\WPF.

Listed below are the functions used in this sample:

Snowbnd() loads the Init Snowbound .NET component.

CIMG_decompress_bitmap_xps_mem() decompresses xps file from memory.

347 Appendix F - .NET Samples

CIMG_bitmap_info() gets information about the decompressed ima

CIMG_get_pages_xps_mem() gets the XPS page number from current file.

CIMG_decompress_bitmap_page() decompresses the given image on the page.

CIMG_save_bitmap() saves the image to the disk in any available format.

348 Appendix G - TIFF Tags

Appendix G - 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, use the CIMGLOW_get_tiff_tag() function. This func- tion 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 spec- ified 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 con- tact Snowbound Technical support on the web at www.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

349 Appendix G - 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 pri- vate IFDs specified by the Exif standard. The other two are the GPS IFD, for positioning infor- mation, 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 Win- dows 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 G.1: TIFF Tags in Numerical Order1

Code Source of Name Description Dec Hex Tag A general indication of the kind of data that is con- tained 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 image in this Baseline file

1 - Image is a single page of a multi-page

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 con- tained in this subfile.

Currently defined values are:

255 00FF SubfileType A general indication of the kind of data that is con- Baseline tained in this subfile.

Currently defined values are:

1 = full resolution image data - ImageWidth, Image-

350 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Length, 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 cor- responding full resolution data.

3 = single page of a multi-page image (see the Page- Number tag description).

Continued use of this field is not recommended. Writers should instead use the new and more gen- eral NewSubfileType field. The image's width, in pixels (X:horizontal). The 256 0100 ImageWidth Baseline number of columns in the image. The image's length (height) in pixels (Y:vertical). 257 0101 ImageLength The number of rows (sometimes described as Baseline "scan lines") in the image. Number of bits per sample. Note that this tag allows a different number of bits per sample for each sam- ple corresponding to a pixel. For example, RGB 258 0102 BitsPerSample color data could use a different number of bits per Baseline 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 as an array of bytes, for BitsPerSample <= 8, word if Bit- sPerSample > 8 and <= 16, and dword if Bit- sPerSample > 16 and <= 32. The byte ordering of data >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.

259 0103 Compression 2 = CCITT Group 3 1-Dimensional Modified Huff- Baseline man run length encoding. See ALGRTHMS.txt Bit- sPerSample 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 fac- simile apparatus for document transmission," Rec- ommendation T.4, Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic

351 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Services, The International Telegraph and Tel- ephone 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-rever- sal 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, Fas- cicle VII.3, Terminal Equipment and Protocols for Telematic Services, The International Telegraph and Telephone 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 Pho- tometricInterpretation value.

1 = For bilevel and grayscale images: 0 is imaged Pho- as black. 2**BitsPerSample-1 is imaged as white. If 262 0106 tom- GrayResponseCurveexists, it overrides the Pho- Baseline etricInterpretationtometricInterpretation 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 mini-

352 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag mum intensity, and 2**BitsPerSample - 1 rep- resents maximum intensity. For Pla- narConfiguration = 1, the samples are stored in the indicated 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 Stri- pOffsets.

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 sup- plied. 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. Sam- plesPerPixel and BitsPerSample must be 1. Pack- Bits compression is recommended. The 1-bits define the interior of the region; the 0-bits define inte- rior 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.

2 = a "dithered" scan, usually of continuous tone 263 0107 Threshholding Baseline data such as photographs. BitsPerSample must be 1.

3 = Error Diffused. The width of the dithering or halftoning matrix used 264 0108 CellWidth Baseline to create a dithered or halftoned bilevel file. The length of the dithering or halftoning matrix used 265 0109 CellLength Baseline to create a dithered or halftoned bilevel file. 266 010A FillOrder The logical order of bits within a byte. Baseline The name of the document from which this image 269 010D DocumentName Extended was scanned. A string that describes the subject of the image. For ImageDe- 270 010E example, a user may wish to attach a comment Baseline scription such as "1988 company picnic" to an image.

353 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Manufacturer of the scanner, video digitizer. 271 010F Make Baseline Mandatory for TIFF/EP. The model name/number of the scanner, video dig- itizer. This tag is intended for user information only 272 0110 Model so format is arbitrary. Baseline

Mandatory for TIFF/EP. For each strip, the byte offset of that strip. The off- set is specified with respect to the beginning of the TIFF file. Note that this implies that each strip has a 273 0111 StripOffsets location independent of the locations of other strips. Baseline 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.

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 right hand side.

4 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual left 274 0112 Orientation Baseline hand side.

5 = The 0th row represents the visual left hand side of the image, and the 0th column represents the vis- ual 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 vis- ual bottom.

354 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 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 appli- cations do not expect a file imported by the appli- cation to be altered permanently in any way.

The default value is 1. The number of samples per pixel. SamplesPerPixel 277 0115 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 when the data is compressed - though this 278 0116 RowsPerStrip field is valid even if the data is not compressed. Baseline 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 279 0117 StripByteCounts Baseline buffering compressed data, if the strip size is rea- sonable. 280 0118 MinSampleValue The minimum component value used. Baseline Max- 281 0119 The maximum component value used. Baseline SampleValue The number of pixels per ResolutionUnit in the X 282 011A XResolution Baseline direction, i.e., in the ImageWidth direction. The number of pixels per ResolutionUnit in the Y 283 011B YResolution Baseline direction, i.e., in the ImageLength direction. 1 = The sample values for each pixel are stored con- tiguously, 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 Strip- Pla- 284 011C ByteCounts are then arranged as a 2-dimensional Baseline narConfiguration array, with SamplesPerPixel rows and Strip- sPerImage 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.

355 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag If SamplesPerPixel is 1, PlanarConfiguration is irrel- evant, and should not be included.

The default is 1. The name of the page from which this image was 285 011D PageName Extended scanned. The X offset of the left side of the image, with 286 011E XPosition respect to the left side of the page, in Res- Extended olutionUnits. The Y offset of the top of the image, with respect to the top of the page, in ResolutionUnits. In the TIFF 287 011F YPosition Extended oordinate scheme, the positive Y direction is down, so that YPosition is always positive. For each string of contiguous unused bytes in a 288 0120 FreeOffsets Baseline TIFF file, the byte offset of the string. For each string of contiguous unused bytes in a 289 0121 FreeByteCounts Baseline TIFF file, the number 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.

GrayRe- 3 = Number represents thousandths of a unit. 290 0122 Baseline sponseUnit 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 pos- sible pixel value. GrayRe- 291 0123 The purpose of the gray response curve and the Baseline sponseCurve gray units is to provide more exact photometric inter- pretation information for gray scale image data, in terms of optical density. Those options are for fax-images stored in TIFF for- mat. 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 292 0124 Group3Options Extended that you don't know the meaning of.

Bit map:

0 - 2-dimensional coding used.

356 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 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.

For 2-D coding, each strip is encoded as if it were a separate image. In particular, each strip begins on a Group4Options 293 0125 byte boundary; and the coding for the first row of a Extended strip is encoded independently of the previous row, using horizontal codes, as if the previous row is entirely white. Each strip ends with the 24-bit end- of-facsimile block (EOFB).

Bit map:

0 - reserved (unused)

1 - uncompressed mode is used

2-31 - reserved To be used with XResolution and YResolution.

1 = No absolute unit of measurement. Used for images that may have a non-square aspect ratio, but no meaningful absolute dimensions. The draw- back of ResolutionUnit=1 is that different appli- cations 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, 296 0128 ResolutionUnit Baseline and pick XResolution and YResolution such that the aspect ratio is correct and the maximum dimen- sion of the image is about four inches (the "four" is quite arbitrary.)

2 = Inch.

3 = Centimeter.

The default is 2. This tag is used to specify page numbers of a mul- 297 0129 PageNumber tiple page (e.g. facsimile) document. Two word Extended values are specified. The first value is the page

357 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag number; the second value is 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 image in tab- 301 012D TransferFunction Extended ular style. Name and release number of the software package 305 0131 Software Baseline that created the image. User information only. Date and time of image creation. Uses the format "YYYY:MM:DD HH:MM:SS", with hours on a 24- 306 0132 DateTime hour clock, and one space character between the Baseline date and the time. The length of the string, including the null, is 20 bytes. 315 013B Artist Person who created the image. Copyright notice. Baseline The computer and/or operating system in use at the 316 013C HostComputer time of image creation. Baseline 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 bor- derline cases.

1 = Continuous tone, natural image.

2 = Synthetic image, using a greatly restricted 318 013E ColorImageType Extended range of colors.

Such images are produced by most color paint pro- grams. 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 319 013F ColorList ColorImageType. Extended

The list is organized as an array of RGB triplets, with no pad. The RGB triplets are not guaranteed to be in any particular order. Note that the red, green,

358 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 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 pal- ette color images. 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 320 0140 ColorMap entries. The width of each entry is 16 bits, as Baseline implied by the type of word. 0 represents the mini- mum intensity, and 65535 represents the maximum intensity.

ColorMap must be included in all palette color images. Conveys to the halftone function the range of gray 321 0141 HalftoneHints levels within a colorimetrically-specified image that Extended should retain tonal detail. The tile width in pixels. This is the number of col- 322 0142 TileWidth Extended umns in each tile. The tile length (height) in pixels. This is the number 323 0143 TileLength Extended of rows in each tile. For each tile, the byte offset of that tile, as com- 324 0144 TileOffsets Extended pressed and stored on disk. For each tile, the number of (compressed) bytes in 325 0145 TileByteCounts Extended that tile. Used in the TIFF-F standard, denotes the number of 326 0146 BadFaxLines 'bad' scan lines encountered by the facsimile Extended device. Used in the TIFF-F standard, indicates if 'bad' lines 327 0147 CleanFaxData encountered during reception are stored in the data, Extended or if 'bad' lines have been replaced by the receiver. Con- Used in the TIFF-F standard, denotes the maximum 328 0148 secu- Extended number of consecutive 'bad' scanlines received. tiveBadFaxLines 330 014A SubIFDs Offset to child IFDs. Extended The set of inks used in a separated (Pho- 332 014C InkSet Extended tometricInterpretation=5) image. 333 014D InkNames The name of each ink used in a separated image. Extended 334 014E NumberOfInks The number of inks. Extended The component values that correspond to a 0% dot 336 0150 DotRange Extended and 100% dot. A description of the printing environment for which 337 0151 TargetPrinter Extended this separation is intended.

359 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 338 0152 ExtraSamples Description of extra components. Baseline Specifies how to interpret each data sample in a 339 0153 SampleFormat Extended pixel. SMin- 340 0154 Specifies the minimum sample value. Extended SampleValue SMax- 341 0155 Specifies the maximum sample value. Extended SampleValue 342 0156 TransferRange Expands the range of the TransferFunction. Extended Mirrors the essentials of PostScript's path creation 343 0157 ClipPath Extended functionality. The number of units that span the width of the 344 0158 XClipPathUnits Extended image, in terms of integer ClipPath coordinates. The number of units that span the height of the 345 0159 YClipPathUnits Extended image, in terms of integer ClipPath coordinates. Aims to broaden the support for indexed images to 346 015A Indexed Extended include support for any color space. 347 015B JPEGTables JPEG quantization and/or Huffman tables. Extended 351 015F OPIProxy OPI-related. Extended Used in the TIFF-FX standard to point to an IFD con- Glob- 400 0190 taining tags that are globally applicable to the com- Extended alParametersIFD plete TIFF file. Used in the TIFF-FX standard, denotes the type of 401 0191 ProfileType Extended data stored in this file or IFD. Used in the TIFF-FX standard, denotes the 'profile' 402 0192 FaxProfile Extended that applies to this file. Used in the TIFF-FX standard, indicates which cod- 403 0193 CodingMethods Extended ing methods are used in the file. Used in the TIFF-FX standard, denotes the year of 404 0194 VersionYear Extended the standard specified by the FaxProfile field. Used in the TIFF-FX standard, denotes the mode of 405 0195 ModeNumber Extended the standard specified by the FaxProfile field. Used in the TIFF-F and TIFF-FX standards, holds 433 01B1 Decode information about the ITULAB (Pho- Extended tometricInterpretation = 10) encoding. Defined in the Mixed Raster Content part of RFC Default- 434 01B2 2301, is the default color needed in areas where no Extended ImageColor image is available. Old-style JPEG compression field. TechNote2 inval- 512 0200 JPEGProc Extended idates this part of the specification. JPEG- Old-style JPEG compression field. TechNote2 inval- 513 0201 Inter- Extended idates this part of the specification. changeFormat JPEG- Old-style JPEG compression field. TechNote2 inval- 514 0202 Extended Inter- idates this part of the specification.

360 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag change- FormatLength JPE- Old-style JPEG compression field. TechNote2 inval- 515 0203 Extended GRestartInterval idates this part of the specification. JPE- Old-style JPEG compression field. TechNote2 inval- 517 0205 GLoss- Extended idates this part of the specification. lessPredictors JPEG- Old-style JPEG compression field. TechNote2 inval- 518 0206 Extended PointTransforms idates this part of the specification. Old-style JPEG compression field. TechNote2 inval- 519 0207 JPEGQTables Extended idates this part of the specification. Old-style JPEG compression field. TechNote2 inval- 520 0208 JPEGDCTables Extended idates this part of the specification. Old-style JPEG compression field. TechNote2 inval- 521 0209 JPEGACTables Extended idates this part of the specification. The transformation from RGB to YCbCr image YCbCrCoef- 529 0211 data. Extended ficients Mandatory for TIFF/EP YCbCr images. YCbCrSub- Specifies the subsampling factors used for the 530 0212 Extended Sampling chrominance components of a YCbCr image. YCbCrPo- Specifies the positioning of subsampled chrom- 531 0213 Extended sitioning inance components relative to luminance samples. Ref- Specifies a pair of headroom and footroom image 532 0214 erence- Extended data values (codes) for each pixel component. BlackWhite Defined in the Mixed Raster Content part of RFC 559 022F StripRowCounts 2301, used to replace RowsPerStrip for IFDs with Extended variable-sized strips. 700 02BC XMP XML packet containing XMP metadata Extended 327- 800D ImageID OPI-related. Extended 81 329- 80A4 Wang Annotation Annotation data, as used in 'Imaging for Windows. Private 32 334- CFARe- For camera raw files from sensors with CFA over- TIFF/EP 828D 21 peatPatternDim lay. spec, p. 23 334- For camera raw files from sensors with CFA over- TIFF/EP 828E CFAPattern 22 lay. spec, p. 23 334- Encodes camera battery level at time of image cap- TIFF/EP 828F BatteryLevel 23 ture. spec, p. 45 334- 8298 Copyright Copyright notice. Baseline 32 334- Exif Pri- 829A ExposureTime Exposure time given in seconds. 34 vate IFD

361 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag TIFF/EP spec, p. 38 Exif Pri- 334- vate IFD 829D FNumber The F number. 37 TIFF/EP spec, p. 39 334- Specifies the pixel data format encoding in the 82A5 MD FileTag Private 45 Molecular Dynamics GEL file format. 334- Specifies a scale factor in the Molecular Dynamics 82A6 MD ScalePixel Private 46 GEL file format. 334- Used to specify the conversion from 16bit to 8bit in 82A7 MD ColorTable Private 47 the Molecular Dynamics GEL file format. 334- Name of the lab that scanned this file, as used in 82A8 MD LabName Private 48 the Molecular Dynamics GEL file format. 334- Information about the sample, as used in the Molec- 82A9 MD SampleInfo Private 49 ular Dynamics GEL file format. 334- Date the sample was prepared, as used in the 82AA MD PrepDate Private 50 Molecular Dynamics GEL file format. 334- Time the sample was prepared, as used in the 82AB MD PrepTime Private 51 Molecular Dynamics GEL file format. 334- Units for data in this file, as used in the Molecular 82AC MD FileUnits Private 52 Dynamics GEL file format. 335- Mod- 830E Used in interchangeable GeoTIFF_1_0 files. Private 50 elPixelScaleTag IPTC-NAA (International Press Tel- 337- TIFF/EP 83BB IPTC/NAA ecommunications Council-Newspaper Association 23 spec, p. 33 of America) metadata. 339- INGR Packet 847E Intergraph Application specific storage. Private 18 Data Tag 339- INGR Flag Reg- 847F Intergraph Application specific flags. Private 19 isters 339- IrasB Trans- Originally part of Intergraph's GeoTIFF tags, but 8480 Private 20 formation Matrix likely understood by IrasB only. Originally part of Intergraph's GeoTIFF tags, but 339- Mod- now used in interchangeable GeoTIFF_1_0 files. In 8482 Private 22 elTiepointTag GeoTIFF_1_0, either this tag or 34264 must be defined, but not both 340- TIFF/IT Site Site where image created. 16 spec, 7.2.3 TIFF/IT 340- ColorSequence Sequence of colors if other than CMYK. spec, 17 7.2.8.3.2 340- TIFF/IT IT8Header Certain inherited headers. 18 spec, 7.2.3

362 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 340- TIFF/IT RasterPadding Type of raster padding used, if any. 19 spec, 7.2.6 340- Bit- TIFF/IT Number of bits for short run length encoding. 20 sPerRunLength spec, 7.2.6 Bit- 340- TIFF/IT sPer- Number of bits for long run length encoding. 21 spec, 7.2.6 ExtendedRunLength TIFF/IT 340- ColorTable Color value in a color pallette. spec, 22 7.2.8.4 340- Image- Indicates if image (foreground) color or trans- TIFF/IT 23 ColorIndicator parency is specified. spec, 7.2.9 Back- 340- TIFF/IT ground- Background color specification. 24 spec, 7.2.9 ColorIndicator TIFF/IT 340- ImageColorValue Specifies image (foreground) color. spec, 25 7.2.8.4 Back- TIFF/IT 340- ground- Specifies background color. spec, 26 ColorValue 7.2.8.4 TIFF/IT 340- Pix- Specifies data values for 0 percent and 100 percent spec, 27 elIntensityRange pixel intensity. 7.2.8.4 TIFF/IT 340- Trans- Specifies if transparency is used in HC file. spec, 28 parencyIndicator 7.2.8.4 Col- TIFF/IT 340- Specifies ASCII table or other reference per ISO orChar- spec, 29 12641 and ISO 12642. acterization 7.2.8.4 340- TIFF/IT HCUsage Indicates the type of information in an HC file. 30 spec, 7.2.6 340- Indicates whether or not trapping has been applied TIFF/IT TrapIndicator 31 to the file. spec, 7.2.6 TIFF/IT 340- Specifies CMYK equivalent for specific sep- CMYKEquivalent spec, 32 arations. 7.2.8.3.4 340- TIFF/IT Reserved For future TIFF/IT use 33 spec 340- TIFF/IT Reserved For future TIFF/IT use 34 spec 340- TIFF/IT Reserved For future TIFF/IT use 35 spec 342- 85D8 Mod- Used in interchangeable GeoTIFF_1_0 files. In Geo-Private

363 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag elTrans- TIFF_1_0, either this tag or 33922 must be defined, 64 formationTag but not both 343- 8649 Photoshop Collection of Photoshop 'Image Resource Blocks. Private 77 346- 8769 Exif IFD A pointer to the Exif IFD. Private 65 346- TIFF/EP 8773 InterColorProfile ICC profile data. 75 spec, p. 47 Defined in the Mixed Raster Content part of RFC 347- 87AC ImageLayer 2301, used to denote the particular function of this Extended 32 Image in the mixed raster scheme. 347- Geo- Used in interchangeable GeoTIFF_1_0 files. Man- 87AF Private 35 KeyDirectoryTag datory in GeoTIFF_1_0. Geo- 347- 87B0 Dou- Used in interchangeable GeoTIFF_1_0 files. Private 36 bleParamsTag 347- GeoAs- 87B1 Used in interchangeable GeoTIFF_1_0 files. Private 37 ciiParamsTag Exif Pri- 348- Expo- The class of the program used by the camera to set vate IFD 8822 50 sureProgram exposure when the picture is taken. TIFF/EP spec, p. 41 Exif Pri- 348- Spec- Indicates the spectral sensitivity of each channel of vate IFD 8824 52 tralSensitivity the camera used. TIFF/EP spec, p. 48 348- TIFF/EP 8825 GPSInfo A pointer to the Exif-related GPS Info IFD. 53 spec, p. 34 Exif Pri- 348- ISO- Indicates the ISO Speed and ISO Latitude of the vate IFD 8827 55 SpeedRatings camera or input device as specified in ISO 12232. TIFF/EP spec, p. 47 Exif Pri- 348- Indicates the Opto-Electric Conversion Function vate IFD 8828 OECF 56 (OECF) specified in ISO 14524. TIFF/EP spec, p. 48 348- TIFF/EP 8829 Interlace Indicates the field number of multifield images. 57 spec, p. 22 348- Encodes time zone of camera clock relative to TIFF/EP 882A TimeZoneOffset 58 GMT. spec, p. 38 348- Number of seconds image capture was delayed TIFF/EP 882B SelfTimeMode 59 from button press. spec, p. 45

364 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 349- HylaFAX Fax- 885C Used by HylaFAX. Private 08 RecvParams 349- HylaFAX Fax- 885D Used by HylaFAX. Private 09 SubAddress 349- HylaFAX Fax- 885E Used by HylaFAX. Private 10 RecvTime 368- The version of the supported Exif standard. Man- Exif Pri- 9000 ExifVersion 64 datory in the Exif IFD. vate IFD Exif Pri- 368- Date- The date and time when the original image data was vate IFD 9003 67 TimeOriginal generated. Mandatory for TIFF/EP. TIFF/EP spec, p. 37 368- Date- The date and time when the image was stored as Exif Pri- 9004 68 TimeDigitized digital data. vate IFD Com- 371- Specific to compressed data; specifies the chan- Exif Pri- 9101 ponent- 21 nels and complements PhotometricInterpretation vate IFD sConfiguration Exif Pri- Com- 371- Specific to compressed data; states the com- vate IFD 9102 pressed- 22 pressed bits per pixel. BitsPerPixel TIFF/EP spec, p. 27 Exif Pri- 373- Shut- vate IFD 9201 Shutter speed. 77 terSpeedValue TIFF/EP spec, p. 39 Exif Pri- 373- vate IFD 9202 ApertureValue The lens aperture. 78 TIFF/EP spec, p. 39 Exif Pri- 373- vate IFD 9203 BrightnessValue The value of brightness. 79 TIFF/EP spec, p. 40 Exif Pri- 373- Expo- vate IFD 9204 The exposure bias. 80 sureBiasValue TIFF/EP spec, p. 40 Exif Pri- 373- Max- vate IFD 9205 The smallest F number of the lens. 81 ApertureValue TIFF/EP spec, p. 40

365 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Exif Pri- 373- vate IFD 9206 SubjectDistance The distance to the subject, given in meters. 82 TIFF/EP spec, p. 44 Exif Pri- 373- vate IFD 9207 MeteringMode The metering mode. 83 TIFF/EP spec, p. 41 Exif Pri- 373- vate IFD 9208 LightSource The kind of light source. 84 TIFF/EP spec, p. 46 Exif Pri- 373- Indicates the status of flash when the image was vate IFD 9209 Flash 85 shot. TIFF/EP spec, p. 42 Exif Pri- 373- vate IFD 920A FocalLength The actual focal length of the lens, in mm. 86 TIFF/EP spec, p. 44 373- TIFF/EP 920B FlashEnergy Amount of flash energy (BCPS). 87 spec, p. 43 Spa- 373- TIFF/EP 920C tial- SFR of the camera. 88 spec, p. 49 FrequencyResponse 373- TIFF/EP 920D Noise Noise measurement values. 89 spec, p. 49 Focal- 373- Number of pixels per FocalPlaneResolutionUnit TIFF/EP 920E Plan- 90 (37392) in ImageWidth direction for main image. spec, p. 18 eXResolution Focal- 373- Number of pixels per FocalPlaneResolutionUnit TIFF/EP 920F Pla- 91 (37392) in ImageLength direction for main image. spec, p. 19 neYResolution Focal- 373- Unit of measurement for FocalPlaneXResolution TIFF/EP 9210 Plan- 92 (37390) and FocalPlaneYResolution(37391). spec, p. 19 eResolutionUnit 373- Number assigned to an image, e.g., in a chained TIFF/EP 9211 ImageNumber 93 image burst. spec, p. 32 373- Secu- TIFF/EP 9212 Security classification assigned to the image. 94 rityClassification spec, p. 33 373- TIFF/EP 9213 ImageHistory Record of what has been done to the image. 95 spec, p. 33

366 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Exif Pri- 373- Indicates the location and area of the main subject vate IFD 9214 SubjectLocation 96 in the overall scene. TIFF/EP spec, p. 45 373- Encodes the camera exposure index setting when TIFF/EP 9215 ExposureIndex 97 image was captured. spec, p. 47 373- TIFF/EP- For current spec, tag value equals 1 0 0 0. TIFF/EP 9216 98 StandardID Mandatory in TIFF/EP. spec, p. 16 373- Type of image sensor. TIFF/EP 9217 SensingMethod 99 Mandatory in TIFF/EP. spec, p. 22 375- Exif Pri- 927C MakerNote Manufacturer specific information. 00 vate IFD 375- Keywords or comments on the image; com- Exif Pri- 9286 UserComment 10 plements ImageDescription. vate IFD 375- A tag used to record fractions of seconds for the Exif Pri- 9290 SubsecTime 20 DateTime tag. vate IFD 375- Sub- A tag used to record fractions of seconds for the Exif Pri- 9291 21 secTimeOriginal DateTimeOriginal tag. vate IFD Sub- 375- A tag used to record fractions of seconds for the Exif Pri- 9292 sec- 22 DateTimeDigitized tag. vate IFD TimeDigitized 377- Image- 935C Used by Adobe Photoshop. Private 24 SourceData The Flashpix format version supported by a FPXR 409- Exif Pri- A000 FlashpixVersion file., 60 vate IFD Mandatory in the Exif IFD The color space information tag is always recorded 409- Exif Pri- A001 ColorSpace as the color space specifier. 61 vate IFD Mandatory in the Exif IFD. 409- Specific to compressed data; the valid width of the Exif Pri- A002 PixelXDimension 62 meaningful image. vate IFD 409- Specific to compressed data; the valid height of the Exif Pri- A003 PixelYDimension 63 meaningful image. vate IFD 409- Relat- Used to record the name of an audio file related to Exif Pri- A004 64 edSoundFile the image data. vate IFD 409- Interoperability A005 A pointer to the Exif-related Interoperability IFD. Private 65 IFD Indicates the strobe energy at the time the image is 414- Exif Pri- A20B FlashEnergy captured, as measured in Beam Candle Power Sec- 83 vate IFD onds 414- A20C Spa- Records the camera or input device spatial Exif Pri-

367 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag tial- frequency table and SFR values in the direction of 84 Frequen- image width, image height, and diagonal direction, vate IFD cyResponse as specified in ISO 12233. Focal- Indicates the number of pixels in the image width 414- Exif Pri- A20E Plan- (X) direction per FocalPlaneResolutionUnit on the 86 vate IFD eXResolution camera focal plane. Focal- Indicates the number of pixels in the image height 414- Exif Pri- A20F Pla- (Y) direction per FocalPlaneResolutionUnit on the 87 vate IFD neYResolution camera focal plane. Focal- 414- Indicates the unit for measuring Focal- Exif Pri- A210 Plan- 88 PlaneXResolution and FocalPlaneYResolution. vate IFD eResolutionUnit 414- Indicates the location of the main subject in the Exif Pri- A214 SubjectLocation 92 scene. vate IFD Indicates the exposure index selected on the cam- 414- Exif Pri- A215 ExposureIndex era or input device at the time the image is cap- 93 vate IFD tured. 414- Indicates the image sensor type on the camera or Exif Pri- A217 SensingMethod 95 input device. vate IFD 417- Exif Pri- A300 FileSource Indicates the image source. 28 vate IFD 417- Exif Pri- A301 SceneType Indicates the image source. 29 vate IFD Indicates the color filter array (CFA) geometric pat- 417- Exif Pri- A302 CFAPattern tern of the image sensor when a one-chip color area 30 vate IFD sensor is used. 419- Cus- Indicates the use of special processing on image Exif Pri- A401 85 tomRendered data, such as rendering geared to output. vate IFD 419- Indicates the exposure mode set when the image Exif Pri- A402 ExposureMode 86 was shot. vate IFD 419- Indicates the white balance mode set when the Exif Pri- A403 WhiteBalance 87 image was shot. vate IFD 419- Dig- Indicates the digital zoom ratio when the image was Exif Pri- A404 88 italZoomRatio shot. vate IFD Focal- 419- Indicates the equivalent focal length assuming a Exif Pri- A405 Length- 89 35mm film camera, in mm. vate IFD In35mmFilm 419- Scene- Exif Pri- A406 Indicates the type of scene that was shot. 90 CaptureType vate IFD 419- Indicates the degree of overall image gain adjust- Exif Pri- A407 GainControl 91 ment. vate IFD 419- Indicates the direction of contrast processing Exif Pri- A408 Contrast 92 applied by the camera when the image was shot. vate IFD 419- A409 Saturation Indicates the direction of saturation processing Exif Pri-

368 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 93 applied by the camera when the image was shot. vate IFD 419- Indicates the direction of sharpness processing Exif Pri- A40A Sharpness 94 applied by the camera when the image was shot. vate IFD Device- 419- This tag indicates information on the picture-taking Exif Pri- A40B Set- 95 conditions of a particular camera model. vate IFD tingDescription Sub- 419- Exif Pri- A40C ject- Indicates the distance to the subject. 96 vate IFD DistanceRange 420- Indicates an identifier assigned uniquely to each Exif Pri- A420 ImageUniqueID 16 image. vate IFD Used by the GDAL library, holds an XML list of 421- GDAL_META- A480 name=value 'metadata' values about the image as Private 12 DATA a whole, and about specific samples. 421- Used by the GDAL library, contains an ASCII A481 GDAL_NODATA Private 13 encoded nodata or background pixel value. HD Photo 481- A 128-bit Globally Unique Identifier (GUID) that iden- BC01 PixelFormat Feature 29 tifies the image pixel format. Spec, p. 17 Specifies the transformation to be applied when HD Photo 481- BC02 Transformation decoding the image to present the desired rep- Feature 30 resentation. Spec, p. 23 HD Photo 481- BC03 Uncompressed Specifies that image data is uncompressed. Feature 31 Spec, p. 23 HD Photo 481- Specifies the image type of each individual frame in BC04 ImageType Feature 32 a multi-frame file. Spec, p. 27 HD Photo 482- The image's width, in pixels (X:horizontal). The BC80 ImageWidth Feature 56 number of columns in the image. Spec, p. 21 HD Photo 482- Specifies the number of pixels or scan lines in the BC81 ImageHeight Feature 57 transformed photo. Spec, p. 21 HD Photo 482- Specifies the horizontal resolution of a transformed BC82 WidthResolution Feature 58 image expressed in pixels per inch. Spec, p. 21 HD Photo 482- Specifies the vertical resolution of a transformed BC83 HeightResolution Feature 59 image expressed in pixels per inch. Spec, p. 21 HD Photo 483- Specifies the byte offset pointer to the beginning of BCC0 ImageOffset Feature 20 the photo data, relative to the beginning of the file. Spec, p. 22 483- BCC1 ImageByteCount Specifies the size of the photo in bytes. HD Photo

369 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Feature 21 Spec, p. 22 Specifies the byte offset pointer the beginning of the HD Photo 483- BCC2 AlphaOffset planar alpha channel data, relative to the beginning Feature 22 of the file. Spec, p. 22 HD Photo 483- Specifies the size of the alpha channel data in BCC3 AlphaByteCount Feature 23 bytes. Spec, p. 23 Signifies the level of data that has been discarded HD Photo 483- Image- BCC4 from the image as a result of a compressed domain Feature 24 DataDiscard transcode to reduce the file size. Spec, p. 25 Signifies the level of data that has been discarded HD Photo 483- Alpha- BCC5 from the planar alpha channel as a result of a com- Feature 25 DataDiscard pressed domain transcode to reduce the file size. Spec, p. 26 HD Photo 481- Specifies the image type of each individual frame in BC04 ImageType Feature 32 a multi-frame file. Spec, p. 27 502- Oce Scanjob C427 Used in the Oce scanning process. Private 15 Description 502- Oce Application C428 Used in the Oce scanning process. Private 16 Selector 502- Oce Iden- C429 Used in the Oce scanning process. Private 17 tification Number 502- Oce ImageLogic C42A Used in the Oce scanning process. Private 18 Characteristics Encodes DNG four-tier version number; for version 507- DNG spec, C612 DNGVersion 1.1.0.0, the tag contains the bytes 1, 1, 0, 0. Used 06 p. 17 in IFD 0 of DNG files. 507- DNGBack- Defines oldest version of spec with which file is DNG spec, C613 07 wardVersion compatible. Used in IFD 0 of DNG files. p. 17 507- Unique- Unique, non-localized nbame for camera model. DNG spec, C614 08 CameraModel Used in IFD 0 of DNG files. p. 18 Local- 507- Similar to 50708, with localized camera name. DNG spec, C615 ized- 09 Used in IFD 0 of DNG files. p. 19 CameraModel Mapping between values in the CFAPattern tag and 507- the plane numbers in LinearRaw space. Used in DNG spec, C616 CFAPlaneColor 10 Raw IFD of DNG files. p. 19 Required for non-RGB CFA images. 507- Spatial layout of the CFA. Used in Raw IFD of DNG spec, C617 CFALayout 11 DNG files. p. 20 507- Lin- Lookup table that maps stored values to linear DNG spec, C618 12 earizationTable values. Used in Raw IFD of DNG files. p. 20 507- C619 Black- Repeat pattern size for BlackLevel tag. Used in DNG spec,

370 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag 13 LevelRepeatDim Raw IFD of DNG files. p. 21 507- Specifies the zero light encoding level.Used in Raw DNG spec, C61A BlackLevel 14 IFD of DNG files. p. 21 Specifies the difference between zero light encod- 507- Black- DNG spec, C61B ing level for each column and the baseline zero light 15 LevelDeltaH p. 22 encoding level. Used in Raw IFD of DNG files. Specifies the difference between zero light encod- 507- Black- DNG spec, C61C ing level for each row and the baseline zero light 16 LevelDeltaV p. 23 encoding level. Used in Raw IFD of DNG files. 507- Specifies the fully saturated encoding level for the DNG spec, C61D WhiteLevel 17 raw sample values. Used in Raw IFD of DNG files. p. 23 For cameras with non-square pixels, specifies the 507- default scale factors for each direction to convert DNG spec, C61E DefaultScale 18 the image to square pixels. Used in Raw IFD of p. 24 DNG files. Specifies the origin of the final image area, ignoring 507- Default- DNG spec, C61F the extra pixels at edges used to prevent inter- 19 CropOrigin p. 25 polation artifacts. Used in Raw IFD of DNG files. 507- Specifies size of final image area in raw image coor-DNG spec, C620 DefaultCropSize 20 dinates. Used in Raw IFD of DNG files. p. 25 Defines a transformation matrix that converts XYZ 507- values to reference camera native color space DNG spec, C621 ColorMatrix1 21 values, under the first calibration illuminant. Used in p. 27 IFD 0 of DNG files. Defines a transformation matrix that converts XYZ 507- values to reference camera native color space DNG spec, C622 ColorMatrix2 22 values, under the second calibration illuminant. p. 28 Used in IFD 0 of DNG files. Defines a calibration matrix that transforms ref- 507- Cam- erence camera native space values to individual DNG spec, C623 23 eraCalibration1 camera native space values under the first cal- p. 28 ibration illuminant. Used in IFD 0 of DNG files. Defines a calibration matrix that transforms ref- 507- Cam- erence camera native space values to individual DNG spec, C624 24 eraCalibration2 camera native space values under the second cal- p. 29 ibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction matrix for use as 507- Reduc- the first stage in converting color camera native DNG spec, C625 25 tionMatrix1 space values to XYZ values, under the first cal- p. 30 ibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction matrix for use as 507- Reduc- the first stage in converting color camera native DNG spec, C626 26 tionMatrix2 space values to XYZ values, under the second cal- p. 30 ibration illuminant. Used in IFD 0 of DNG files.

371 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Pertaining to white balance, defines the gain, either 507- DNG spec, C627 AnalogBalance analog or digital, that has been applied to the stored 27 p. 31 raw values. Used in IFD 0 of DNG files. Specifies the selected white balance at the time of 507- capture, encoded as the coordinates of a perfectly DNG spec, C628 AsShotNeutral 28 neutral color in linear reference space values. Used p. 31 in IFD 0 of DNG files. Specifies the selected white balance at the time of 507- DNG spec, C629 AsShotWhiteXY capture, encoded as x-y chromaticity coordinates. 29 p. 32 Used in IFD 0 of DNG files. Specifies in EV units how much to move the zero 507- Base- DNG spec, C62A point for exposure compensation. Used in IFD 0 of 30 lineExposure p. 32 DNG files. Specifies the relative noise of the camera model at 507- DNG spec, C62B BaselineNoise a baseline ISO value of 100, compared to reference 31 p. 33 camera model. Used in IFD 0 of DNG files. Specifies the relative amount of sharpening required 507- Base- DNG spec, C62C for this camera model, compared to reference cam- 32 lineSharpness p. 33 era model. Used in IFD 0 of DNG files. For CFA images, specifies, in arbitrary units, how closely the values of the green pixels in the 507- DNG spec, C62D BayerGreenSplit blue/green rows track the values of the green pixels 33 p. 34 in the red/green rows. Used in Raw IFD of DNG files. Lin- Specifies the fraction of the encoding range above 507- DNG spec, C62E ear- which the response may become significantly non- 34 p. 34 ResponseLimit linear. Used in IFD 0 of DNG files. 507- Cam- Serial number of camera. Used in IFD 0 of DNG DNG spec, C62F 35 eraSerialNumber files. p. 35 507- Information about the lens. Used in IFD 0 of DNG DNG spec, C630 LensInfo 36 files. p. 35 Normally for non-CFA images, provides a hint about 507- Chro- DNG spec, C631 how much chroma blur ought to be applied. Used in 37 maBlurRadius p. 36 Raw IFD of DNG files. 507- Anti- Provides a hint about the strength of the camera's DNG spec, C632 38 AliasStrength anti-aliasing filter. Used in Raw IFD of DNG files. p. 36 507- Used by Adobe Camera Raw to control sensitivity DNG spec, ShadowScale 39 of its shadows slider. Used in IFD 0 of DNG files. p. 38 Provides a way for camera manufacturers to store 507- DNG spec, C634 DNGPrivateData private data in DNG files for use by their own raw 40 p. 37 convertors. Used in IFD 0 of DNG files. Lets the DNG reader know whether the Exif Mak- 507- Mak- DNG spec, C635 erNote tag is safe to preserve. Used in IFD 0 of 41 erNoteSafety p. 38 DNG files.

372 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag Cal- 507- Illuminant used for first set of calibration tags. Used DNG spec, C65A ibra- 78 in IFD 0 of DNG files. p. 26 tionIlluminant1 Cal- 507- Illuminant used for second set of calibration tags. DNG spec, C65B ibra- 79 Used in IFD 0 of DNG files. p. 26 tionIlluminant2 Specifies the amount by which the values of the 507- Best- DefaultScale tag need to be multiplied to achieve DNG spec, C65C 80 QualityScale best quality image size. Used in Raw IFD of DNG p. 24 files. Contains a 16-byte unique identifier for the raw 507- Raw- DNG spec, image file in the DNG file. Used in IFD 0 of DNG 81 DataUniqueID p. 39 files. 507- Alias Layer Meta- C660 Alias Sketchbook Pro layer usage description. Private 84 data Orig- Name of original file if the DNG file results from con- 508- DNG spec, inal- version from a non-DNG raw file. Used in IFD 0 of 27 p. 39 RawFileName DNG files. If the DNG file was converted from a non-DNG raw 508- Orig- DNG spec, file, then this tag contains the original raw data. 28 inalRawFileData p. 40 Used in IFD 0 of DNG files. 508- Defines the active (non-masked) pixels of the sen- DNG spec, ActiveArea 29 sor. Used in Raw IFD of DNG files. p. 41 List of non-overlapping rectangle coordinates of 508- fully masked pixels, which can optimally be used by DNG spec, MaskedAreas 30 DNG readers to measure the black encoding level. p. 42 Used in Raw IFD of DNG files. Contains ICC profile that, in conjunction with the AsShotPreProfileMatrix tag, specifies a default 508- AsS- DNG spec, color rendering from camera color space coor- 31 hotICCProfile p. 42 dinates (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 cam- AsS- 508- era color space coordinates before processing the DNG spec, hot- 32 values through the ICC profile specified in the AsS- p. 43 PreProfileMatrix hotICCProfile tag. Used in IFD 0 of DNG files. The CurrentICCProfile and CurrentPreProfileMatrix tags have the same purpose and usage as the AsS- 508- Cur- hotICCProfile and AsShotPreProfileMatrix tag pair, DNG spec, 33 rentICCProfile except they are for use by raw file editors rather p. 44 than camera manufacturers. Used in IFD 0 of DNG files. Cur- 508- The CurrentICCProfile and CurrentPreProfileMatrix DNG spec, rent- 34 tags have the same purpose and usage as the AsS- p. 44 PreProfileMatrix

373 Appendix G - TIFF Tags

Code Source of Name Description Dec Hex Tag hotICCProfile and AsShotPreProfileMatrix tag pair, except they are for use by raw file editors rather than camera manufacturers. Used in IFD 0 of DNG files.

1Content for base and extended tags used by permission of the author, Max Maischein.

374 Appendix H - Snowbound Error Codes

Appendix H - Snowbound Error Codes

This appendix describes the error codes that are returned by function execution problems.

The text for any of the error codes described in the table below can be obtained by calling ToEr- rorMessage().

Detailed Status/Error Codes

Table H.1: Error Codes

Error Error Code Description Failed on memory allocation. Problem with a stand- ard memory allocation. Please see ‘‘Determining OUT_OF_MEMORY -1 Memory Requirements’’ in Chapter 2 for more infor- mation on the the amount of memory required. Open call failed when trying to decompress an FILE_NOT_FOUND -2 image. CORRUPTED_FILE -3 File format bad, or unreadable. BAD_STRING -4 String passed in is null or invalid. Internal DLL problem. Submit a support issue at www.support.snowbound.com and attach the doc- BAD_RETURN -5 ument you were processing when you received this error. Fail on saving when attempting to create a new file. On this error check that you have permission to CANT_CREATE_FILE -6 write to that directory and that there is sufficient space available on the storage device. Image was not recognized as a format the library FORMAT_NOT_ can decompress. Please see Appendix B, ‘‘Support -7 ALLOWED File Formats’’ to see if the file format is optional or requires special handling. Getobject() call failed to return bitmap header for using DDB functions or may be returned in formats NO_BITMAP_FOUND -8 that can contain vector information such as .WPG, .WMF and .PCT if no bitmap information is found. Error writing data to the disk. Standard file i/o write DISK_FULL -9 failed. Tried to display with negative coordinates or out of BAD_DISPLAY_AREA -10 range. Used for multi-page file format support when PAGE_NOT_FOUND -11 attempting to access a page which does not exist. File format was truncated and tried to read past end DISK_READ_ERROR -12 of file. Standard read i/o function failed. BAD_HANDLE -13 Application passed bad image handle. Not a valid

375 Appendix H - Snowbound Error Codes

Error Error Code Description Snowbound library image handle. NO_CLIPBOARD_ -14 Image not found on clipboard. IMAGE NO_SCANNER_ TWAIN scanner driver not installed or not found -15 FOUND (TWAIN.DLL). ERROR_OPENING_ -16 Bad scanner driver or driver not configured properly. SCANNER CANT_FIND_TWAIN_ TWAIN scanner driver not installed or not found -17 DLL (TWAIN.DLL). Cancel out of low level save or low level decom- USER_CANCEL -18 press. Usually not an error but termination of a func- tion intentionally. Date on an evaluation copy of the Snowbound prod- EVAL_TIMEOUT -19 uct has expired. USING_RUNTIME -20 Version not allowed for design mode. Tried to save an image to a format that does not sup- port the image’s bits per pixel. Or tried to perform an PIXEL_DEPTH_ image processing function on an image whose bits -21 UNSUPPORTED per pixel is not allowed. Please see Appendix B, ‘‘Support File Formats’’ for the pixel depths of each supported format. PALETTE_IMAGES_ Some image processing operations does not work -22 NOT_ALLOWED on palette images. NO_LZW_VERSION -23 No LZW or GIF code in this version. DLL not loaded for Win 3.x version. There was an error loading a DLL. Please open a support issue at DLL_NOT_LOADED -24 www.support.snowbound.com and attach the doc- ument you were processing when you received this error FORMAT_WILL_NOT_ -25 Format will not support on the fly decompression. OTFLY NO_TCOLOR_FOUND -26 No transparency color information found. COMPRESSION_ -27 Currently not supporting this compression format. NOT_SUPPORTED Returned when scanning has completed all pages NO_MORE_PAGES -28 in the document feeder. FEEDER_NOT_ -29 No more pages ready in document feeder. READY NO_DELAY_TIME_ -30 No delay time was found for the animated GIF. FOUND TIFF_TAG_NOT_ -31 Could not find the .TIF tag. FOUND NOT_A_TILED_ -32 Not recognized as a TIFF tiled image. IMAGE NOT_SUPPORTED_ -33 You are using a version that does not support this

376 Appendix H - Snowbound Error Codes

Error Error Code Description function. You do not have support for this file for- mat. You may contact support or your account rep- IN_THIS_VERSION resentative to get information on the RasterMaster option that will allow you to process the file format. AUTOFEED_FAILED -34 Autofeed fail in the TWAIN Scanner. NO_FAST_TWAIN_ -35 TWAIN driver cannot do fast transfer. SUPPORTED The PDF processing option was not found. If you have the PDF processing option, please make sure NO_PDF_VERSION -36 the name of the directory containing Snowbound's pdfplug.dll is in the System environment variable Path. NO_ABIC_VERSION -37 No ABIC plug-in code in this version. Internal error. An exception occurred during proc- essing. Please enter a support ticket at sup- port.snowbound.com providing the document that EXCEPTION_ERROR -38 was being processed. If the RasterMaster function being called was not a decompress bitmap, then please include a small sample program that can be used to reproduce the issue. NO_VECTOR_ -39 No vector plug-in found in this version. CAPABILITY The PDF processing option was not found. If you have the PDF processing option, please make sure NO_PCL_VERSION -40 the name of the directory containing Snowbound's pclplug.dll is in the System environment variable Path. NO_JPEG2000_VER- -41 NO JPEG2000 plug-in found in this version. SION SEARCH_STRING_ -42 Did not find attempted search string. NOT_FOUND The PDF processing option was not found. If you have the PDF processing option, please make sure NO_WORD_VERSION-43 the name of the directory containing Snowbound's docplug.dll is in the System environment variable Path. PASSWORD_PRO- -44 This PDF file was a password protected. TECTED_PDF The Snowbound method was not found. Please METHOD_NOT_ -45 check the spelling of the method name and Snow- FOUND bound library version. Access denied. Please check the security per- ACCESS_DENIED -46 missions. BAD_LICENSE_PRI- Primary level license loaded is bad. MARY -47 BAD_LICENSE_SEC- Secondary level license loaded is bad.

377 Appendix H - Snowbound Error Codes

Error Error Code Description ONDARY PASSWORD_PRO- This file was password protected for Word or other -48 TECTED_FILE formats. OOXML_LICENSE_ -52 The OOXML Aspose license file was not found. NOT_FOUND OOXML_LICENSE_ The OOXML Aspose license file expired or is other- -53 EXPIRED wise invalid.

General Error Define Values Retrieved from Status Prop- erty

Note: Older error define values are retrieved from the StatusDetails Property.

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

Value Error Code Description GENERAL_STATUS. If an internal exception is thrown, -100 SYSTEM_CRASH this is the resulting value. GENERAL_STATUS. -101 Image data of the object failed DELETE_ERROR GENERAL_STATUS. What the internal values are initially -102 DEFAULT set to GENERAL STATUS. 1 Operation completed successfully SNOWBND_OK GENERAL STATUS. Operation failed. See Stat- -1 SNOWBND_ERROR usDetails property. GENERAL_STATUS. Internal image data unavailable when -103 IMAGE_NOT_AVAILABLE trying to complete an operation GENERAL STATUS. SNOWBND_API_NOT_AVAIL- -104 API is not implemented ABLE GENERAL STATUS. -105 Parameter is not valid NOT_VALID GENERAL STATUS. -106 General error display DISPLAY_ERROR

378 Appendix H - Snowbound Error Codes

General Status/Error Codes

Table H.3: General Status/Error Codes

Error Description The image in memory cannot be DELETE_ERROR removed. Any problems with displaying an DISPLAY_ERROR image will return this error code. No image data is available to do IMAGE_NOT_AVAILABLE manipulations on. This is returned if a parameter NOT_VALID passed into an API is not valid. This is returned if an API method is SNOWBND_API_NOT_AVAILABLE not implemented in the current build. General API error code of an unsuc- SNOWBND_ERROR cessful action. General API status of a successful SNOWBND_OK action. This is returned when a Critical SYSTEM_CRASH Exception is thrown.

379 Appendix I - Troubleshooting

Appendix I - Troubleshooting

This appendix describes solutions to issues that you may run across when installing and using RasterMaster Imaging SDK for the .NET Platform.

Receiving an Error Code When Loading, Saving or Con- verting a Document

If you receive an error code when trying to load, save or convert a document with RasterMaster Imaging SDK for the .NET Platform, please check the list of error codes and their descriptions in Appendix H to determine the source of the issue. If you still cannot resolve the issue after looking at the list of error codes, please submit a support ticket at www.su- pport.snowbound.com and include the error code and the document that you were trying to load, save or convert when you got the error message.

Output Document Differs from Original Document

When you convert a document and the output document is different from the original document, please create a support ticket and attach the document along with a screenshot of the output document in RasterMaster. Some examples of the differences that may occur include missing data, missing text, distorted graphics or displaying an incorrect or different font. We can test the document with the latest release of RasterMaster which contains fixes which may resolve your issue.

Output Document Has Much Larger File Size than the Original Document

The file size of your output document may be much larger than the original document if you are converting or merging a PDF, Word document or other document into a raster image. Appendix B shows a list of file formats and their supported bit depths. Please see the following suggestions to reduce the file size:

l Use the following function prior to decompression to reduce the output dots per inch (DPI) or bit depth. Please see Chapter 23, Information Query Functionsfor more detailed information. CIMGLOW_set_document_input (int dpi, int bits_pix, int for- mat)allows documents to be rendered in color or black and white. It also allows you to set the document size. Please see CIMGLOW_set_document_input(int, int, int) for more information.

l Use one of the following color reduction functions to reduce 8-bit and 24-bit images to smaller gray scale images. Please see Chapter 31, Color Reduction Functionsfor more

380 Appendix I - Troubleshooting

detailed information.

CIMG_color_gray()converts 24-bit color images to 8-bit gray scale images. Please see CIMG_color_gray() for more information.

CIMG_resize_to_gray(int width, int height)resizes a 1-bit black and white image to a (smaller) 8-bit grayscale image. Please see CIMG_resize_to_gray () for more information.

CIMG_diffusion_mono()converts 4, 8 or 24 bit images to 1-bit per pixel bi-level images using the Stucky error diffusion technique. Please see CIMG_diffusion_ mono() for more information.

Output Document Has Much Lower Quality than the Orig- inal Document

The first step in obtaining better quality conversions is to check the original images or doc- uments in the application where they originated such as Adobe Acrobat or Microsoft Word. If the original application is not available, try another viewer. If the quality is bad for the original image, then you may not be able to obtain any better quality in the conversion.

If this is a simple bitmap format such as TIFF, you can try adjusting the sharpening, contrast and brightness. To improve the quality of a 1-bit file format document, first convert it to gray scale using CIMG_promote_8().

If the source image or document is vector or it is composed of text and drawing commands such as PDF, Word, or AFP, you can set the conversion to be 1-bit or increase the dots per inch using CIMGLOW_set_document_input(Dpi, bits_pix). Please see CIMGLOW_set_document_ input(int, int) for more information.

Please note that a higher resolution will almost always yield a better quality conversion but will probably result in a larger output file size.

Also it is common to convert to TIFF_G4. This is a 1-bit per pixel format. Make sure that if you are converting from a color image, that it is mostly text. There will be a noticable loss in quality for pictures or color graphics such as logos when converting a color image to a 1-bit per pixel for- mat. Text will usually work well.

If your document requires color, then try saving to a color output format such as TIFF_-Pack- bits, TIFF_ JPEG or TIFF_LZW.

The output quality of your output document may be much lower than the original document if you convert a high quality image to a low quality output such as TIFF_G4_FAX. Please see the following suggestions to improve the quality of the output document:

l Choose a different output format such as TIFF_LZW to produce an output document with sufficient pixel depth. Appendix B shows a list of file formats and their supported bit depths.

l Use the following function prior to decompression to reduce the output dots per inch

381 Appendix I - Troubleshooting

(DPI) or bit depth. Please see Chapter 23, Information Query Functions for more detailed information. CIMGLOW_set_document_input(int dpi, int bits_pix, int for- mat)allows documents to be rendered in color or black and white. It also allows you to set the document size. Please see CIMGLOW_set_document_input(int, int, int) for more information.

l Use the color promotion function, CIMG_promote_24(), to promote 1-bit, 4-bit and 8-bit images to 24-bit images. Please see Chapter 30, Color Promotion Functionsfor more detailed information.

Output Document Displays Incorrect or Missing Char- acters

When you convert a document, the output document may display incorrect or missing char- acters if the document contains special characters which are commonly found in Non-English languages such as Chinese, Japanese and Thai. Make sure that your system is properly con- figured to support these characters. For more information, please see Snowbound Software’s Font Configuration Guide.

Improving Performance

The more colors there are in the input or output image, the bigger the file and the slower the proc- essing speed. To reduce the number of colors and improve performance, reduce the bit depth (bits per pixel) value to grayscale (8-bit) or black and white (1-bit).

l Use one of the following color reduction functions to reduce 8-bit and 24-bit images to smaller gray scale images. Please see Chapter 31, Color Reduction Functions for more detailed information.

CIMG_color_gray()converts 24-bit color images to 8-bit gray scale images. Please see CIMG_color_gray() for more information.

CIMG_resize_to_gray(int width, int height)resizes a 1-bit black and white image to a (smaller) 8-bit grayscale image. Please see CIMG_resize_to_gray () for more information.

CIMG_diffusion_mono()converts 4, 8 or 24 bit images to 1-bit per pixel bi-level images using the Stucky error diffusion technique. Please see CIMG_diffusion_ mono() for more information.

Please note that there is always a trade off between performance and quality. To improve per- formance, the quality of the image may be less. This is true whenever working with any imaging software.

To improve performance in RasterMaster, consider the input file type. To reduce the resolution, reduce the DPI value. If the input file is not a raster image, such as PCL, vector PDF, Word or

382 Appendix I - Troubleshooting

Excel, use the following function to set the DPI and bit depth prior to decompression. Please see Chapter 23, Information Query Functions for more detailed information. CIMGLOW_set_document_input (int dpi, int bits_pix, int for- mat)allows documents to be rendered in color or black and white. It also allows you to set the document size. Please see CIMGLOW_set_document_input(int, int, int) for more information.

Identifying an Unknown File Format

To identify an unknown file format, you can use the CIMGLOW_get_filetype() function in Ras- terMasterImaging SDK for the .NET Platform. This function returns a number that corresponds to a file type as defined in the RasterMaster library. Please see Appendix B for a list of the Snowbound file type constants.

Receiving a -3 Corrupted File Error code

If you receive a -3 corrupted file error code, the input document may have become corrupt. To resolve this issue, open the document in an editor and write it back out again.

Some PDF document generators do not properly specify all of the information needed in a doc- ument. To resolve this issue in PDF documents that are generated by custom applications, open the document in Adobe Acrobat and then save it. You should then be able to process the newly saved document in RasterMaster.

Overlay Resources Not Pulled into APF or MODCA Document

If overlay resources such as signatures are not being pulled into an AFP or MODCA document, then make sure that the resource filename does not have a filename extension. If the resource filename has a filename extension, remove it.

Searching for Text in a Snowbound Software Generated PDF

If you are having trouble finding text in a Snowbound Software generated searchable PDF, please use Adobe Reader version 9.4 to do the search.

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

When converting a file to TIFF_JPEG with RasterMaster, you may see that the resulting TIFF is blank when opened in a third party image viewer such as MS Office Document Imaging or

383 Appendix I - Troubleshooting

Windows Photo Viewer. In some cases, the viewer may also display an error message indi- cating that the TIFF is corrupted or too large.

This issue typically occurs when the file in question is converted at 1-bit black and white or 8-bit grayscale, rather than 24-bit color. By default, RasterMaster will often choose 1 bit/pixel to ensure better performance during conversion. Formats which are converted to 1-bit by default include AFP, DOC, XLS, and PCL. For these formats, we recommend that you call the IMGLOW_set_document_input() method prior to decompression if you wish to convert to TIFF_JPEG. Please see the following example:

status = s.IMGLOW_set_document_input(200, 24, Defines.DOC)

status = s.IMG_decompress_bitmap("C:\\input\\file.doc", page);

status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)

In the above example, the input DPI and bit-depth are set to 200 and 24 respectively for the input DOC file before being converted to TIFF_JPEG.

Please also note that while color input images (e.g. JPEG, TIFF, PNG) will be converted to 24 bits/pixel by default, you still might see this issue for black and white or grayscale input images. In the case where your input file is a black and white or grayscale image, you can promote the bit-depth to 24 by calling IMG_promote_24() after decompression. Please see the following example:

status = s.IMG_decompress_bitmap("C:\\input\\file.png", page);

status = s.IMG_promote_24();

status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)

This should produce an output TIFF that can be viewed by most third party image viewers.

RasterMaster .NET 4.0 Compatability

With the release of the .NET 4.0 framework, RasterMaster users may run into some errors and/or warnings when attempting to build an application with .NET 4.0 set as the target frame- work. Since RasterMaster is currently built under .NET 2.0, the user may see the following build error: “Mixed Mode assembly is built against version 'v.2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.”

To resolve this error, simply enable the useLegacyV2RuntimeActivationPolicy attrib- ute in your application configuration:

This should allow the application to be successfully built under .NET 4.0. For more information, refer to the following MSDN article:

384 Appendix I - Troubleshooting

http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/5d1186ec-ad55-4929-b1e4- 8806cdc758af

In addition, the user may see the following build error as well: “Could not load file or assembly 'SbdNetAnn.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)”

This error typically occurs when the DLL (or one of the project source files) is being blocked by Windows security. To resolve this error, right-click on the file, navigate to Properties > Gen- eral > Security, and click Unblock. Then re-launch Visual Studio and attempt to build the appli- cation 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 Formats’’ for details on which formats support color information at different bit- depths.

Upgrading to the RasterMaster 18.0 Library

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

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 Tar- get.

For Visual Basic projects, go to Project Properties > Compile > Advanced Com- pile Options > Advanced Compiler Settings. Choose x86 as the Platform Target.

385 Appendix I - Troubleshooting

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

386 Index: -1 error code – -43 error code

-22 error code 376 Index -23 error code 376

-24 error code 376 -

-1 error code 375 -25 error code 376

-10 error code 375 -26 error code 376

-100 error code 378 -27 error code 376

-101 error code 378 -28 error code 376

-102 error code 378 -29 error code 376

-103 error code 378 -3 error code 375

-104 error code 378 -30 error code 376

-105 error code 378 -31 error code 376

-106 error code 378 -32 error code 376

-11 error code 375 -33 error code 376

-12 error code 375 -34 error code 377

-13 error code 375 -35 error code 377

-14 error code 376 -36 error code 377

-15 error code 376 -37 error code 377

-16 error code 376 -38 error code 377

-17 error codee 376 -39 error code 377

-18 error code 376 -4 error code 375

-19 error code 376 -40 error code 377

-2 error code 375 -41 error code 377

-20 error code 376 -42 error code 377

-21 error code 376 -43 error code 377

387 Index: -44 error code – Animate_VB

-44 error code 377 6 -45 error code 377 64-bit 331 -46 error code 377 64 bit 331 -47 error code 377 A -48 error code 378 ABIC 291 -5 error code 375 abicplug.dll 314 -52 error code 378 ACCESS_DENIED error code 377 -53 error code 378 additions 37 -6 error code 375 AFP 172, 217, 291, 385 -7 error code 375 AFP Font Mapping 171 -8 error code 375 AFP resource -9 error code 375 not displayed 383 . AFP troubleshooting .NET 4.0 overlay 383 build x64 sample 331 AFP/MO 210 .NET Framework 4.0 44 Alias Name 322

1 Alias Quality 135

1 error code 378 Alpha sample 332

Alpha_csharp 40, 316 2 Alpha_VB 40, 316 24-bit images 53 Animate sample 332 3 Animate_CSHARP 40, 316 32-bit 330 Animate_VB 40, 316 32 bit 330

388 Index: Annaction sample – Aspnet_regiis

Annaction sample 333 ASCIIPAGEWIDTH 232 annaction_csharp 40, 316 ASCIIPOINTSIZE 233 annaction_VB 40, 316 ASCIITABSTOP 232 annotation ASCIITYPEFACE 233

create 275 ASCIIWEIGHT 233

create bitmap object 269 ASCIIXDPI 232

get object 275 ASCIIYDPI 232

highlight bound box 276 ASP 319

read 276-278 ASP Conversion sample 335

Annotation Constants 265 ASP Image View sample 335

Annotation sample 333 ASP Memory Copy sample 335

Annotation_CSHARP 40, 316 ASP Multiple Pages sample 336

Annotation_VB 40, 316 ASP.NET Samples 319

ASCII 231, 290-291 Running 319

filter bit level support 290 ASPConversion_CSHARP 40, 316

ASCII Attribute Structure 231 aspect ratio correction 52

ASCII Standard Page Sizes 232 ASPImageView_CSHARP 40, 316

ASCIICHARSPERLINE 233 ASPImageView_VB 41, 316

ASCIII text format ASPMemCopy_CSHARP 41, 316

auto detection 231, 234 ASPMemCopy_VB 41, 316

ASCIIITALIC 233 ASPMultiPage_CSHARP 41, 316

ASCIILINESPERPAGE 233 ASPMultiPage_VB 41, 316

ASCIIMARGIN 232 Aspnet_regiis 320

ASCIIPAGEHEIGHT 232 Running 319

389 Index: Aspose.Cells.dll – CIMG_auto_orient

Aspose.Cells.dll 314 BMP_UNCOMPRESSED 291

Aspose.Total.Product.Family.lic 314 BOM 103

Aspose.Words.dll 314 bool_repaintBackground 117

Assembly.LoadFrom 328 BRK 291

auto detection build

ASCII text format 231, 234 32-bit 330

AUTOFEED_FAILED error code 377 65-bit 331

automatically detecting 56 byte order mark 103

B C

BAD_DISPLAY_AREA error CALS 291 code 375 CANT_CREATE_FILE error code 375 BAD_HANDLE error code 375 CANT_FIND_TWAIN_DLL error BAD_LICENSE_PRIMARY error code 376 code 377 CASCIITEXTATTR 287 BAD_LICENSE_SECONDARY error CCITT_G3 291 code 377 CCITT_G3_FO 291 BAD_RETURN error code 375 CCITT_G4 291 BAD_STRING error code 375 CCITT_G4_FO 292 Batch_XPS_Convert sample 336 CFF 292 bi-level images 53 CIFF 292 bit depth 57, 107, 204, 224 CIMG_animate 129 bitmap object CIMG_antique_effect 188 create from Snowbound object 268-269 CIMG_apply_profile 188

BMP 291 CIMG_auto_orient 189

390 Index: CIMG_auto_orient Function – CIMG_display_fit_to_width

CIMG_auto_orient Function 178 CIMG_decompress_bitmap_mem 82

CIMG_autocrop_bitmap 189 CIMG_decompress_bitmap_page 83

CIMG_bayer_color 226 CIMG_decompress_bitmap_url 83

CIMG_bayer_mono 227 CIMG_decompress_bitmap_xps 84, 279-280 CIMG_bitmap_info 141 CIMG_decompress_fax 85 CIMG_bitmap_palette 130 CIMG_decompress_fax_mem 85 CIMG_cmyk_to_rgb 219, 221 CIMG_decompress_tiled_bitmap 86 CIMG_color_combine 219 CIMG_delete_bitmap 175 CIMG_color_gray 223 CIMG_delete_bitmap_keep 176 CIMG_color_separate 220 CIMG_deskew_bitmap 191 CIMG_create_bitmap_class 94 CIMG_deskew_bitmap Function 179 CIMG_create_bitmapsource_anno- tation 269 CIMG_despeckle_bitmap 191

CIMG_create_bitmapsource_ CIMG_despeckle_bitmap class 268 Function 179

CIMG_create_handle 94 CIMG_dib_to_ddb 192

CIMG_create_handle_ddb 95 CIMG_dib_to_runs 193

CIMG_create_handle_keep 95 CIMG_diffusion_mono 227

CIMG_create_thumbnail 190 CIMG_display_bitmap 118

CIMG_decompress_bitmap 78 CIMG_display_bitmap_aspect 119

CIMG_decompress_bitmap_ CIMG_display_bitmap_transp 120 display 80 CIMG_display_ddb 121 CIMG_decompress_bitmap_fd 81 CIMG_display_ddb_effect 130 CIMG_decompress_bitmap_ CIMG_display_fit_to_height 121 FlexSnap 81 CIMG_display_fit_to_width 122

391 Index: CIMG_erase_rect – CIMG_scan_get_cap_WPF

CIMG_erase_rect 193 CIMG_promote_32 218

CIMG_flip_bitmapx 193 CIMG_promote_8 217

CIMG_flip_bitmapy 194 CIMG_remove_red_eye 202

CIMG_get_bitmap_palette 142 CIMG_resize_bitmap 203

CIMG_get_croprect 142 CIMG_resize_bitmap_interp 204

CIMG_get_deskew_angle 194 CIMG_resize_to_gray 224

CIMG_get_display_rect 143 CIMG_rgb_to_cmyk 218

CIMG_get_pages_WPF 271 CIMG_rotate_bitmap 204

CIMG_get_pages_xps 278 CIMG_runs_to_dib 205

CIMG_get_pages_xps_mem 279 CIMG_save_bitmap 107

CIMG_get_profile 195 CIMG_save_bitmap_fd 108

CIMG_halftone_mono 228 CIMG_save_bitmap_mem 109

CIMG_histogram_equalize 195 CIMG_save_document 213

CIMG_ifl_version 143 CIMG_save_document_mem 215

CIMG_invert_bitmap 196 CIMG_scan_acquire 68

CIMG_mediancut_color 225 CIMG_scan_acquire_feeder 68

CIMG_merge_bitmap 196 CIMG_scan_acquire_feeder_fast 69

CIMG_merge_bitmap_alpha 200 CIMG_scan_acquire_feeder_fast_ WPF 270 CIMG_octree_color 225 CIMG_scan_acquire_feeder_ CIMG_popularity_color 224 WPF 270 CIMG_print_bitmap 50 CIMG_scan_acquire_WPF 269 CIMG_print_bitmap_fast 50 CIMG_scan_feeder_close 70 CIMG_process_bitmap 201 CIMG_scan_get_cap 70 CIMG_promote_24 218 CIMG_scan_get_cap_WPF 273

392 Index: CIMG_scan_open_source – CIMGLOW_get_filetype_url

CIMG_scan_open_source 71 CIMGLOW_auto_invert Function 180

CIMG_scan_open_source_WPF 271 CIMGLOW_autocolor 133

CIMG_scan_pages 71 CIMGLOW_detect_blank_page Func- tion 181 CIMG_scan_pages_fast 72 CIMGLOW_extract_text 165, 210 CIMG_scan_pages_WPF 272 CIMGLOW_extract_text_mem 167, CIMG_scan_set_cap 73 212 CIMG_scan_set_cap_WPF 273 CIMGLOW_extract_text_mem_ CIMG_scan_set_caps 74 pointer 167

CIMG_scan_setup 74 CIMGLOW_extract_text_pointer 168

CIMG_scan_setup_WPF 274 CIMGLOW_get_anim_delay 144

CIMG_SEARCH_RESULT 286 CIMGLOW_get_ascii 235

CIMG_set_croprect 123 CIMGLOW_get_ascii_page 235

CIMG_set_croprect_scroll 123 CIMGLOW_get_auto_detect 144

CIMG_set_display_angle 205 CIMGLOW_get_bitmap_header 145

CIMG_set_encrypt 111 CIMGLOW_get_bitmap_name 145

CIMG_set_gamma 132 CIMGLOW_get_custstring 146

CIMG_set_lut 132 CIMGLOW_get_fileinfo 146

CIMG_sharpen_bitmap 206 CIMGLOW_get_fileinfo_fd 147-148

CIMG_thresh_mono 227 CIMGLOW_get_fileinfo_page 148

CIMG_unload_plugins 176 CIMGLOW_get_filetype 149

CIMG_window_level 133 CIMGLOW_get_filetype_fd 149

CIMG_zoom_bitmap 124 CIMGLOW_get_filetype_mem 150

CIMG_zoom_bitmap_1_to_1 125 CIMGLOW_get_filetype_url 150

CIMG_zoom_bitmap_rect 125

393 Index: CIMGLOW_get_image_orientation_page – CIMGLOW_set_fontmap_path

CIMGLOW_get_image_orientation_ CIMGLOW_remove_halftone page 151 Function 183

CIMGLOW_get_ooxml_license_loca- CIMGLOW_remove_holepunch Func- tion Function 106 tion 184

CIMGLOW_get_pages 151 CIMGLOW_remove_lines Function 184 CIMGLOW_get_pages_fd 152 CIMGLOW_search_text 168 CIMGLOW_get_pages_mem 153 CIMGLOW_set_alias 134 CIMGLOW_get_pages_url 153 CIMGLOW_set_alias_quality 135 CIMGLOW_get_palette 207 CIMGLOW_set_ascii 236 CIMGLOW_get_raster 207 CIMGLOW_set_auto_detect 88 CIMGLOW_get_tiff_tag 154 CIMGLOW_set_bitmap_header 158 CIMGLOW_get_tiff_tag_page 155 CIMGLOW_set_bitmap_name 176 CIMGLOW_get_tile_info 156 CIMGLOW_set_comp_quality 112 CIMGLOW_get_transp_color 157 CIMGLOW_set_decomp 89 CIMGLOW_image_dilation Function 182 CIMGLOW_set_decomp_rect 89

CIMGLOW_image_erosion CIMGLOW_set_decomp_ Function 183 reduction 89

CIMGLOW_is_tiled_image 157 CIMGLOW_set_decompsize 90

CIMGLOW_map_image_to_wnd 126 CIMGLOW_set_dithermode 135

CIMGLOW_map_wnd_to_image 126 CIMGLOW_set_document 159

CIMGLOW_put_palette 208 CIMGLOW_set_document_input 160- 161 CIMGLOW_put_raster 208 CIMGLOW_set_fontmap 171 CIMGLOW_read_pixel 158 CIMGLOW_set_fontmap_path 171

394 Index: CIMGLOW_set_html_capabilities – Contrast_VB

CIMGLOW_set_html_capabilities 97 CIMGLOW_set_rop 137

CIMGLOW_set_html_home_dir 98 CIMGLOW_set_tiff_indexing 177

CIMGLOW_set_html_image_capabil- CIMGLOW_set_tiff_save_strips 114 ity 99 CIMGLOW_set_tiff_tag 115 CIMGLOW_set_html_input 99 CIMGLOW_set_transp_color 138 CIMGLOW_set_html_javascript_ CIMGLOW_set_wipedelay 139 capability 100 CIMGLOW_unset_auto_detect 93 CIMGLOW_set_html_page_size 100 CIMGLOW_write_tiff_stream 109 CIMGLOW_set_html_page_size_ ratio 101 CIMS 292

CIMGLOW_set_html_page_size_ clearImage 62

ratio_capability 101 CLIP 292

CIMGLOW_set_html_screen_dpi 102 COD 292

CIMGLOW_set_html_use_page_ color 57, 107, 204, 224 breaks_exclusively 102 color page input 172, 217, 385 CIMGLOW_set_image_ color page ouput 172, 217, 385 orientation 112 color reduction 58 CIMGLOW_set_imnet_page_size 136 compatible CIMGLOW_set_jpeg_ decompression 90 input and output 57

CIMGLOW_set_jpeg2000_comp_ COMPRESSION_NOT_SUP- ratio 113 PORTED error code 376

CIMGLOW_set_jpg_interleave 113 Contrast sample 336-337

CIMGLOW_set_overlay_path 91 Contrast_CSHARP 41, 317

CIMGLOW_set_pdf_output 114 Contrast_VB 41, 317

CIMGLOW_set_pdf_password 92

395 Index: conversion – CSANN_read_ann_mem_page

conversion CSANN_delete_all_objects 248

error 58 CSANN_delete_object 248

output too large 58 CSANN_display_annotations 249

takes too long 58 CSANN_draw_object 249

Conversion sample 337 CSANN_FlipX 250

Conversion_CSHARP 41, 317 CSANN_FlipY 250

Conversion_VB 41, 317 CSANN_get_croprect 250

Convert_doc sample 338 CSANN_get_disprect 251

converting file formats 56 CSANN_get_object_bounds 251

CORRUPTED_FILE error code 375 CSANN_get_object_data 252

create CSANN_get_object_info 252

bitmap object from Snowbound CSANN_get_object_num 252 object 268-269 CSANN_get_object_num_WPF 275 CSANN_activate_all 243 CSANN_highlight_object 253 CSANN_activate_object 243 CSANN_highlight_object_WPF 276 CSANN_add_object 244 CSANN_map_image_to_wnd 253 CSANN_choose_color 245 CSANN_map_wnd_to_image 254 CSANN_choose_font 245 CSANN_mouse 254 CSANN_choose_line_style 245 CSANN_move_object 255 CSANN_choose_line_width 246 CSANN_print_annotations 256 CSANN_create_ann 246 CSANN_read_ann 256 CSANN_create_ann_WPF 275 CSANN_read_ann_FlexSnap 257 CSANN_deactivate_all 247 CSANN_read_ann_mem 257 CSANN_deactivate_object 247 CSANN_read_ann_mem_page 257

396 Index: CSANN_read_ann_mem_page_WPF – DOCX

CSANN_read_ann_mem_page_ D WPF 277 DCS 292 CSANN_read_ann_mem_WPF 278 DCX 292 CSANN_read_ann_page 258 ddbeffect_CSHARP 41, 317 CSANN_read_ann_page_WPF 277 ddbeffect_VB 41, 317 CSANN_read_ann_WPF 276 decompress CSANN_resize_object 258 XPS file 279-280 CSANN_rotate 259 decompressing mult-pages 47 CSANN_set_bcolor 259 DELETE_ERROR error code 379 CSANN_set_croprect 260 Device Independent Bitmap 237 CSANN_set_disprect 260 DIB 292 CSANN_set_fcolor 260 DICOM 292 CSANN_set_font 261 dilation 182 CSANN_set_line_style 261 DISK_FULL error code 375 CSANN_set_line_width 262 DISK_READ_ERROR error code 375 CSANN_set_size 263 display quality 53 CSANN_write_ann 263 DISPLAY_ERRORerror code 379 CSANN_write_ann_FlexSnap 264 DLL_NOT_LOADED error code 376 CSANN_write_ann_mem 264 DOC 292 CSANN_write_ann_mem_page 265 DocAddress 326 CSANN_write_ann_page 265 docplug.dll 314 CsHtml.dll 314 Document Conversion 210 CustomPaint 64 docx 106 CUT 292 DOCX 293

397 Index: double_calcAspectZoom – error code

double_calcAspectZoom 127 -102 378

DPI 53, 57 -103 378

changing 159 -104 378

DWG 293 -105 378

dwgplg.dll 314 -106 378

dwgplug.dll 314 -11 375

DXF 293 -12 375

-13 375 E -14 376 EMAIL 293 -15 376 Encrypt_csharp 41, 317 -16 376 Encrypt_VB 41, 317 -17 376 Encryption sample 339 -18 376 EPS 293 -19 376 EPS_BITMAP 293 -2 375 EPS_BITMAP_G4 294 -20 376 EPS_BITMAP_LZW 294 -21 376 erosion 183 -22 376 erro code -23 376 -6 375 -24 376 error code -25 376 -1 375 -26 376 -10 375 -27 376 -100 378 -28 376 -101 378

398 Index: error codeZ – error code

-29 376 -7 375

-3 375 -8 375

-30 376 -9 375

-31 376 1 378

-32 376 ACCESS_DENIED 377

-33 376 AUTOFEED_FAILED 377

-34 377 BAD_DISPLAY_AREA 375

-35 377 BAD_HANDLE 375

-36 377 BAD_LICENSE_PRIMARY 377

-37 377 BAD_LICENSE_ SECONDARY 377 -38 377 BAD_RETURN 375 -39 377 BAD_STRING 375 -4 375 CAN_CREATE_FILE 375 -40 377 CANT_FIND_TWAIN_DLL 376 -41 377 COMPRESSION_NOT_SUP- -42 377 PORTED 376 -43 377 CORRUPTED_FILE 375 -44 377 DELETE_ERROR 379 -45 377 DISK_FULL 375 -46 377 DISK_READ_ERROR 375 -47 377 DISPLAY_ERROR 379 -48 378 DLL_NOT_LOADED 376 -5 375 ERROR_OPENING_ -52 378 SCANNER 376

399 Index: error codeZ – error code

EVAL_TIMEOUT 376 NO_BITMAP_FOUND 375

EXCEPTION_ERROR 377 NO_CLIPBOARD_IMAGE 376

FEEDER_NOT_READY 376 NO_DELAY_TIME_FOUND 376

FILE_NOT_FOUND 375 NO_FAST_TWAIN_ SUPPORTED 377 FORMAT_NOT_ALLOWED 375 NO_JPEG2000_VERSION 377 FORMAT_WILL_NOT_ OTFLY 376 NO_MORE_PAGES 376

GENERAL_ NO_PCL_VERSION 377 STATUS.DEFAULT 378 NO_PDF_VERSION 377 GENERAL_STATUS.DELETE_ NO_SCANNER_FOUND 376 ERROR 378 NO_TCOLOR_FOUND 376 GENERAL_STATUS.DISPLAY_ ERROR 378 NO_VECTOR_CAPABILITY 377

GENERAL_STATUS.IMAGE_ NO_WORD_VERSION 377

NOT_AVAILABLE 378 NOT_A_TILED_IMAGE 376

GENERAL_STATUS.NET_ NOT_SUPPORTED_IN_THIS_ VALID 378 VERSION 376

GENERAL_STAT- NOT_VALID 379 US.SNOWBND_API_NOT_ OOXML_LICENSE_ AVAILABLE 378 EXPIRED 378 GENERAL_STAT- OOXML_LICENSE_NOT_ US.SNOWBND_OK 378 FOUND 378 GENERAL_STATUS.SYSTEM_ OUT_OF_MEMORY 375 CRASH 378 PAGE_NOT_FOUND 375 IMAGE_NOT_AVAILABLE 379 PALETTE_IMAGE_NOT_ METHOD_NOT_FOUND 377 ALLOWED 376 NO_ABIC_VERSION 377

400 Index: error codeZ – GENERAL_STATUS.DEFAULT

PASSWORD_PROTECTED_ F FILE 378 fast printing 49 PASSWORD_PROTECTED_ PDF 377 FEEDER_NOT_READY error code 376 PIXEL_DEPTH_ UNSUPPORTE 376 file formats

SEARCH_STRING_NOT_ automatically detecting 56

FOUND 377 converting 56

SNOWBND_API_NOT 379 FILE_NOT_FOUND error code 375

SNOWBND_OK 379 FileMem sample 340

SYSTEM_CRASH 379 FileMem_CSHARP 41, 317

TIFF_TAG_NOT_FOUND 376 filename extension 383

USER_CANCEL 376 FileNet 294

USING_RUNTIME 376 files error codeZ redistributed 307

NO_LZWZ_VERSION 376 FLASHPIX 294 error during conversion 58 Format For Decompressed

ERROR_OPENING_SCANNER error Images 237

code 376 FORMAT_NOT_ALLOWED error

EVAL_TIMEOUT error code 376 code 375 evaluation version FORMAT_WILL_NOT_OTFLY error code 376 installing 307

Excel 172, 217, 385 G

EXCEPTION_ERROR error code 377 General Error Define 285

General Status Error 379

GENERAL_STATUS.DEFAULT 285

401 Index: GENERAL_STATUS.DEFAULT error code – icudt38.dll

GENERAL_STATUS.DEFAULT error GENERAL_STATUS.SNOWBND_ code 378 OK error code 378

GENERAL_STATUS.DELETE_ GENERAL_STATUS.SYSTEM_ ERROR 285 CRASH 285

GENERAL_STATUS.DELETE_ GENERAL_STATUS.SYSTEM_ ERROR error code 378 CRASH error code 378

GENERAL_STATUS.DISPLAY_ GIF 294 ERROR 285 GIF_INTERLACED 294 GENERAL_STATUS.DISPLAY_ GlobalAlloc 109 ERROR error code 378 GlobalLock 109 GENERAL_STATUS.IMAGE_NOT_ AVAILABLE 285 GX2 294

GENERAL_STATUS.IMAGE_NOT_ H AVAILABLE error code 378 halftone GENERAL_STATUS.NOT_ remove 183 VALID 285 hole punch GENERAL_STATUS.NOT_VALID error code 378 remove 184

GENERAL_STATUS.SNOWBND_ HPALETTE 142 API_NOT_AVAILABLE 285 HTML 294 GENERAL_STATUS.SNOWBND_ HtmlHelper.dll 314 API_NOT_AVAILABLE error code 378 htmliHelper.dll 314

GENERAL_STATUS.SNOWBND_ htmlplg.dll 314 ERROR 285, 378 I GENERAL_STATUS.SNOWBND_ OK 285 ICO 294

icudt38.dll 314

402 Index: IFF – jp2plug.dll

IFF 294 IMG_decompress_bitmap (java.awt.Image, int) 172, 217, IIS 319 385 IIS 7.5 IMGLOW_detect_color 172, 217, 385 work with RasterMaster.Net 385 IMGLOW_get_tiff_tag 349 image IMGLOW_set_document_input 161, dilation 182 172, 217, 385

erosion 183 IMGLOW_set_pcl_input Function 183

return orientation 178 IMGLOW_set_tiff_tag 349

rotate 179 IMNET 295 image compression input

1-bit bi-level images 55 color page 172, 217, 385

24-bit color images 55 input compatible with output 57

8-bit gray scale images 55 input document quality 57

preferred formats 55 input quality 58

Image File Directories (IFDs) 349 invert

Image Management System 292 color 180

Image Processing sample 340 IOCA 295

Image Saving Functions 107 isValidImage 62

IMAGE_NOT_AVAILABLE error J code 379 jb2plug.dll 314 ImageProcessing_CSHARP 42, 317 JBIG 295 ImageProcessing_VB 42, 317 JBIG2 295 ImageWidth 214 JEDMICS 295 IMG 294 jp2plug.dll 314

403 Index: JPEG – NO_DELAY_TIME_FOUND error code

JPEG 295 METHOD_NOT_FOUND error code 377 JPEG2000 295 Microsoft Office 2007 106 K Microsoft Office plugin 106 KOFAX 295 MMR 296

L MO

LASER_DATA 295 DCA 172, 217, 385

LINE_DATA 295 MODCA resource

lines not displayed 383

remove 184 MODCA troubleshooting

loation overlay 383

OOXML license file 106 MS Windows DIB Header 238

lossy compression 58 MS Windows DIB Image 239

low output; adjusting quality 57-58 MS Windows DIB Palette 239

MSP 296 M

MACPAINT 295 multi-page format 48

MAG 296 multi-page images 47

memcopy_csharp 42, 317 N

Memcopy_VB 42, 317 NCR 296

Memory Copy sample 340 NO_ABIC_VERSION error code 377

memory requirements 45 NO_BITMAP_FOUND error code 375

Merge Image sample 341 NO_CLIPBOARD_IMAGE error

mergeimage_CSHARP 42, 317 code 376

NO_DELAY_TIME_FOUND error code 376

404 Index: NO_FAST_TWAIN_SUPPORTED error code – OUT_OF_MEMORY error code

NO_FAST_TWAIN_SUPPORTED O error code 377 ODF 296 NO_JPEG2000_VERSION error code 377 ODP 296

NO_LZW_VERSION error code 376 ODS 296

NO_MORE_PAGES error code 376 ODT 296

NO_PCL_VERSION error code 377 Office 172, 217, 385

NO_PDF_VERSION error code 377 Office 2007 106

NO_SCANNER_FOUND error OnPaint 65

code 376 OnPaintBackground 65

NO_TCOLOR_FOUND error OnSizeChanged 66 code 376 OOXML 106, 296 NO_VECTOR_CAPABILITY error OOXML license file code 377 load 106 NO_WORD_VERSION error code 377 OOXML_LICENSE_EXPIRED error code 378 noise removal 179 OOXML_LICENSE_NOT_FOUND normal printing 49 error code 378 NOT_A_TILED_IMAGE error ooxmlplug.dll 314 code 376 operating system NOT_SUPPORTED_IN_THIS_VER- SION error code 376 32-bit 330

NOT_VALID error code 379 64-bit 331

NOTSRCCOPY 137 orientation

NOTSRCERASE 137 image 178

OUT_OF_MEMORY error code 375

405 Index: output – PIXEL_DEPTH_UNSUPPORTED error code

output path

color page 172, 217, 385 save scanning 272

resolution 159 PCL 296

overlay PCL_5 297

AFP troubleshooting 383 pclplug.dll 314

MODCA troubleshooting 383 PCX 297

PDF 99-100, 102, 136, 147-149, 159- P 160, 231, 281, 287-288, 297 page count 47 filter bit level support 290 Page sample 341 raster 283 page_csharp 42, 317 vector 283 PAGE_NOT_FOUND error code 375 PDF output 107 Page_VB 42, 317 PDF_15 298 pages PDF_16 298 XPS file format 278-279 pdfplug.dll 314 palette 56, 107, 204 performance 382-383 PALETTE_IMAGES_NOT_ PhotoCD 298 ALLOWED error code 376 Photoshop 299 Panning sample 342 PICT 299 panning_csharp 42, 318 pixel depth 57 panning_VB 42, 318 PIXEL_DEPTH_ PASSWORD_PROTECTED_FILE UNSUPPORTED 57, 290 error code 378 PIXEL_DEPTH_UNSUPPORTED PASSWORD_PROTECTED_PDF error code 376 error code 377

406 Index: pixels – resolution

pixels R percentage 181 RAST 299 PNG 299 raster PDF 283 PowerPoint 172, 217, 385 RasterMaster PPT 299 version PPTX 299 get 143 Print sample 342 RasterMaster .NET x32 Print_CSHARP 42, 318 work with IIS 7.5 385 Print_VB 42, 318 RasterMaster 18.0 library 385 printing 49 Read/Write Capabilities 290 production version redactions 240 installing 307 redistributables 385 public_class 287 Reference 324 public_class_CANN 242 remove public_class_CDIB_HEADER 288 halftone 183 public_class_CIMG_RECT 285 hole punch 184 public_class_CIMG_SEARCH 286 remove lines 184 public_class_CSEARCH_TEXT 288 removeScrollbars 128 public_class_CTIFF_TAG 288 resize 190

Q zoom 190, 203 quality resolution 53, 57, 99-100, 102, 136, 147-149, 159-160, 231, 281, adjusting low output 57 287-288

changing 159

407 Index: return – Snowbnd()

output 159 scan

return fast memory transfer 270

fast memory transfer scanning 271 get cap 273

number of pages in XPS file 278 image on currently installed scanner 269 orientation of image 178 image on scanner with automatic pointer to number of pages in XPS document feeder 270 file 279 saves the path/filename 272 Rich Text Format 300 set cap 273 rotate setup parameters 274 image 179 Scan sample 342 RTF 300 Scan_CSHARP 42, 318 Running 319 Scan_VB 42, 318 ASP.NET Samples 319 SCITEX 300 aspnet_regiis 320 Screen_Display_Dither 136 running a sample 330 SEARCH_STRING_NOT_FOUND S error code 377

samples Set Up 326

build x32 with .NET 2.0 331 Web Image Viewer

build x64 with .NET 4.0 331 Component 326

saving multi-page file 47 setup

sbdnet.dll 385 scan parameters 274

sbdNetAnn.dll 314 SimpleMultiPages_CSHARP 42, 318

SbdNetAnn.dll 385 SimpleMultiPages_VB 42, 318

SbdNetLib.Snowbnd 328 Snowbnd() 59

408 Index: Snowbnd(int, int, int) – troubleshooting

Snowbnd(int, int, int) 60 Tiff Tag sample 344

SNOWBND_API_NOT error code 379 TIFF tags 349

SNOWBND_OK error code 379 TIFF UNCOMPRESSED 301

SnowbndCNet_HScrollBar 76 TIFF_2D 300

SnowbndCNet_VScrollBar 77 TIFF_ABIC 300

Snowbound ASCII 231 TIFF_ABIC_BW 300

Snowbound Error Codes 375 TIFF_G3_FAX 301

SnowPanel Class Specific TIFF_G4_FAX 301 Methods 64 TIFF_G4_FAX_FO 301 Split to Multiple Pages sample 343 TIFF_G4_FAX_STRIP 301 Supported File Format TIFF_HUFFMAN 301 Descriptions 290 TIFF_JBIG 301 supported multi-page formats 47 TIFF_JPEG 301, 383 SYSTEM_CRASH error code 379 TIFF_JPEG7 301 T TIFF_LZW 301 tag specifications 349 TIFF_PACK 301 TARGA 300 TIFF_TAG_NOT_FOUND error TARGA16 300 code 376

Text Search sample 343 TIFFTag_CSHARP 42, 318 textsearch_CSHARP 42, 318 TIFFTag_VB 43, 318 textsearch_VB 42, 318 ToErrorMessage 63 third party viewers 383 troubleshooting 380

TIFF corrupted file 383

read tag 349 error code 380

409 Index: TXT – WPFAnnotation_CSHARP sample

improving performance 382 CIMGLOW_set_html_page_size_ ratio 101 larger file size 380 CIMGLOW_set_html_page_size_ lower quality 381 ratio_capability 102-103 missing characters 382 CIMGLOW_set_html_screen_ output differs 380 dpi 102

third party viewers 383 vector PDF 283

TIFF_JPEG 383 version

unknown file format 383 get 143

TXT 301 W Type Property Define 284 watermarks 240

U WBMP 302

USER_CANCEL error code 376 Web Image Viewer Component 326

USING_RUNTIME error code 376 Set Up 326

Web Image Viewer Component sam- V ple 347 variables WINFAX 302 CIMGLOW_get_ooxml_license_ location 106 WMF 302

CIMGLOW_set_html_home_dir 98 Woord 2007 106

CIMGLOW_set_html_image_ Word 172, 217, 385

capability 99 Word 2007 106

CIMGLOW_set_html_input 99 WPF 267-278

CIMGLOW_set_html_javascript_ WPF Image sample 347 capability 100 WPFAnnotation_CSHARP CIMGLOW_set_html_page_ sample 345 size 100

410 Index: WPFConversion sample – ZOOM_ASPECT.ASPECT_ZOOM

WPFConversion sample 345 Z WPFScanning sample 346 zoom 124-125, 127, 190, 203, 260, WPG 302 332, 335, 342

ZOOM_ASPECT.ASPECT_ X DEFAULT 284 x32 ZOOM_ASPECT.ASPECT_FIT_TO_ build sample with .NET 2.0 331 HEIGHT 284 x64 ZOOM_ASPECT.ASPECT_FIT_TO_

build sample with .NET 4.0 331 WIDTH 284 x86 platform 385 ZOOM_ASPECT.ASPECT_ONE_ TO_ONE 284 XBM 302 ZOOM_ASPECT.ASPECT_PRE- Xerox_EPS 302 SERVE 284 XLS 302 ZOOM_ASPECT.ASPECT_ XLSX 302 ZOOM 284

XPM 303

XPS file

return number of pages 278

return pointer to number of pages 279

XPS fle

decompress 279-280

XPSMem sample 347

XWD 303

filter bit level support 290

411