RasterMaster® SDK Imaging SDK for .NET V19.0 Programmer’s Reference Guide Note: An online version of this manual contains information on the latest updates to RasterMaster. To find the most recent version of this manual, please visit the online version at www.rastermaster.com or download the most recent version from our website at www.snowbound.com/support/manuals.html. DOC-0150-09 Copyright Information While Snowbound® Software believes the information included in this publication is correct as of the publication date, information in this document is subject to change without notice. UNLESS EXPRESSLY SET FORTH IN A WRITTEN AGREEMENT SIGNED BY AN AUTHORIZED REPRESENTATIVE OF SNOWBOUND SOFTWARE CORPORATION MAKES NO WARRANTY OR REPRESENTATION OF ANY KIND WITH RESPECT TO THE INFORMATION CONTAINED HEREIN, INCLUDING WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PURPOSE. Snowbound Software Corporation assumes no responsibility or obligation of any kind for any errors contained herein or in connection with the furnishing, performance, or use of this document. Software described in Snowbound documents (a) is the property of Snowbound Software Corporation or the third party, (b) isfurnished only under license, and (c) may be copied or used only as expressly permitted under the terms of the license. All contents of this manual are copyrighted by Snowbound Software Corporation. The information contained herein is the exclusive property of Snowbound Software Corporation and shall not be copied, transferred, photocopied, translated on paper, film, electronic media, or computer-readable form, or otherwise reproduced in any way, without the express written permission of Snowbound Software Corporation. Microsoft, MS, MS-DOS, Windows, Windows NT, and SQL Server are either trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Adobe, the Adobe logo, Acrobat, and the Acrobat logo are trademarks of Adobe Systems Incorporated. Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. iText, the Initial Developers of the Original Code are Bruno Lowagie and Paolo Soares. Portions created by Bruno Lowagie are Copyright (C) 1999-2009 by Bruno Lowagie. Kakadu JPEG2000© , is copyrighted by Dr. David Taubman, and is proprietary to NewSouth Innovations, Pty. Ltd, Australia. Aspose™, Aspose.Cells© (copyrighted 2003), Aspose.Words© (copyrighted 2003), and Aspose.Slides© (copyrighted 2004), are all proprietary to Aspose Software, Pty. Ltd, Australia. United States Government Restricted Rights The Software is provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause of DFARS 252.227 –19 or subparagraphs (c)(i) and (2) of the Commercial Computer Software-Restricted Rights at 48 CFR 52.227 – 19 as applicable. The Manufacturer is Snowbound Software Corporation, 309 Waverley Oaks Rd., Suite 401, Waltham, MA 02452, USA. All other trademarks and registered trademarks are the property of their respective holders. Manual Title: Snowbound RasterMaster® Imaging SDK for the .NET Platform Programmer’s Reference Guide Part Number: DOC-0150-09 Revision: 9 RasterMaster .NET Release Number: 19.0 RasterMaster® SDK Release Number: 19.0 Printing Date: June 2015 Published by Snowbound Software Corporation. 309 Waverley Oaks Road Suite 401 Waltham, MA 02452 USA phone: 617-607-2000 fax: 617-607-2002 ©1996 - 2015 by Snowbound Software Corporation. All rights reserved. Table of Contents Chapter 1 - Additions and Improvements 38 New Features 38 Chapter 2 - Quick Start 41 Quickly Getting Started with the Conversion Sample 41 Viewing Samples Packaged with the Library 42 Sample Directory Files Reading and Displaying Images 42 45 Reading Images 45 Displaying an Image 45 Return Values and Error Codes 45 System Overview 46 Determining System Requirements 46 .NET Framework 4.0 Support 46 Determining Memory Requirements 47 Chapter 3 - Saving and Reading Multi-page Images Multi-page Images 49 49 Supported Multi-page Formats 49 Decompressing a Multi-page Image 49 Determining Multi-page Page Count 49 Saving Multi-page File Formats 49 Multi-page Format Functions 50 Chapter 4 - Printing Images 51 3 Printing Overview 51 Printing Functions 51 Normal Printing 51 Fast Printing 51 CIMG_print_bitmap() 52 CIMG_print_bitmap_fast() 52 Printing Large Documents 53 Servers 53 Clients 54 Solution 54 Chapter 5 - Aspect Ratio Correction Function Aspect Ratio Correction Function Chapter 6 - Display Quality Achieving the Best Display Quality 55 56 56 24-Bit Images Displayed on a 256 Color Adapter 56 Bi-Level and 1-Bit Per Pixel Images 56 Chapter 7 - Image Compression Preferred Formats 58 58 24-Bit Color Images 58 8-Bit Gray Scale Images 58 1-bit Bi-Level Images 58 Chapter 8 - File Format Conversion Converting File Formats Automatically Detecting File Formats 4 55 59 59 59 Input Document Quality: Resolution/DPI 60 Input Document Quality: Color/bit-depth/Pixel Depth 60 Making Sure Input is Compatible with Output 60 Getting a Pixel_Depth_Unsupported Error 60 Adjusting Low Output Quality 60 Chapter 9 - Class Snow.Snowbnd Methods 62 Snowbnd() 62 Snowbnd(int, int, int) 63 Chapter 10 - SDK Class Specific Methods 65 isValidImage() 65 clearImage() 65 ToErrorMessage() 66 Chapter 11 - SnowPanel Class Specific Methods 67 Properties 67 CustomPaint() 67 OnPaint() 68 OnPaintBackground() 68 OnSizeChanged() 68 Chapter 12 - Scanning Functions 70 Scanning Constants 70 CIMG_scan_acquire() 70 CIMG_scan_acquire_feeder() 71 CIMG_scan_acquire_feeder_fast() 72 CIMG_scan_feeder_close() 72 5 CIMG_scan_get_cap() 73 CIMG_scan_open_source() 73 CIMG_scan_pages() 74 CIMG_scan_pages_fast() 75 CIMG_scan_set_cap() 76 CIMG_scan_set_caps() 76 CIMG_scan_setup() 77 Chapter 13 - Scrollbar Default Functions Properties 78 SnowbndCNet_HScrollBar() 78 SnowbndCNet_VScrollBar() 78 Chapter 14 - Image Decompression Functions 80 CIMG_decompress_bitmap() 80 CIMG_decompress_bitmap_display() 82 CIMG_decompress_bitmap_fd() 83 CIMG_decompress_bitmap_FlexSnap() 83 CIMG_decompress_bitmap_mem() 84 CIMG_decompress_bitmap_page() 85 CIMG_decompress_bitmap_url() 86 CIMG_decompress_bitmap_xps() 86 CIMG_decompress_fax() 87 CIMG_decompress_fax_mem() 88 CIMG_decompress_tiled_bitmap() 88 Chapter 15 - Image Decompression Option Functions 6 78 90 CIMGLOW_set_auto_detect() 90 CIMGLOW_set_decomp_rect() 90 CIMGLOW_set_decomp_reduction() 91 CIMGLOW_set_decompsize() 92 CIMGLOW_set_jpeg_decompression 92 CIMGLOW_set_overlay_path() 93 CIMGLOW_set_pdf_input() 93 CIMGLOW_set_pdf_password() 94 CIMGLOW_unset_auto_detect() 95 Chapter 16 - Image Creation Functions 96 CIMG_create_bitmap_class() 96 CIMG_create_handle() 96 CIMG_create_handle_ddb() 97 CIMG_create_handle_keep() 97 Chapter 17 - HTML Functions 99 CIMGLOW_set_html_input() 99 CIMGLOW_set_html_page_size() 99 Functions Available in RasterMaster .NET V18.1 and Earlier 100 CIMGLOW_set_html_capabilities() 100 CIMGLOW_set_html_home_dir() 101 CIMGLOW_set_html_image_capability() 102 CIMGLOW_set_html_javascript_capability() 102 CIMGLOW_set_html_page_size_ratio() 103 CIMGLOW_set_html_page_size_ratio_capability() 103 7 CIMGLOW_set_html_screen_dpi() 104 CIMGLOW_set_html_use_page_breaks_exclusively() 104 CIMGLOW_set_html_utf_bom() 105 Chapter 18 - Open Office 2007 XML (OOXML) Functions CIMGLOW_set_ooxml_license() 108 CIMGLOW_ooxml_license_enable() 108 Chapter 19 - Image Saving Functions 110 CIMG_save_bitmap() 110 CIMG_save_bitmap_fd() 111 CIMG_save_bitmap_mem() 112 CIMGLOW_write_tiff_stream() 113 Chapter 20 - Image Saving Option Functions 114 CIMG_set_encrypt() 114 CIMGLOW_set_comp_quality() 114 CIMGLOW_set_image_orientation() 115 CIMGLOW_set_jpeg2000_comp_ratio() 116 CIMGLOW_set_jpg_interleave() 116 CIMGLOW_set_pdf_output() 117 CIMGLOW_set_tiff_save_strips 117 CIMGLOW_set_tiff_tag() 118 Chapter 21 - Image Display Functions 8 108 120 bool repaintBackground() 120 CIMG_display_bitmap() 120 CIMG_display_bitmap_aspect() 122 CIMG_display_bitmap_transp() 123 CIMG_display_ddb() 123 CIMG_display_fit_to_height() 124 CIMG_display_fit_to_width() 125 CIMG_set_croprect() 125 CIMG_set_croprect_scroll() 126 CIMG_zoom_bitmap() 127 CIMG_zoom_bitmap_1_to_1() 127 CIMG_zoom_bitmap_rect() 128 CIMGLOW_map_image_to_wnd() 128 CIMGLOW_map_wnd_to_image() 129 double calcAspectZoom() 129 removeScrollbars() 130 Chapter 22 - Image Display Option Functions 132 CIMG_animate() 132 CIMG_bitmap_palette() 132 CIMG_display_ddb_effect() 133 CIMG_set_gamma() 134 CIMG_set_lut() 135 CIMG_window_level() 135 CIMGLOW_autocolor() 136 CIMGLOW_set_alias() 137 CIMGLOW_set_alias_quality() 137 CIMGLOW_set_dithermode() 138 9 CIMGLOW_set_imnet_page_size() 139 CIMGLOW_set_rop() 139 CIMGLOW_set_transp_color() 141 CIMGLOW_set_wipedelay() 141 Chapter 23 - Information Query Functions 10 143 CIMG_bitmap_info() 143 CIMG_get_bitmap_palette() 144 CIMG_get_croprect() 145 CIMG_get_display_rect() 145 CIMG_get_version(int, int, int, int) 146 CIMG_get_version(String) 146 CIMG_ifl_version() 147 CIMGLOW_get_anim_delay() 148 CIMGLOW_get_auto_detect() 148 CIMGLOW_get_bitmap_header() 149 CIMGLOW_get_bitmap_name() 149 CIMGLOW_get_custstring() 150 CIMGLOW_get_fileinfo() 150 CIMGLOW_get_fileinfo_fd() 151 CIMGLOW_get_fileinfo_page() 152 CIMGLOW_get_fileinfo_fd() 152 CIMGLOW_get_filetype() 153 CIMGLOW_get_filetype_fd() 153 CIMGLOW_get_filetype_mem() 154 CIMGLOW_get_filetype_url() 154 CIMGLOW_get_image_orientation_page() 155 CIMGLOW_get_pages() 155 CIMGLOW_get_pages_fd() 156 CIMGLOW_get_pages_mem() 157 CIMGLOW_get_pages_url() 157 CIMGLOW_get_tiff_tag() 158 CIMGLOW_get_tiff_tag_page() 159 CIMGLOW_get_tiff_tag_page_fd() 160 CIMGLOW_get_tiff_tag_page_mem() 160 CIMGLOW_get_tile_info() 161 CIMGLOW_get_transp_color() 162 CIMGLOW_is_tiled_image() 162 CIMGLOW_read_pixel() 163 CIMGLOW_set_bitmap_header() 163 CIMGLOW_set_document() 164 CIMGLOW_set_document_input(int, int) 165 CIMGLOW_set_document_input(int, int, int) 166 CIMGLOW_set_document_page_size(int, int, int) 167 Chapter 24 - Text Search Functions 169 CIMG_save_document() 169 CIMG_save_mem() 171 CIMG_save_mem_page() 171 CIMGLOW_append_page() 172 11 CIMGLOW_extract_text() 172 CIMGLOW_extract_text_mem_pointer() 174 CIMGLOW_extract_page() 175 CIMGLOW_extract_page_mem() 175 CIMGLOW_search_text() 176 CIMGLOW_set_document_input() 177 Chapter 25 - AFP Font Mapping Functions AFP Font Mapping 178 Format of Font Mapping Data 178 Color Documents Rendered as Black and White 179 CIMGLOW_set_fontmap_path() 179 CIMGLOW_set_fontmap() 180 CIMGLOW_set_pdf_flags() 181 CIMGLOW_set_pdf_fontpath() 181 CIMGLOW_set_pdfa_fontpath() 182 CIMGLOW_set_pdfa_fontmap() 182 Chapter 26 - Housekeeping Functions 184 CIMG_delete_bitmap() 184 CIMG_delete_bitmap_keep() 185 CIMG_unload_plugins() 185 CIMGLOW_set_bitmap_name() 185 CIMGLOW_set_tiff_indexing() 186 Chapter 27 - DocClean Functions 187 CIMG_auto_orient() 12 178 187 CIMG_deskew_bitmap() 187 CIMG_despeckle_bitmap() 188 CIMGLOW_auto_invert() 189 CIMGLOW_detect_blank_page() 190 CIMGLOW_image_dilation() 191 CIMGLOW_image_erosion() 192 CIMGLOW_remove_halftone() 192 CIMGLOW_remove_lines() 193 CIMGLOW_remove_holepunch() 193 Chapter 28 - Image Processing Functions 196 CIMG_antique_effect() 196 CIMG_apply_profile() 196 CIMG_auto_orient() 197 CIMG_autocrop_bitmap() 197 CIMG_create_thumbnail() 198 CIMG_deskew_bitmap() 199 CIMG_despeckle_bitmap() 199 CIMG_dib_to_ddb() 200 CIMG_dib_to_runs() 201 CIMG_erase_rect() 201 CIMG_flip_bitmapx() 201 CIMG_flip_bitmapy() 202 CIMG_get_deskew_angle() 202 CIMG_get_profile() 203 13 CIMG_histogram_equalize() 203 CIMG_invert_bitmap() 204 CIMG_merge_annotation() 204 CIMG_merge_bitmap() 205 CIMG_merge_bitmap() 206 CIMG_merge_bitmap_alpha() 208 CIMG_process_bitmap() 209 CIMG_remove_red_eye() 210 CIMG_resize_bitmap() 211 CIMG_resize_bitmap_bicubic() 212 CIMG_resize_bitmap_interp() 212 CIMG_rotate_bitmap() 213 CIMG_runs_to_dib() 214 CIMG_set_display_angle() 214 CIMG_sharpen_bitmap() 215 CIMGLOW_get_palette() 215 CIMGLOW_get_raster() 216 CIMGLOW_put_palette() 216 CIMGLOW_put_raster() 217 CIMGLOW_set_fast_convert() 217 Chapter 29 - Document Conversion and Text Extraction Functions 14 219 Document Conversion and Text Extraction 219 CIMGLOW_extract_text() 219 CIMGLOW_extract_text_mem() 221 CIMG_save_document() 222 CIMG_save_document_mem() 224 Chapter 30 - Color Promotion Functions 226 CIMG_promote_8() 226 CIMG_promote_24() 227 CIMG_promote_32() 227 Changing Color Spaces Functions 227 CIMG_rgb_to_cmyk() 227 CIMG_cmyk_to_rgb() 228 CIMG_color_combine() 228 CIMG_color_separate() 229 CIMGLOW_get_tiff_tag() 230 Chapter 31 - Color Reduction Functions 232 CIMG_color_gray() 232 CIMG_resize_to_gray() 232 CIMG_popularity_color() 233 CIMG_mediancut_color() 234 CIMG_octree_color() 234 CIMG_bayer_color() 235 CIMG_bayer_mono() 235 CIMG_diffusion_mono() 236 CIMG_thresh_mono() 236 CIMG_halftone_mono() 237 CIMGLOW_detect_color() 238 15 Chapter 32 - ASCII Formats and Functions ASCII Attribute Structure 240 CIMG_import_ascii() 244 CIMGLOW_get_ascii_attributes() 244 CIMGLOW_get_ascii_page_width() 245 CIMGLOW_set_ascii_attributes() 245 Chapter 33 - Format For Decompressed Images 247 Overview of Data Formats 247 RasterMaster Plus Options 247 MS_Windows DIB Header Format 248 MS_Windows DIB Palette Format 248 MS_Windows DIB Image Data Format 249 Chapter 34 - Annotation and Redlining Toolkit 16 240 250 public class CANN_GRAPHIC_STRUCT Structure 250 CSANN_activate_all_objects() 251 CSANN_activate_object() 252 CSANN_add_object() 252 CSANN_choose_color() 253 CSANN_choose_font() 253 CSANN_choose_line_style() 254 CSANN_choose_line_width() 254 CSANN_create_ann() 255 CSANN_deactivate_all_objects() 255 CSANN_deactivate_object() 256 CSANN_delete_all_objects() 256 CSANN_delete_non_text_objects() 256 CSANN_delete_object() 257 CSANN_delete_text_objects() 257 CSANN_display_annotations() 257 CSANN_draw_object() 258 CSANN_FlipX() 259 CSANN_FlipY() 259 CSANN_get_croprect() 259 CSANN_get_disprect() 259 CSANN_get_object_bounds() 260 CSANN_get_object_data() 260 CSANN_get_object_info() 261 CSANN_get_object_num() 261 CSANN_highlight_object() 262 CSANN_map_image_to_wnd() 262 CSANN_map_wnd_to_image() 263 CSANN_mouse() 263 CSANN_move_object() 264 CSANN_print_annotations() 264 CSANN_read_ann() 265 CSANN_read_ann_FlexSnap() 265 CSANN_read_ann_mem() 266 CSANN_read_ann_mem_page() 266 17 CSANN_read_ann_page() 267 CSANN_resize_object() 267 CSANN_rotate() 267 CSANN_set_bcolor() 268 CSANN_set_croprect() 268 CSANN_set_disprect() 269 CSANN_set_fcolor() 269 CSANN_set_font() 270 CSANN_set_line_style() 270 CSANN_set_line_width() 271 CSANN_set_size() 271 CSANN_write_ann() 272 CSANN_write_ann_FlexSnap() 273 CSANN_write_ann_mem() 273 CSANN_write_ann_mem_page() 273 CSANN_write_ann_page() 274 Annotation Constants 274 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Working with .NET Bitmapsource for the WPF Image Control 18 276 277 CIMG_create_bitmapsource_class() 277 CIMG_create_bitmapsource_class() 277 CIMG_create_bitmapsource_annotation() 278 CIMG_scan_acquire_WPF() 278 CIMG_scan_acquire_feeder_WPF() 279 CIMG_scan_acquire_feeder_fast_WPF() 279 CIMG_scan_open_source_WPF() 280 CIMG_scan_pages_fast_WPF() 280 CIMG_scan_pages_WPF() 281 CIMG_scan_get_cap_WPF() 282 CIMG_scan_set_cap_WPF() 282 CIMG_scan_setup_WPF() 283 Annotating with .NET WPF controls 284 CSANN_create_ann_WPF() 284 CSANN_get_object_num_WPF() 284 CSANN_highlight_object_WPF() 285 CSANN_read_ann_WPF() 285 CSANN_read_ann_page_WPF() 286 CSANN_read_ann_mem_page_WPF() 286 CSANN_read_ann_mem_WPF() 287 Working with XML Paper Specification (XPS) Documents 287 CIMG_get_pages_xps() 287 CIMG_get_pages_xps_mem() 288 CIMG_decompress_bitmap_xps() 289 CIMG_decompress_bitmap_xps_mem() 289 Chapter 36 - Working with PDF and Other Document File Formats Working with Document File Formats Saving Reading and Writing Support for PDF File Formats 291 291 292 292 19 Reading or Decompressing a PDF Document 292 Saving to a PDF Document 293 Working with Black and White Images 293 Working with Color Images 293 Changing Output Page Size 293 Performance 294 Appendix A - Classes and Support Values Type Property Define Values 295 General Error Define Values Retrieved from Status Property 296 public class CIMG_RECT 297 public class CIMG_SEARCH_RESULT 297 public class CASCIITEXTATTR 298 public class CSEARCH_TEXT 300 public class CDIB_HEADER 300 public class CTIFF_TAG 300 public class CSNBDTILESTRUCT 301 Appendix B - Supported File Formats 302 Descriptions of Supported File Formats 302 File Type Constants Listed by File Type Number 314 Appendix C - Software Installation 20 295 317 Overview of the Installation Process 317 Redistributing Snowbound Files 318 What to Expect When Installing an Evaluation Version 318 What to Expect in a Production Version 318 Installing the Production Version of RasterMaster .NET 318 Installing the Software 319 Directory Structure 324 Installed Files 324 Main Directory Files 325 Strong Name Support 325 Docs Directory Files 326 Marketing Directory Files 326 Sample Directory Files 327 Chapter D - Set Up for ASP .NET Samples 331 Overview of the Set Up Process 331 Setting Up the Environment to Run Web Applications 332 Setting Up Samples on a Web Server 333 Running ASP.NET Samples 337 Chapter E - Set Up for the Web Image Viewer Component Introduction to the Web Image Viewer 339 339 Steps to Run the Web Image Viewer Control in Internet Explorer 339 Troubleshooting 340 Appendix F - .NET Samples 342 Overview of the .NET Samples 343 Running a Sample 343 Building 32-bit Application Running on a 64-bit Operating System 343 Building for a 64-bit Operating System 344 Building a RasterMaster .NET x64 sample with .NET 4.0 344 21 22 Building a RasterMaster .NET x32 sample with .NET 2.0 344 Alpha 345 Animate 345 Annaction 346 Annotation 346 ASP Conversion 348 ASP Image View 348 ASP Memory Copy 348 ASP Multiple Pages 349 Batch_XPS_Convert 349 BatchConvert 349 ConsoleApp 350 Contrast 350 Conversion 351 Convert_Doc 351 DDB Effect 352 DocClean 352 Encryption 353 FileMem 353 Image Processing 353 Memory Copy 354 Merge Image 354 Page 355 Panning 355 Print 355 Scan 356 Split to Multiple Pages 356 Text Search 357 Thumbnail 357 Tiff Tag 358 Web Image Viewer Component 358 WPFAnnotation_CSHARP 359 WPFConversion_CSHARP 359 WPFScanning_CSHARP 360 WPF Image 360 VectorConvertMem_CSHARP 361 XPSMem_CSHARP 361 Appendix G - Snowbound Error Codes 362 Detailed Status/Error Codes 362 General Error Define Values Retrieved from Status Property 365 General Status/Error Codes 366 Appendix H - Troubleshooting 367 Receiving an Error Code When Loading, Saving or Converting a Document 367 Output Document Differs from Original Document 367 Output Document Has Much Larger File Size than the Original Document 367 Output Document Has Much Lower Quality than the Original Document 368 Output Document Displays Incorrect or Missing Characters 369 Improving Performance 369 23 Identifying an Unknown File Format 370 Receiving a -3 Corrupted File Error code 370 XLS or XLSX Page Content Truncated 370 Overlay Resources Not Pulled into APF or MODCA Document 370 Searching for Text in a Snowbound Software Generated PDF 371 Some TIFF_JPEG Files Produced By RasterMaster .NET Do Not Open In Third Party Image Viewers 371 RasterMaster .NET 4.0 Compatability 371 Color Documents Rendered as Black and White 372 Upgrading to the RasterMaster .NET 18.0 Library 372 Getting RasterMaster .NET x32 to work with IIS 7.5 373 Appendix I - TIFF Tags 24 374 Sources for Tag Specifications 374 Descriptions of Tags in Numerical Order 375 List of Tables Table 2.1: RasterMaster .NET Samples Directory 42 Table 2.2: Memory Requirements Based on Image Size 48 Table 3.1: Supported Multi-page Functions 50 Table 4.1: CIMG_print_bitmap Function Variables 52 Table 4.2: CIMG_print_bitmap_fast Function Variables 53 Table 5.1: Aspect Ratio Function Description 55 Table 9.1: Snowbnd(int width, int height, int bitsperpixel) Method Variables 64 Table 10.1: ToErrorMessage Variable 66 Table 11.1: SnowPanel Class Specific Method Properties 67 Table 11.2: CustomPaint Variable 67 Table 11.3: OnPaint Variable 68 Table 11.4: OnPaintBackground Variable 68 Table 11.5: OnSizeChanged Variable 69 Table 12.1: CSCAN_CAPS Variables 70 Table 12.2: CIMG_scan_acquire Function Variable 71 Table 12.3: CIMG_scan_acquire_feeder Function Variables 72 Table 12.4: CIMG_scan_acquire_feeder_fast Function Variables 72 Table 12.5: CIMG_scan_get_cap Function Variables 73 Table 12.6: CIMG_scan_open_source Function Variable 74 Table 12.7: CIMG_scan_pages Function Variables 74 Table 12.8: CIMG_scan_page_fast Function Variables 75 Table 12.9: CIMG_scan_set_cap Function Variables 76 25 26 Table 12.10: CIMG_scan_set_caps Function Variable 76 Table 12.11: CIMG_scan_setup Function Variable 77 Table 13.1: Scrollbar Default Function Properties 78 Table 13.2: SnowbndCNet _HScrollBar Variables 78 Table 13.3: SnowbndCNet _VScrollBar Variables 79 Table 14.1: : CIMG_decompress_bitmap Function Variable 81 Table 14.2: CIMG_decompress_bitmap_display Function Variables 82 Table 14.3: CIMG_decompress_bitmap_fd Function Variables 83 Table 14.4: CIMG_decompress_bitmap_FlexSnap Function Variables 83 Table 14.5: CIMG_decompress_bitmap_mem Function Variables 84 Table 14.6: CIMG_decompress_bitmap_page Function Variables 85 Table 14.7: CIMG_decompress_bitmap_url Function Variables 86 Table 14.8: CIMG_decompress_bitmap_xps Function Variables 87 Table 14.9: CIMG_decompress_fax Function Variables 87 Table 14.10: CIMG_decompress_fax_mem Function Variables 88 Table 14.11: CIMG_decompress_tiled_bitmap Function Variables 89 Table 15.1: CIMGLOW_set_auto_detect Function Variable 90 Table 15.2: CIMGLOW_set_decomp_rect Function Variables 91 Table 15.3: CIMGLOW_set_decomp_reduction Function Variable 91 Table 15.4: CIMGLOW_set_decompsize Function Variables 92 Table 15.5: CIMGLOW_set_jpeg_decompression Function Variable 92 Table 15.6: CIMGLOW_set_pdf_input Function Variables 94 Table 15.7: CIMGLOW_set_pdf_password Function Variables 94 Table 15.8: CIMGLOW_unset_auto_detect Function Variable 95 Table 16.1: CIMG_create_bitmap_class Function Variable 96 Table 16.2: CIMG_create_handle Function Variable 96 Table 16.3: CIMG_create_handle_ddb Function Variables 97 Table 16.4: CIMG_create_handle_keep Function Variable 98 Table 17.1: CIMGLOW_set_html_input function variable descriptions. 99 Table 17.2: CIMGLOW_set_html_page_size function variable descriptions . 99 Table 17.3: CIMGLOW_set_html_capabilities Function Variables 100 Table 17.4: CIMGLOW_set_html_home_dir function variable descriptions. 101 Table 17.5: CIMGLOW_set_html_image_capability function variable descriptions. 102 Table 17.6: CIMGLOW_set_html_javascript_capability function variable descriptions. 103 Table 17.7: CIMGLOW_set_html_page_size_ratio function variable descriptions . 103 Table 17.8: CIMGLOW_set_html_page_size_ratio_capability function variable descriptions . 104 Table 17.9: CIMGLOW_set_html_screen_dpi function variable descriptions . 104 Table 17.10: CIMGLOW_set_html_use_page_breaks_exclusively function variable descriptions. 105 Table 17.11: CIMGLOW_set_html_utf_bom Function Variables 105 Table 17.12: Representations of byte order marks by encoding 106 Table 18.1: CIMGLOW_set_ooxml_license function variable descriptions. 108 Table 18.2: CIMGLOW_ooxml_license_enable Function Variable 109 Table 19.1: CIMG_save_bitmap Function Variables 111 Table 19.2: CIMG_save_bitmap_fd Function Variables 111 Table 19.3: CIMG_save_bitmap_mem Function Variables 112 Table 19.4: CIMGLOW_write_tiff_stream Function Variables 113 27 28 Table 20.1: CIMG_set_encrypt Function Variables 114 Table 20.2: CIMGLOW_set_comp_quality Function Variable 115 Table 20.3: CIMGLOW_set_image_orientation Function Variable 115 Table 20.4: CIMGLOW_set_jpeg2000_comp_ratio Function Variable 116 Table 20.5: CIMGLOW_set_jpg_interleave Function Variables 116 Table 20.6: CIMGLOW_set_pdf_output Function Variables 117 Table 20.7: CIMGLOW_set_tiff_save_strips Function Variable 118 Table 20.8: CIMGLOW_set_tiff_tag Function Variable 118 Table 21.1: bool repaintBackground Variables 120 Table 21.2: CIMG_display_bitmap Function Variables 121 Table 21.3: CIMG_display_bitmap_aspect Variables 122 Table 21.4: CIMG_display_bitmap_transp Function Variables 123 Table 21.5: CIMG_display_ddb Function Variables 123 Table 21.6: CIMG_display_fit_to_height Function Variables 124 Table 21.7: CIMG_display_fit_to_width Function Variables 125 Table 21.8: CIMG_set_croprect Function Variables 126 Table 21.9: CIMG_set_croprect_scroll Function Variables 126 Table 21.10: CIMG_zoom_bitmap Function Variables 127 Table 21.11: CIMG_zoom_bitmap_1_to_1 Function Variables 127 Table 21.12: CIMG_zoom_bitmap_rect Function Variables 128 Table 21.13: CIMGLOW_map_image_to_wnd Function Variables 129 Table 21.14: CIMGLOW_map_wnd_to_image Function Variables 129 Table 21.15: double calcAspectZoom Variables 130 Table 21.16: RemoveScrollbars Variables 131 Table 22.1: CIMG_animate Function Variables 132 Table 22.2: CIMG_bitmap_palette Function Variable 133 Table 22.3: CIMG_display_ddb_effect Function Variables 133 Table 22.4: CIMG_set_gamma Function Variable 134 Table 22.5: CIMG_set_lut Function Variables 135 Table 22.6: CIMG_window_level Function Variables 136 Table 22.7: CIMGLOW_autocolor Function Variable 136 Table 22.8: CIMGLOW_set_alias_img Function Variable 137 Table 22.9: CIMGLOW_set_alias_quality Function Variable 138 Table 22.10: CIMGLOW_set_dithermode Function Variable 138 Table 22.11: CIMGLOW_set_imnet_page_size Function Variables 139 Table 22.12: CIMGLOW_set_rop Function Variables 140 Table 22.13: CIMGLOW_set_transp_color Function Variable 141 Table 22.14: CIMGLOW_set_wipedelay Function Variable 141 Table 23.1: CIMG_bitmap_info Function Variable 144 Table 23.2: CIMG_get_croprect Function Variable 145 Table 23.3: CIMG_get_display_rect Function Variables 145 Table 23.4: CIMG_get_version Function Variable 146 Table 23.5: CIMG_get_version Function Variable 147 Table 23.6: CIMG_ifl_version Function Variable 147 Table 23.7: CIMGLOW_get_anim_delay Function Variable 148 Table 23.8: CIMGLOW_get_auto_detect Function Variable 148 Table 23.9: CIMGLOW_get_bitmap_header Function Variables 149 Table 23.10: CIMGLOW_get_bitmap_name Function Variables 149 29 30 Table 23.11: CIMGLOW_get_custstring Function Variable 150 Table 23.12: CIMGLOW_get_fileinfo Function Variables 151 Table 23.13: CIMGLOW_get_fileinfo_fd Function Variables 151 Table 23.14: CIMGLOW_get_fileinfo_page Function Variables 152 Table 23.15: CIMGLOW_get_fileinfo_fd Function Variables 152 Table 23.16: CIMGLOW_get_filetype Function Variable 153 Table 23.17: CIMGLOW_get_filetype_fd Function Variable 153 Table 23.18: CIMGLOW_get_filetype_mem Function Variable 154 Table 23.19: CIMGLOW_get_filetype_url Function Variable 154 Table 23.20: CIMGLOW_get_image_orientation_page Function Variables 155 Table 23.21: CIMGLOW_get_pages Function Variable 156 Table 23.22: CIMGLOW_get_pages_fd Function Variable 156 Table 23.23: CIMGLOW_get_pages_mem Function Variable 157 Table 23.24: CIMGLOW_get_pages_url Function Variable 157 Table 23.25: CIMGLOW_get_tiff_tag Function Variables 158 Table 23.26: CIMGLOW_get_tiff_tag_page Function Variables 159 Table 23.27: CIMGLOW_get_tiff_tag_page_fd Function Variables 160 Table 23.28: CIMGLOW_get_tiff_tag_page_mem Function Variables 160 Table 23.29: CIMGLOW_get_tile_info Function Variables 161 Table 23.30: CIMGLOW_is_tiled_image Function Variable 162 Table 23.31: CIMGLOW_read_pixel Function Variables 163 Table 23.32: CIMGLOW_set_bitmap_header Function Variables 163 Table 23.33: CIMGLOW_set_document Function Variables 164 Table 23.34: CIMGLOW_set_document_input Function Variables 165 Table 23.35: CIMGLOW_set_document_input Function Variable 167 Table 23.36: CIMGLOW_set_document_page_size Function Variable 167 Table 24.1: CIMG_save_document Function Variables 169 Table 24.2: CIMG_save_mem Function Variables 171 Table 24.3: CIMG_save_mem_page Function Variables 171 Table 24.4: CIMGLOW_append_page Function Variables 172 Table 24.5: CIMGLOW_extract_text Function Variables 173 Table 24.6: Extracted Text Variables 173 Table 24.7: CIMGLOW_extract_text_mem_pointer Function Variables 174 Table 24.8: CIMGLOW_extract_page Function Variables 175 Table 24.9: CIMGLOW_extract_page_mem Function Variables 175 Table 24.10: CIMGLOW_search_text Function Variables 176 Table 24.11: CIMGLOW_set_document_input Function Variables 177 Table 25.1: Description of a sample entry in the snbd_map.fnt file 179 Table 25.2: CIMGLOW_set_fontmap_path Function Variables 180 Table 25.3: CIMGLOW_set_fontmap Function Variables 180 Table 25.4: CIMGLOW_set_pdf_flags Function Variables 181 Table 25.5: CIMGLOW_set_pdf_fontpath Function Variables 181 Table 25.6: CIMGLOW_set_pdfa_fontpath Function Variables 182 Table 25.7: CIMGLOW_set_pdfa_fontmap Function Variables 182 Table 26.1: CIMGLOW_set_bitmap_name Function Variables 185 Table 26.2: CIMGLOW_set_tiff_indexing Function Variables 186 Table 27.1: CIMG_auto_orient Function Variables 187 Table 27.2: CIMG_deskew_bitmap Function Variable 188 31 32 Table 27.3: CIMG_despeckle_bitmap Function Variable 188 Table 27.4: CIMGLOW_auto_invert Function Variables 189 Table 27.5: CIMGLOW_detect_blank_page Function Variables 190 Table 27.6: CIMGLOW_image_dilation Function Variable 191 Table 27.7: CIMGLOW_image_erosion Function Variable 192 Table 27.8: CIMGLOW_remove_halftone Function Variables 192 Table 27.9: CIMGLOW_remove_lines Function Variables 193 Table 27.10: CIMGLOW_remove_holepunch Function Variables 194 Table 28.1: CIMG_apply_profile Function Variables 196 Table 28.2: CIMG_apply_profile Variable Modes 196 Table 28.3: CIMG_auto_orient Function Variable 197 Table 28.4: CIMG_autocrop_bitmap Function Variable 198 Table 28.5: CIMG_create_thumbnail Function Variables 198 Table 28.6: CIMG_deskew_bitmap Function Variable 199 Table 28.7: CIMG_despeckle_bitmap Function Variable 200 Table 28.8: CIMG_dib_to_ddb Function Variables 200 Table 28.9: CIMG_erase_rect Function Variables 201 Table 28.10: CIMG_get_deskew_angle Function Variables 202 Table 28.11: CIMG_get_profile Function Variables 203 Table 28.12: CIMG_merge_annotation Function Variables 204 Table 28.13: CIMG_merge_bitmap Function Variables 205 Table 28.14: CIMG_merge_bitmap Function Variables 207 Table 28.15: CIMG_merge_bitmap_alpha Function Variables 209 Table 28.16: CIMG_process_bitmap Function Variables 209 Table 28.17: CIMG_remove_red_eye Function Variables 210 Table 28.18: CIMG_resize_bitmap Function Variables 211 Table 28.19: CIMG_resize_bitmap_bicubic Function Variables 212 Table 28.20: CIMG_resize_bitmap_interp Function Variables 212 Table 28.21: CIMG_rotate_bitmap Function Variable 213 Table 28.22: CIMG_set_display_angle Function Variable 214 Table 28.23: CIMG_sharpen_bitmap Function Variable 215 Table 28.24: CIMGLOW_get_palette Function Variables 215 Table 28.25: CIMGLOW_get_raster Function Variables 216 Table 28.26: CIMGLOW_put_palette Function Variables 216 Table 28.27: CIMGLOW_put_raster Function Variables 217 Table 28.28: CIMGLOW_set_fast_convert Function Variables 218 Table 29.1: CIMGLOW_extract_text Function Variables 220 Table 29.2: Extracted Text Variable 220 Table 29.3: CIMGLOW_extract_text_mem Function Variables 221 Table 29.4: Extracted Text Variable 221 Table 29.5: CIMG_save_document Function Variables 223 Table 29.6: CIMG_save_document_mem Function Variables 224 Table 30.1: CIMG_color_combine Function Variables 228 Table 30.2: CIMG_color_separate Function Variables 229 Table 30.3: CIMGLOW_get_tiff_tag Function Variables 230 Table 31.1: CIMG_resize_to_gray Function Variables 233 Table 31.2: CIMG_octree_color Function Variables 234 Table 31.3: CIMG_thresh_mono Function Variable 237 33 34 Table 32.1: public class CASCIITEXTATTR Variables 241 Table 32.2: ASCIITEXTATTR Function Flags 242 Table 32.3: Standard Page Sizes 243 Table 32.4: CIMG_import_ascii Function Variables 244 Table 32.5: CIMGLOW_get_ascii_attributes Function Variable 244 Table 32.6: CIMGLOW_get_ascii_page_width Function Variable 245 Table 32.7: CIMGLOW_set_ascii_attributes Function Variable 245 Table 33.1: MS_Windows DIB Palette Format 249 Table 33.2: MS_Windows DIB Image Data Format 249 Table 34.1: CANN_GRAPHIC_STRUCT Class Variables 251 Table 34.2: CSANN_activate_objectFunction Variables 252 Table 34.3: CSANN_add_object Function Variables 253 Table 34.4: CSANN_choose_color Function Variable 253 Table 34.5: CSANN_choose_line_style Function Variable 254 Table 34.6: CSANN_choose_line_width Function Variable 255 Table 34.7: CSANN_create_ann Function Variables 255 Table 34.8: CSANN_deactivate_object Function Variables 256 Table 34.9: CSANN_delete_object Function Variables 257 Table 34.10: CSANN_display_annotations Function Variables 258 Table 34.11: CSANN_draw_object Function Variables 258 Table 34.12: CSANN_get_croprect Function Variables 259 Table 34.13: CSANN_get_disprect Function Variables 260 Table 34.14: CSANN_get_object_bounds Function Variables 260 Table 34.15: CSANN_get_object_dataFunction Variables 260 Table 34.16: CSANN_get_object_info Function Variables 261 Table 34.17: CSANN_get_object_num Function Variables 261 Table 34.18: CSANN_highlight_object Function Variables 262 Table 34.19: CSANN_map_image_to_wnd Function Variables 262 Table 34.20: CSANN_map_wnd_to_image Function Variables 263 Table 34.21: CSANN_mouse Function Variables 263 Table 34.22: Table 34-22: CSANN_move_object Function Variables 264 Table 34.23: CSANN_print_annotations Function Variables 265 Table 34.24: CSANN_read_ann Function Variables 265 Table 34.25: CSANN_read_ann_FlexSnap Function Variables 266 Table 34.26: CSANN_read_ann_mem Function Variables 266 Table 34.27: CSANN_read_ann_mem_page Function Variables 266 Table 34.28: CSANN_read_ann_page Function Variables 267 Table 34.29: CSANN_resize_object Function Variables 267 Table 34.30: CSANN_rotate Function Variables 268 Table 34.31: CSANN_set_bcolor Function Variables 268 Table 34.32: CSANN_set_croprect Function Variables 269 Table 34.33: CSANN_set_disprect Function Variables 269 Table 34.34: CSANN_set_fcolor Function Variables 270 Table 34.35: CSANN_set_font Function Variables 270 Table 34.36: CSANN_set_line_style Function Variables 271 Table 34.37: CSANN_set_line_width Function Variables 271 Table 34.38: CSANN_set_size Function Variables 272 Table 34.39: CSANN_write_ann Function Variables 272 35 36 Table 34.40: CSANN_write_ann_FlexSnap Function Variables 273 Table 34.41: CSANN_write_ann_mem Function Variables 273 Table 34.42: CSANN_write_ann_mem_page Function Variables 274 Table 34.43: CSANN_write_ann_page Function Variables 274 Table 34.44: Annotation Constants 274 Table 35.1: CIMG_create_bitmapsource_class Function Variable 277 Table 35.2: CIMG_create_bitmapsource_class Function Variable 277 Table 35.3: CIMG_create_bitmapsource_annotation Function Variables 278 Table 35.4: CIMG_scan_acquire_WPF Function Variables 278 Table 35.5: CIMG_scan_acquire_feeder_WPF Function Variables 279 Table 35.6: CIMG_scan_acquire_feeder_fast_WPF Function Variables 280 Table 35.7: CIMG_scan_open_source_WPF Function Variable 280 Table 35.8: CIMG_scan_pages_fast_WPF Function Variable 281 Table 35.9: CIMG_scan_pages_WPF Function Variables 281 Table 35.10: CIMG_scan_get_cap_WPF Function Variables 282 Table 35.11: CIMG_scan_set_cap_WPF Function Variables 283 Table 35.12: CSANN_create_ann_WPF Function Variables 284 Table 35.13: CSANN_get_object_num_WPF Function Variables 284 Table 35.14: CSANN_highlight_object_WPF Function Variables 285 Table 35.15: CSANN_read_ann_WPF Function Variables 286 Table 35.16: CSANN_read_ann_page_WPF Function Variables 286 Table 35.17: CSANN_read_ann_mem_page_WPF Function Variables 287 Table 35.18: CSANN_read_ann_mem_WPF Function Variables 287 Table 35.19: CIMG_get_pages_xps Function Variable 288 Table 35.20: CIMG_get_pages_xps_mem Function Variable 288 Table 35.21: CIMG_decompress_bitmap_xps Function Variables 289 Table 35.22: CIMG_decompress_bitmap_xps_mem Function Variables 289 Table 36.1: CIMGLOW_set_document Function Variables 291 Table 36.2: CIMGLOW_set_pdf_output Function Variables 292 Table A.1: Type Property Define Values 295 Table A.2: General Error Define Values Retrieved from Status Property 296 Table A.3: public class CIMG_RECT Variables 297 Table A.4: public class CIMG_SEARCH_RESULT Variables 298 Table A.5: public class CASCIITEXTATTR Variables 299 Table A.6: public class CTIFF_TAG Variables 301 Table B.1: File Format Key 302 Table B.2: File Type Constants listed by File Type Number 314 Table C.1: RasterMaster .NET Default Directory File 325 Table C.2: RasterMaster .NET Docs Directory Files 326 Table C.3: RasterMaster .NET Samples Directory 327 Table G.1: Error Codes 362 Table G.2: General Error Define Values Retrieved from Status Property 365 Table G.3: General Status/Error Codes 366 Table I.1: TIFF Tags in Numerical Order1 375 37 Chapter 1 - Additions and Improvements Chapter 1 - Additions and Improvements This chapter describes the latest additions and improvements to the software. Version 19.0 Additions and Improvements The following are the new features and formats added to Version 19.0 of RasterMaster .NET. New Features The following are the new features added to Version 19.0 of the product. Format Fixes l Enhancements and bug fixes to the AFP file format. l Multiple enhancements and bug fixes to the PCL file format. l Multiple enhancements and bug fixes to the PDF file format. Office Enhancements l l l Added support for tab lead, paragraph border, and shading to extracted text buffer. Also fixed center aligned images in extracted content used for searchable PDF output. An XLSX document created by an application other than Microsoft Excel contained a double byte null in the CONTINUE portion of a definition in the strings table. This is a very unusual, but valid, construct. Enhanced RasterMaster to accept the double byte NULL in the string definitions. Added support for XLS custom and locale-specific date formats. In xls_use_format() added support for the following custom date format: [$-F800]dddd, mmmm dd, yyyy PDF/A 1b with Embedded Fonts Beta Support l Added beta support for PDF/A 1b with Embedded Fonts. Snowbound’s PDF/A 1bcompliant output files use the basic fonts included with the Snowbound product. This may result in the PDF output document looking slightly different than the original. You may have additional fonts that you are licensed to embed in documents. You can tell RasterMaster to use these additional fonts by calling CIMGLOW_set_pdfa_fontpath to specify the directory where the fonts are located. You can also tell RasterMaster to substitute one font for another using CIMGLOW_set_ pdfa_fontmap. For example, if your documents use Arial but you own the Helvetica font and want to use that instead, you could map Arial to Helvetica using this method. 38 Chapter 1 - Additions and Improvements The following two methods are available to make it possible for clients to have a bit of control over the fonts: CIMGLOW_set_pdfa_fontpath tells us where to look for the base fonts. If this function is not called, the fonts are expected to be in c:\fonts. The path is limited to one directory. CIMGLOW_set_pdfa_fontmap. allows the client to provide a stream of bytes defining the mapping from one font/style to another. The remapData stream should contain multiple entries separated by a newline character. The len parameter indicates how many bytes are in the stream. Enhanced Support for MS Office 2013 File Formats l Enhanced support for MS Office 2013 file formats. DWG Support for the 64-bit Library l Added DWG support for the 64-bit library. UTF-8 Text Format Improvements for .NET l The Text format now supports auto-detection and handling of UTF-8 and UTF-16 text for better support of international documents. UTF-16 text must be preceded by a Byte Order Marker (BOM). Added Support for Page Width Auto-grow l Added functionality to auto-grow page width to accommodate files with many columns. To set auto-grow in width to true set the page width parameter to -1 as shown in the following example: CIMGLOW_set_document_page_size(-1.0, 11, XLS) Setting the width to -1 for auto-grow defaults the page width to US Letter (8.5"). The page width will auto-grow to fit all columns and image data in the file. This is supported for XLS, XLSX. It should have no affect on DOC, DOCX, PPT, PPTX, HTML or PDF files. Currently there is no auto-grow in page height. Setting the page height to -1 will not auto-grow the height, but instead set the height to a default value. For example: US Letter 11”. New Annotation Read/Write XML Functions l Added new annotation read/write xml functions annCreateUser and annCreateDate to RasterMaster .NET as shown in the following example: public __gc class CANN_GRAPHIC_STRUCT 39 Chapter 1 - Additions and Improvements String create_date - The annotation object created date. String create_user -The user name which created the annotation object. Right-to-Left (RTL) Text Searching l Improved searching for Right-to-Left (RTL) text such as Hebrew and Arabic. Note: Mixing Right-to-Left, numbers, and Left-to-Right characters on the same line may result in unexpected results. We recommend not mixing the direction of characters. 40 Chapter 2 - Quick Start Chapter 2 - Quick Start This chapter describes how to quickly start decompressing and displaying images using RasterMaster .NET. If you do not find the information that you are looking for in this manual, please open a support ticket at http://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 product. 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 information, please see Appendix F, .NET Samples on how to find and run the Conversion sample. The Conversion sample uses three routines that are at the heart of RasterMaster .NET: 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 performance, 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). Therefore, we can only extract text from documents that contain text. You can use RasterMaster .NET in conjunction with OCR tools from other companies if you need to extract text from scanned document images. 41 Chapter 2 - Quick Start 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. If you have any questions please do not hesitate to open a support ticket at http://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 21. All of the .NET samples include C#.NET and VB.NET source code. For more information about each sample, see Appendix F, .NET Samples. Table 2.1: RasterMaster .NET Samples Directory Sample Alpha_csharp Alpha_VB Animate_CSHARP Animate_VB annaction_csharp annaction_VB Annotation_CSHARP Annotation_VB ASPConversion_CSHARP ASPConversion_VB ASPImageView_CSHARP 42 Description Sample for using the .NET library in C# to load, display 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 and rotate to manipulate the image. See Alpha for more information. Sample for displaying an animated GIF image in C#. See Animate for more information. Sample for displaying an animated GIF image in Visual Basic. See Animate for more information. Sample for using the .NET library in C# mouse handler to add an annotation. See Annaction for more information. Sample for using the .NET library in Visual Basic mouse handler to add an annotation. See Annaction for more information. Sample for using the .NET library in C# to add an annotation. See Annotation for more information. Sample for using the .NET library in Visual Basic to add an annotation. See Annotation for more information. Sample for demonstrating a simple conversion in C#. See ASP Conversion for more information. Sample for demonstrating a simple conversion in Visual 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 Chapter 2 - Quick Start Sample ASPImageView_VB ASPMemCopy_CSHARP ASPMemCopy_VB ASPMultiPage_CSHARP ASPMultiPage_VB Contrast_CSHARP Contrast_VB Conversion_CSHARP Conversion_VB ddbeffect_CSHARP ddbeffect_VB Encrypt_csharp Encrypt_VB FileMem_CSHARP Description 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 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 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 reading 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 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 multiple page images. See ASP Multiple Pages for more information. Sample for comparing an image that had the brightness and contrast changed with the original/unmodified image in C#. See Contrast for more information. Sample for comparing an image that had the brightness 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 for more information. Sample for demonstrating a simple conversion in Visual Basic. See Conversion for more information. Sample for showing how to get the DDB display effect from an image in C#. See DDB Effect for more information. Sample for showing how to get the DDB display effect from an image in Visual Basic. See DDB Effect for more information. Sample demonstrating how to use the Snowbound.Net library in C# to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to use the Snowbound .NET library in Visual Basic to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to read an image file into 43 Chapter 2 - Quick Start Sample ImageProcessing_CSHARP ImageProcessing_VB memcopy_csharp Memcopy_VB mergeimage_CSHARP page_csharp Page_VB panning_csharp panning_VB Print_CSHARP Print_VB Scan_CSHARP Scan_VB SimpleMultiPages_CSHARP SimpleMultiPages_VB textsearch_CSHARP textsearch_VB 44 Description memory and use the Snowbound .NET library in C# to decompress the image from memory. See FileMem for more information. Sample showing how to apply the image processing operator in C#. See Image Processing for more information. Sample showing how to apply the image processing operator in Visual Basic. See Image Processing for more information. Sample demonstrating how to use the Snowbound .NET library in C# for saving and reading the image from memory. See Memory Copy for more information. Sample demonstrating how to use the Snowbound .NET 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 Merge Image for more information. Sample for displaying any page and using anti-aliasing if desired in C#. See Page for more information. Sample for displaying any page and using anti-aliasing if desired in Visual Basic. See Page for more information. Sample demonstrating panning in C#. See Panning for more information. Sample demonstrating panning in Visual Basic. See Panning for more information. Sample demonstrating printing and previewing in C# using the Snowbound product. See Print for more information. Sample demonstrating printing and previewing in Visual Basic using the Snowbound product. See Print for more information. Sample demonstrating how to use the Snowbound .NET library in C# for scanning functions. See Scan for more information. Sample demonstrating how to use the Snowbound .NET library in Visual Basic for scanning functions. See Scan for more information. Sample demonstrating how to split multiple pages in C#. See Split to Multiple Pages for more information. Sample demonstrating how to split multiple pages in Visual Basic. See Split to Multiple Pages for more information. Sample showing how to search text in the image in C#. See Text Search for more information. Sample showing how to search text in the image in Visual Basic. See Text Search for more information. Chapter 2 - Quick Start Sample TIFFTag_CSHARP TIFFTag_VB Description Sample demonstrating how to use the Snowbound .NET library in C# for reading .tif tags. See Tiff Tag for more information. Sample demonstrating how to use the Snowbound .NET 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 memory. 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. RasterMaster .NET 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. 45 Chapter 2 - Quick Start All negative values are errors. See Appendix H, Snowbound Error Codes for a list of error codes for a list of error codes and error descriptions. System Overview RasterMaster .NET includes the technical specifications described below. Determining System Requirements System requirements to run RasterMaster .NET include: Supported Operating Systems - Any .NET Environment including the following: l Microsoft Windows Vista l Microsoft Windows XP l Microsoft Windows XP/64* l Microsoft Windows Server 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 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 46 Chapter 2 - Quick Start Framework 4.0, then you must either: 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 http://support.snowbound.com. Once you have the .NET 4.0 compatible RasterMaster 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 The amount of memory required to display a document may be significantly larger than the size of the document that is stored on disk. Just like a road map, the document is folded up and compressed when it is stored. In order to see the document, it must be unfolded (decompressed) and spread out so you can see the whole map. The map takes up much more room when open for viewing. The same is true of online documents. When a document is open, a black and white letter size page at 300 dpi takes roughly 1MB of memory to display and a color page takes 25MB. 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 resolution, 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. 47 Chapter 2 - Quick Start 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) 48 24-bit per pixel, 8.5" x 11" image, at 300 dpi (2550 2550 * 3300 * (24 / 8) = 25245000 bytes pixels by 3300 pixels) (25 megabytes) 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 multipage images in the RasterMaster .NET. Multi-page Images All Snowbound libraries decompress a single page at a time. This section describes the multipage formats and how to decompress, determine page count, and save multi-page images. Supported Multi-page Formats RasterMaster .NET currently supports the following multi-page formats: l TIFF l DCX l MO:DCA/IOCA l PDF l PCL l MS Word - Reading l MS Excel - Reading l PowerPoint - Reading l RTF - Reading Decompressing a Multi-page Image Each page must be decompressed then saved separately. In other words, a decompress then save must be performed for each page. Determining Multi-page Page Count You can keep decompressing pages until a PAGE NOT FOUND or -11 error is returned from the decompress function or method, or you can query the number of pages with the CIMGLOW_ get_pages function. See CIMGLOW_get_pages() for more information. Saving Multi-page File Formats When saving to a multi-page file format, keep in mind that all RasterMaster products append or add new pages to an image file if the file already exists. If you do not want to keep saving to the same file, you must save each page to a unique file name. 49 Chapter 3 - Saving and Reading Multi-page Images Multi-page Format Functions Table 3.1: Supported Multi-page Functions Properties CIMGLOW_get_pages() CIMG_decompress_bitmap_page() Description Detects the number of pages in a file. See CIMGLOW_get_pages() for more information. Reads pages. Specify the specific page to import. See CIMG_decompress_ bitmap_page() for more information about this function. Saves multi-page images. For an existing file, new pages are appended. For new files, new pages with the specified name are created as necessary. CIMG_save_bitmap() Note: Use a unique filename when saving to multi-page formats; otherwise, images are automatically appended to any file with the same name. See CIMG_save_bitmap() for more informa-tion on these functions. 50 Chapter 4 - Printing Images Chapter 4 - Printing Images This chapter describes how to print images using the RasterMaster .NET. Printing Overview All Snowbound products for Windows print to any device with a valid Windows printer driver installed. If a color or gray scale image is printed to a 1-bit or bi-level printer such as an HP-LASERJET type printer, the image is dithered or reduced to 1-bit per pixel automatically. The capabilities of the printer are detected by the Snowbound libraries to determine if the image must be dithered. The technique employed is Stucky error diffusion. This technique simulates grayscale by the placement of dots. The higher the resolution of the printer, the better the effect. Note: For color or grayscale images, the CIMG_print_bitmap_fast() command is the quickest. Printing Functions There are two printing functions available. Normal Printing Normally, to print an image, use the function below. CIMG_print_bitmap(Graphics *g, int x, int y, int width, int height) See CIMG_print_bitmap() for more information on normal printing. Fast Printing To print an image using fast printing, use the function below. CIMG_print_bitmap_fast(Graphics *g, int x, int y, int width, int height) Fast printing is used with Postscript printers. It does a nice job of scaling and dithering images. The whole image in its original size is sent to the printer with no preprocessing. A lot of processing is done within the library when doing normal printing. See CIMG_print_bitmap_fast() for more information on fast printing. Note: This may not work with all printers. 51 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, Snowbound 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 x y width height Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image Returns Returns the status of the print bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_print_bitmap_fast() This function is a special image print routine. This function is different from CIMG_print_bitmap() because it sends the current Windows DIB specified by the image object directly to the printer. The printer is required to do the scaling and color reduction if necessary. Postscript printers will be much faster. 52 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, Snowbound Error Codes for more information. Syntax int SNBDAPI CIMG_print_bitmap_fast(Graphics *g, int x, int y, int width, int height); Remark Table 4.2: CIMG_print_bitmap_fast Function Variables Variable Description g x y width height Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image Returns Returns the status of the print bitmap fast operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Printing Large Documents Printing large documents, such as documents approaching or exceeding 100 pages, or documents set to a resolution of 300 DPI or above, requires additional memory resources. These additional resource requirements can affect the performance of both servers and clients. Servers Depending on the current Java Virtual Machine memory configuration for the Imaging server, the need for additional resources may cause an out of memory error. Increasing the Java Virtual Machine maximum heap size to the Imaging server during start up can help avoid memory errors. Specify the minimum and maximum heap size by passing the parameter -Xms and -Xmx to the Imaging server during start up, where the amount of memory is in megabytes or gigabytes you want to allocate to the Imaging server. 53 Chapter 4 - Printing Images Clients Each of the different browsers handles the increased resource demands uniquely. In some cases, when printing documents that require additional resources, the document may print with blank pages, fail to respond, or require the browser or computer to be restarted. Solution A workaround for this problem may be to download the document locally and then print it. If the document does not have any annotations or the document is to be printed without annotations, the original document can be downloaded and printed. However, if a document is to be printed with annotations, a TIFF version of the document can be downloaded and printed. 54 Chapter 5 - Aspect Ratio Correction Function Chapter 5 - Aspect Ratio Correction Function This chapter describes the function used for aspect ratio correction within the RasterMaster .NET. 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. 55 Chapter 6 - Display Quality Chapter 6 - Display Quality This chapter describes how to achieve the best display quality for an image using RasterMaster .NET. Achieving the Best Display Quality Achieving the best display quality of any image depends on the type of image being viewed. 24-Bit Images Displayed on a 256 Color Adapter To achieve the best display quality for 24-bit images displayed on a 256 color adapter, the default behavior is to convert the image at display time to 256 colors using a simple bayer matrix dither. You can change this to a better quality diffusion dithering by using the following call: CIMGLOW_set_dithermode(); This will, however, take a little longer to display the image. Use 256 for the number of colors to optimize to. This call permanently changes the image to an 8-bit image so you need only call the function once. The image contains an optimized palette; allowing one quality image to be displayed at a time. See CIMGLOW_set_dithermode() and CIMG_remove_red_eye() for more information on displaying 24-bit images. Bi-Level and 1-Bit Per Pixel Images To achieve the best display quality for bi-level or 1-bit per pixel images, set the CIMGLOW_set_ alias() function to: l 2 for scale to gray l 1 for preserve black Large images at 200 DPI or larger must be scaled to fit on a standard resolution monitor. The default scaling skips pixels so small lines or details may be ignored. Aliasing When the aliasing function is turned on, the scaling algorithm looks at neighboring pixels to preserve details that might normally be lost. Scale to Gray The scale to gray function converts the neighboring pixels to a 8-bit gray scale value. Best results are obtained on text type documents. Preserve Black The preserve black function creates a 1-bit pixel based on neighboring pixels. This has been 56 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. 57 Chapter 7 - Image Compression Chapter 7 - Image Compression This chapter describes how to select the best compression for an image using RasterMaster .NET. Preferred Formats Most of the compression algorithms only compress a specific type of image data. Compression techniques for 24-bit color images usually do not work well on 1-bit or bi-level images. Similarly, compression for 1-bit images do not compress well for 24-bit color images. 24-Bit Color Images For 24-bit color images, use the JPEG format in RasterMaster .NET for the best conversion results. 8-Bit Gray Scale Images For 8-bit gray scale images, use the JPEG format in RasterMaster .NET for the best conversion results. 1-bit Bi-Level Images For 1-bit bi-level images, use the TIFF G4 in RasterMaster .NET for the best conversion results. The JBIG format works about twenty percent better than the TIFF G4 format, but it can be much slower. 58 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 RasterMaster .NET supports over 100 file formats. Many formats such as TIFF are very broad in the internal support of compression and bit depths. Not all formats can support all bit depths. All RasterMaster products import and convert file formats to Snowbound’s internal formats at decompress time. The format is a simple uncompressed DIB format stored in memory. This format is decompressed or imported and can be saved out to any supported format. See Appendix B, Supported File Formats for a complete list of supported file formats. In general, RasterMaster .NET handles details like file format, bit-depth, bit ordering, and compression formats automatically. You will need only a few RasterMaster .NET calls to handle a wide variety of input and output file types. Automatically Detecting File Formats In most cases, you do not need to know the file format you wish to convert since RasterMaster .NET products automatically detect the file format regardless of the file extension. File extensions are not mandatory. RasterMaster .NET supports automatic promotion of images to destination files. For example, JPEG images can only be written out at 8 and 24-bits per pixel. In order to save a 1-bit TIFF image as JPEG, the developer must promote the TIFF to 8 or 24-bits per pixel. In our other libraries, this is accomplished by calling one of the promote functions. In RasterMaster .NET, however, the library automatically determines the bits per pixel for the destination format and promotes accordingly. The data type CIMG_IMAGE_TYPE in .NET library includes all current image types defined in the library. When we use .NET library, instead of giving the format number such as 59, use CIMG_ IMAGE_TYPE.pdf. For example: status = simage.CIMGLOW_set_auto_detect((int)CIMG_IMAGE_ TYPE.ascii); You can read in almost any type of image or document using the CIMGLOW_set_document_ input(int, int, int) method. RasterMaster .NET examines the content of the document and not the file type extension to determine the file type If a file does not have a file extension or has the wrong file name extension, RasterMaster .NET will still identify the format correctly. 59 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 documents take longer to process and take up more space in memory and when stored. You can adjust the quality using one of the CIMGLOW_set_document_input(int, int, int) methods. Input Document Quality: Color/bit-depth/Pixel Depth RasterMaster .NET will automatically read in black and white, grayscale, and color documents at the appropriate bit-depth (1, 8 and 24 respectively). The bit-depths RasterMaster .NET uses automatically vary by input format. For more information on file formats, please see Appendix B, Supported File Format. You can tell RasterMaster .NET to read in color documents as black and white to increase performance. You do this by calling CIMGLOW_set_document_input(int, int, int) with a bitdepth of 1. You can tell RasterMaster .NET to read in black and white documents as color. However, that is not recommended because it will hurt performance for no gain in quality. Making Sure Input is Compatible with Output Most of the time, the input that you read in will convert successfully to the output format you select in either CIMG_save_bitmap() or CIMG_save_document(). Getting a Pixel_Depth_Unsupported Error A Pixel_Depth_Unsupported error indicates that the bit-depths do not match. You can look at the file formats you are using in Appendix B, Supported File Format to compare the bitdepths supported by your input and output file formats. The goal is to find a bit-depth that the file formats have in common. If you do not know the file format of the input file, you can use the CIMGLOW_get_filetype() to determine it. You can find the bit depth/bits per pixel of your image by calling CIMG_bitmap_ info() and looking at the value in biBitCount, In some cases, you will find you do not have enough bits-per-pixel to go to the desired output format. For example, if you are going from a black and white or grayscale to a color document that is color promotion because the bit-depth is going from low to high. Please see Chapter 30, Color Promotion Functions for information on RasterMaster .NET functions that you can use to get to the bits per pixel depth you need. If you have too many bits per pixel for the desired output format, then you are going from color or grayscale towards black and white. Going from a higher bits per pixel to a lower one is color reduction. Please see the Chapter 31, Color Reduction Functions for information on RasterMaster .NET functions that you can use to adjust your image to a lower pixel depth. Adjusting Low Output Quality The output quality is affected by several factors described in the sections below: 60 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 document using CIMGLOW_set_document_input(int, int, int). If your output is coming out grainy, then check to see if your input is grainy too. If the input document looks good, then increase the input DPI using CIMGLOW_set_ document_input(int, int, int). If the input is grainy, then you may need to do some image enhancement techniques. Contact Snowbound Support at http://support.snowbound.com for help. Color Reduction - Going from a Color Document to Black and White or Grayscale RasterMaster .NET will automatically handle color promotion and reduction. However there is no excellent one-size-fits-all method for either of these. You can adjust the quality by using different color promotion or color reduction methods to fine tune your results. Please see the Chapter 30, Color Promotion Functions and Chapter 31, Color Reduction Functions chapters for more information. Lossy Compression If your output format is using a lossy compression, you may lose details. You may want to try a different lossless output format. Error During Conversion In some rare cases, there may be an error during conversion. The text for any of the error codes described in the table below can be obtained by calling ToErrorMessage(). Please provide the input file and a sample of the bad output to Snowbound Support at http://support.snowbound.com . Conversion Takes Too Long or Output Is Too Large If you have selected high quality output by selecting a high resolution (DPI) or a high bit-depth (color), there will be a lot more data than for a lower quality image. The data takes longer to process and takes more space. Please see Determining Memory Requirements for information on determining your memory requirements. If you reduce the DPI or the bits per pixel in your input. using CIMGLOW_set_document_input(int, int, int) and/or in the output using color reduction, you should see better performance and smaller files. 61 Chapter 9 - Class Snow.Snowbnd Methods Chapter 9 - Class Snow.Snowbnd Methods This chapter describes the available methods for the Snow.Snowbnd class. Snowbnd() This is an alternate constructor that creates a new Snowbnd object by copying the contents of an existing Snowbnd object. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Alpha l Animate l Annaction l Annotation l ASP Conversion l ASP Image View l ASP Memory Copy l ASP Multiple Pages l Batch_XPS_Convert l Contrast l Conversion l Convert_Doc l DDB Effect l DocClean l Encryption l FileMem 62 Chapter 9 - Class Snow.Snowbnd Methods l Image Processing l Memory Copy l Merge Image l Page l Panning l Print l Scan l Split to Multiple Pages l Text Search l Thumbnail l Tiff Tag l Web Image Viewer Component l WPFAnnotation_CSHARP l WPFConversion_CSHARP l WPFScanning_CSHARP l VectorConvertMem_CSHARP l XPSMem_CSHARP Syntax Snowbnd(void); Snowbnd(int, int, int) This is an image constructor for the Snowbnd object. This allows the creation of a blank image with allocated memory. Syntax Snowbnd(int width, int height, int bitsperpixel); 63 Chapter 9 - Class Snow.Snowbnd Methods Remark Table 9.1: Snowbnd(int width, int height, int bitsperpixel) Method Variables Variable Description width height bitsperpixel Width of blank bitmap to create. Height of bitmap to create. Pixel depth of bitmap to create. Can be set to 1, 8, or 24. 64 Chapter 10 - SDK Class Specific Methods Chapter 10 - SDK Class Specific Methods This chapter describes the SDK class specific functions for RasterMaster .NET. The chapter contains the following topics: isValidImage() This function checks to see if the image is decompressed into the object. It checks that the image data for the object is present or valid. Syntax virtual bool isValidImage(void); clearImage() This function takes what is in the object, removes image data, and resets the class. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Animate l DDB Effect l Encryption l FileMem l Image Processing l Memory Copy l Text Search l Tiff Tag Syntax virtual int clearImage(void); 65 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, Snowbound Error Codes for a list of error codes. 66 Chapter 11 - SnowPanel Class Specific Methods Chapter 11 - SnowPanel Class Specific Methods This chapter describes the SnowPanel class specific methods. Properties This section lists the properties used in the SnowPanel class specific methods: Table 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 an ASPECT_ZOOM. Sets the double buffer display on or off Type DoubleBuffered CustomPaint() This function is the main paint method for the Snowbound image to the screen. This function is only used for the SnowPanel class. The user can override CustomPaint to provide his own CustomPaint method. Syntax public virtual void CustomPaint(Graphics *g); Remark Table 11.2: CustomPaint Variable Variable Description g Graphics object Returns Returns the status of the graphics object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 67 Chapter 11 - SnowPanel Class Specific Methods OnPaint() This function calls CustomPaint to draw the image using the CustomPaint method. How this method paints is based on the DoubleBuffer property. Syntax protected virtual void OnPaint(PaintEventArgs *e); Remark Table 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 Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. OnPaintBackground() This function repaints the background color and image of the SnowPanel class depending on if the background image is available. How this method paints is based on the DoubleBuffer property. Syntax protected virtual void OnPaintBackground(PaintEventArgs *pevent); Remark Table 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 Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. OnSizeChanged() This function is used when the SnowPanel class is resized to preserve the display. 68 Chapter 11 - SnowPanel Class Specific Methods 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 Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 69 Chapter 12 - Scanning Functions Chapter 12 - Scanning Functions This chapter describes the scanning functions and parameters. 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 Variable Description int bitspix double left double top double right double bottom int hres int vres Bits per pixel Window x start pos in inches Window y start pos in inches Window x size in inches Window y size in inches X resolution in pixels Y resolution in pixels CIMG_scan_acquire() This TWAIN scanning routine scans an image on the currently installed scanner or input device. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. 70 Chapter 12 - Scanning Functions Notes: CIMG_scan_open_source()must be called first. See CIMG_scan_open_source() for more information. The Snowbound control must be visible. Syntax int SNBDAPI CIMG_scan_acquire(Control *win_control, int iShowUI); Remark Table 12.2: CIMG_scan_acquire Function Variable Variable Description win_control Window form control object 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box iShowUI Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_acquire_feeder() This TWAIN scanning function allows scanning from a scanner with an automatic document feeder. Call this function in a loop until the NO_MORE_PAGES error is returned then close the scanner with the CIMG_scan_feeder_close() function. See CIMG_scan_feeder_close() for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Note: A negative value indicates (NO_MORE_PAGES) is returned when the feeder is empty. Syntax int SNBDAPI CIMG_scan_acquire_feeder(Control *win_control, int iShowUI); 71 Chapter 12 - Scanning Functions 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 1 = Display TWAIN dialog box iShowUI Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_acquire_feeder_fast() This function allows for new fast memory transfer scanning. A parameter can also be set to duplex scanning if your scanner supports it. Syntax int SNBDAPI CIMG_scan_acquire_feeder_fast(Control *win_control, int iShowUI, int iDuplex); Remark Table 12.4: CIMG_scan_acquire_feeder_fast Function Variables Variable Description win_control Window form control object 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box 1 = set duplex scanning mode iShowUI iDuplex Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_feeder_close() This TWAIN scanning function closes the scanner after calls to the CIMG_scan_acquire_ feeder() function. Use this function after receiving the NO_MORE_PAGES error message from the CIMG_scan_acquire_feeder() function. See CIMG_scan_acquire_feeder() for more information. 72 Chapter 12 - Scanning Functions You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_feeder_close(void); Returns Returns the status of the close. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_get_cap() This function returns the value of the current specified TWAIN capability. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_get_cap(Control *win_control, int cap); Remark Table 12.5: CIMG_scan_get_cap Function Variables Variable Description win_control cap Window form control object TWAIN scanner capability to retrieve Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_open_source() This TWAIN scanning function displays a dialog box which allows for setting available input devices. It then displays a dialog box for selecting the available input devices. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. 73 Chapter 12 - Scanning Functions 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, Snowbound Error Codes for a list of error codes. CIMG_scan_pages() This TWAIN scanning routine scans all pages from the currently selected scanner or input device and saves to the path/filename specified by the filename in the image format file type. For multi-page formats, all pages are stored in a single multi-page file. For single page formats, images are created with the following filenames: 00000000.img, 00000001.img, etc. for each page. For multi-page file types such as TIFF, DCX, or MO:DCA:OCA, you must specify a valid filename. For other file types, the filename can only contain a path. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Note: Normally the iShowUI will be turned off for multi-page scanning. Syntax int SNBDAPI CIMG_scan_pages(Control *win_control, String strFileName, int iFileType, int iShowUI); Remark Table 12.7: CIMG_scan_pages Function Variables Variable Description win_control strFileName Window form control object Output file name to create as a scanned image 74 Chapter 12 - Scanning Functions Variable iFileType iShowUI Description See Appendix B, Supported File Format for file type formats in which to save compressed images 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_pages_fast() This function allows for new fast memory transfer scanning. A parameter can also be set to allow duplex scanning if your scanner supports it. It scans all pages from the current installed scanner or input device and saves them to the specified path/filename. The file format is specified by the iFileType parameter. For multi-page formats, all pages are stored in a single multi-page file. For single page formats, images are created with the following filenames: 0000000.img, 00000001.img, etc. for each page. For multi-page file types such as TIFF, DCX, or MO:DCA:IOCA you must specify a valid filename and all pages will be stored in a single multi-page image. For other file types, the filename can only contain a path. Note: Normally the iShowUI will be turned off for multi-page scanning. Syntax int SNBDAPI CIMG_scan_pages_fast(Control *win_control, String strFileName, int iFileType, int iShowUI, int iDuplex); Remark Table 12.8: CIMG_scan_page_fast Function Variables Variable Description win_control strFileName iFileType Window form control object Output file name File type (from imglib.h) 0 = Do not display TWAIN dialog box 1 = Display TWAIN dialog box 1 = set duplex scanning mode iShowUI iDuplex 75 Chapter 12 - Scanning Functions Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_set_cap() This function sets the value of the specified TWAIN capability. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_set_cap(Control *win_control, int cap, int value); Remark Table 12.9: CIMG_scan_set_cap Function Variables Variable Description win_control cap value Window form control object Current TWAIN capability to set New setting for TWAIN capability Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_set_caps() This function allows the user to set the scanning parameters such as height, width, and bits per pixel for the current scanner. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_set_caps(CSCAN_CAPS *new_caps); Remark Table 12.10: CIMG_scan_set_caps Function Variable 76 Chapter 12 - Scanning Functions Variable Description new_caps Pointer to the CSCAN_CAPS structure Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_scan_setup() This function TWAIN scanning routine allows the caller to bring up the TWAIN driver’s user interface to set scanning parameters. After the parameters are set, they are saved. No scanning occurs unless one of the other scan acquiring functions are called. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Scan sample. Syntax int SNBDAPI CIMG_scan_setup(Control *win_control); Remark Table 12.11: CIMG_scan_setup Function Variable Variable Description win_control Window form control object Example 12.2 CIMGLOW_ooxml_license_enable string licensePath = ""; status = snowbnd.CIMGLOW_ooxml_license_enable(ref licensePath); Console.WriteLine(licensePath); Returns Returns the Window form control object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 77 Chapter 13 - Scrollbar Default Functions Chapter 13 - Scrollbar Default Functions This chapter describes the RasterMaster .NET scrollbar default functions. Properties Properties This section lists the properties used in the scrollbar default functions: Table 13.1: Scrollbar Default Function Properties Property Description Hsb Vsb Status StatusDetails Gets and sets the horizontal scrollbar Gets and sets the vertical scrollbar Gets the GENERAL_STATUS error codes Gets the detailed status error codes SnowbndCNet_HScrollBar() This function controls how an image is scrolled. Syntax virtual void SnowbndCNet_HScrollBar(Object *sender, ScrollEventArgs *se); Remark Table 13.2: SnowbndCNet _HScrollBar Variables Variable Description sender ScrollEventArgs Standard .NET object Standard .NET object Returns Returns the standard .NET object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. SnowbndCNet_VScrollBar() This function controls how an image is scrolled. 78 Chapter 13 - Scrollbar Default Functions Syntax virtual void SnowbndCNet_VScrollBar(Object *sender, ScrollEventArgs *se); Remark Table 13.3: SnowbndCNet _VScrollBar Variables Variable Description sender ScrollEventArgs Standard .NET object Standard .NET object Returns Returns the standard .NET object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 79 Chapter 14 - Image Decompression Functions Chapter 14 - Image Decompression Functions This chapter describes the RasterMaster .NET image decompression functions. CIMG_decompress_bitmap() This is the main function for loading a compressed or uncompressed image from disk. It converts the data to a Windows DIB format in memory. It supports unicode file name input. This function is used to read in any supported format including MO:DCA, AFP, PCL, PDF, RTF, or Word. See Appendix B, Supported File Format for a list of supported file formats.You do not need to know the format of the document before using the decompress bitmap function. Simply provide the document to this function and it will automatically detect the format and convert it to bitmap. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Alpha l Animate l Annaction l Annotation l ASP Conversion l ASP Image View l ASP Memory Copy l ASP Multiple Pages l Contrast l Conversion l Convert_Doc l DocClean 80 Chapter 14 - Image Decompression Functions l DDB Effect l Encryption l Image Processing l Memory Copy l Merge Image l Page l Panning l Print l Scan l Split to Multiple Pages l Text Search l Thumbnail l Tiff Tag l WPF Image l WPFAnnotation_CSHARP l WPFConversion_CSHARP l WPFScanning_CSHARP Syntax int SNBDAPI CIMG_decompress_bitmap(String *filename); Remark Table 14.1: : CIMG_decompress_bitmap Function Variable 81 Variable Description filename File or path/filename of the image to load Chapter 14 - Image Decompression Functions Returns Returns the status of the decompress bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_bitmap_display() This function is the same as CIMG_decompress_bitmap() except the image is displayed while being decompressed. The image is converted to a Windows DIB and stored in memory. The return value is an integer for referencing the image for most other functions such as display, print, rotate, and others. Note: This function is not recommended for 1-bit images. It decompresses and displays faster using the normal CIMG_decompress_bitmap() and CIMG_display_bitmap() functions. See CIMG_decompress_bitmap() and CIMG_display_bitmap() for more information. Syntax int SNBDAPI CIMG_decompress_bitmap_display(String *filename, Graphics* g, int xpos, int ypos, int width, int height, int aspect); Remark Table 14.2: CIMG_decompress_bitmap_display Function Variables Variable Description filename g xpos ypos width height File or path/filename of the image to load. Graphics object. Starting X coordinate for display of image. Starting Y coordinate for display of image. Width for display of image. Height for display of image. 0 for no correction, 1 if you want the library to correct for aspect ratio. The original image proportions will be retained. This may make the height or width smaller than expected but never larger. aspect Returns Returns the status of the decompress bitmap display operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 82 Chapter 14 - Image Decompression Functions CIMG_decompress_bitmap_fd() This function decompresses from a file handle returned from Windows OpenFile() or _ lopen(). The offset is usually set to 0, but may be any value for referencing images embedded within a larger file. Data is converted to a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_bitmap_fd(FileStream *filestream, int offset, int page); Remark Table 14.3: CIMG_decompress_bitmap_fd Function Variables Variable Description filestream offset Handle returned from a Windows OpenFile() call Offset into file for embedded images, usually 0 Page number starting at 0 for decompressing multi-page files such as TIFF, DCX, or MODCA:IOCA page Returns Returns the status of the decompress file handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_bitmap_FlexSnap() This function decompresses from Snowbound’s FlexSnap server. Syntax int SNBDAPI CIMG_decompress_bitmap_FlexSnap(String *strServer, String *strFileName, int page); Remark Table 14.4: CIMG_decompress_bitmap_FlexSnap Function Variables 83 Variable Description strServer strFileName page Server URL address The image file name to decompress The desired page number starting at zero Chapter 14 - Image Decompression Functions Returns Returns the status of the decompress bitmap FlexSnap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_bitmap_mem() This function decompresses from a memory pointer. Like all other decompress functions, the data is converted to a Windows DIB format in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l ASP Memory Copy l Memory Copy l FileMem Note: It is best to allocate an extra 30K of memory for the image buffer passed into the function. Syntax int SNBDAPI CIMG_decompress_bitmap_mem(Array *data, int page); Remark Table 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 image files page Returns Returns the status of the decompress bitmap memory operation. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes. 84 Chapter 14 - Image Decompression Functions CIMG_decompress_bitmap_page() The function loads a compressed or uncompressed specific page of image file from disk. It converts the data to a Windows DIB format in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l ASP Multiple Pages l Batch_XPS_Convert l DocClean l Page l Scan l Split to Multiple Pages l Text Search l Thumbnail l WPFAnnotation_CSHARP l WPFConversion_CSHARP l WPFScanning_CSHARP l XPSMem_CSHARP Syntax int SNBDAPI CIMG_decompress_bitmap_page(String *filename, int page); Remark Table 14.6: CIMG_decompress_bitmap_page Function Variables 85 Variable Description filename page File path and name of the image to load. Desired page number starting at zero. Chapter 14 - Image Decompression Functions Returns Returns the status of the decompress bitmap page operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_bitmap_url() The function decompresses an image from a Uniform Resource Locator (URL) address. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMG_decompress_bitmap_url(String *strURL, int page); Remark Table 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 multipage image files. page 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, Snowbound Error Codes for a list of error codes. CIMG_decompress_bitmap_xps() The function decompresses an XPS file. 86 Chapter 14 - Image Decompression Functions Note: This function is only available in the Visual Studio 2005 .NET library build with .NET Framework 3.0 support. Syntax int SNBDAPI CIMG_decompress_bitmap_xps(String *filename, int iPage); Remark Table 14.8: CIMG_decompress_bitmap_xps Function Variables Variable Description filename iPage Path/filename of the XPS file The page index of the XPS document to render Returns Returns the status of the decompress bitmap XPS operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_fax() This function decompresses fax or proprietary image formats which uses the CCITT G3 or G4 compression algorithms. The programmer opens the file with OpenFile() or _lopen() then reads any header information to get the height and width of the image (maybe fill order also). It then seeks the beginning of the compressed data. Call this function to decompress the data and convert it into a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_fax(FileStream *filestream, int xsize, int ysize, int type, int fill_order); Remark Table 14.9: CIMG_decompress_fax Function Variables 87 Variable Description filestream xsize ysize type fill_order Handle returned from a Windows OpenFile()call Horizontal width of the image after decompression Vertical height of the image after decompression 2 for Group 3 2d images, 3 for Group 3, 4 for Group 4 fax Bit order in each byte, may be 0 or 2 Chapter 14 - Image Decompression Functions Variable Description 0 = Normally for CALS 2 = Normally for G3 and G4 Returns Returns the status of the decompress fax operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_fax_mem() This function decompresses fax or proprietary image formats which use the CCITT G3 or G4 compression algorithms. Using a memory pointer to the beginning of the compressed data, this function decompresses the data and converts it into a Windows DIB in memory. Syntax int SNBDAPI CIMG_decompress_fax_mem(Array *data, int xsize, int ysize, int type, int fill_order); Remark Table 14.10: CIMG_decompress_fax_mem Function Variables Variable Description data xsize ysize Pointer to image data in memory Horizontal width of the image after decompression Vertical height of the image after decompression 2 = for group 3 2d images 3 = for group 3 and 4 for Group 4 images Bit order in each byte, may be 0 or 2, normally: 2 for G3 and G4 0 for CALS type fill_order Returns Returns the status of the decompress fax memory operation. Any value less than zero is a Snowbound error codeSee Appendix H, Snowbound Error Codes for a list of error codes. CIMG_decompress_tiled_bitmap() This function decompresses the tiled image/pathname specified by the filename. The tiled image is completely decompressed and all tiles are assembled into one image. The normal CIMG_decompress_bitmap() decompresses each tile as a multi-page, unassembled file of tile images. Each tile is decompressed into a separate file. 88 Chapter 14 - Image Decompression Functions To decompress a tiled image using CIMG_decompress_bitmap_fd(), treat each tile as if it were the next page of a multi-page image. See CIMG_decompress_bitmap() and CIMG_ decompress_bitmap_fd()for more information. Syntax int SNBDAPI CIMG_decompress_tiled_bitmap(String *filename, int page); Remark Table 14.11: CIMG_decompress_tiled_bitmap Function Variables Variable Description filename page Path/filename of tiled image to return information on Page number for multi-page files Returns Returns the status of the decompress tiled bitmap operation. Any value less than zero is a Snowbound error code.See Appendix H, Snowbound Error Codes for a list of error codes. 89 Chapter 15 - Image Decompression Option Functions Chapter 15 - Image Decompression Option Functions This chapter describes the RasterMaster .NET image decompression option functions. CIMGLOW_set_auto_detect() This global function turns the automatic file type detection on for verifying the desired format. The data type CIMG_IMAGE_TYPE in .NET library includes all current image types defined in library. When we use .NET library, instead of giving the format number such as 59, use CIMG_ IMAGE_TYPE.pdf. For example: status = simage.CIMGLOW_set_auto_detect((int)CIMG_IMAGE_ TYPE.ascii); Syntax int SNBDAPI CIMGLOW_set_auto_detect(int format); Remark Table 15.1: CIMGLOW_set_auto_detect Function Variable Variable Description format Image format type from the defined list in imglib.h Returns Returns the status of the set auto-detect operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_decomp_rect() This global function decompresses and holds in memory only the data contained in the specified cropping rectangle. Set this before any decompression calls are made. This stays in effect until it is reset to 0 for each parameter. 0 is the default. 90 Chapter 15 - Image Decompression Option Functions 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 y width height Start of x cropping rectangle Start of y cropping rectangle Width of cropping rectangle Height of cropping rectangle Returns Returns the status of the set decompressed rectangle operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_decomp_reduction() This global function forces color reduction at decompression. If this function is set to 8, for instance, all 24-bit images are reduced and stored in memory as 8-bit images. Syntax int SNBDAPI CIMGLOW_set_decomp_reduction(int bitsperpixel); Remark Table 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 success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 91 Chapter 15 - Image Decompression Option Functions CIMGLOW_set_decompsize() This global function forces all images to be scaled as they are decompressed. This is useful for creating icons. If the width and height are set to 100, the image in memory is scaled to 100 by 100 using much less memory. Syntax int SNBDAPI CIMGLOW_set_decompsize(int width, int height); Remark Table 15.4: CIMGLOW_set_decompsize Function Variables Variable Description width height Width to decompress image Height to decompress image Returns Returns the status of the set decompressed size operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_jpeg_decompression This global function gets the frequency components in JPEG images after the Huffman decompression. These values will also be de-quantized. They will replace the internal RGB data normally returned from decompressing a JPEG image. The components will be in the same order as the uncompressed image, except they will be 32bit integer values for each plane. Syntax int SNBDAPI CIMGLOW_set_jpeg_decompression(int mode); Remark Table 15.5: CIMGLOW_set_jpeg_decompression Function Variable Variable Description mode 0 = normal JPEG decompression 1 = returns the array of 8x8 blocks of frequency components 92 Chapter 15 - Image Decompression Option Functions Returns Returns the status of the JPEG decompression. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_overlay_path() This global function sets the path for overlay files for PT:OCA images. The library searches this path for overlay files required by PT:OCA images. If you pass in a NULL parameter, it toggles between the two ways in which the overlay file is decompressed. For example, this function is used when you have a check overlay image file (the file has a check image on a larger white background). If a null parameter is entered, toggling occurs, which lets you retrieve just the check image itself without the extraneous white space. This way, you just get the check image. Calling this method again retrieves the original image. Note: Only used with certain overlay files. Syntax int SNBDAPI CIMGLOW_set_overlay_path(String *path); Returns Returns the status of overlay path. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_pdf_input() This global function converts PDF files into a raster image when being decompressed into RasterMaster .NET. This function allows the type of bitmap created to be specified. Note: PDF reading is an optional module available in the PDF plugin for Windows DLL and ActiveX products. Syntax int SNBDAPI CIMGLOW_set_pdf_input(int dpi, int bitsperpixel); 93 Chapter 15 - Image Decompression Option Functions Remark Table 15.6: CIMGLOW_set_pdf_input Function Variables Variable dpi bitsperpixel Description Controls the width and height of the file. Set to 200 or 300 for black and white images. Set to 100 or 200 for color images. Allows importing color or black and white images. 1 = black and white documents 24 = color images Returns Returns the status of PDF input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_pdf_password() This function allows passing a password string to allow for decompressing PDF files that are password protected. Make this call before calling any of the RasterMaster decompress calls such as CIMG_decompress_bitmap(). Syntax int SNBDAPI CIMGLOW_set_pdf_password(String *filename); Remark Table 15.7: CIMGLOW_set_pdf_password Function Variables Variable Description filename String represented password to use to open a password protecting PDF file. Returns Returns the status of PDF password. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 94 Chapter 15 - Image Decompression Option Functions CIMGLOW_unset_auto_detect() This global function turns the automatic file type detection off for the desired format. This file type is then no longer decompressed by the library. Syntax int SNBDAPI CIMGLOW_unset_auto_detect(int format); Remark Table 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, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 95 Chapter 16 - Image Creation Functions Chapter 16 - Image Creation Functions This chapter describes the RasterMaster .NET image creation functions. CIMG_create_bitmap_class() This function creates a bitmap object from the Snowbound object. Syntax Bitmap* CIMG_bitmap_class(int width, int height); Remark Table 16.1: CIMG_create_bitmap_class Function Variable Variable Description width height Width of the bitmap object Height of the bitmap object Returns Returns the status of the create bitmap object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_create_handle() This function imports a Windows DIB created externally from the library. This function makes a copy of the image DIB and does not alter or delete the lpbih or the DIB data passed in. Syntax int SNBDAPI CIMG_create_handle(int width, int height, int bitsperpixel); Remark Table 16.2: CIMG_create_handle Function Variable Variable Description width height bitsperpixel Width of the handle Height of the handle Pixel depth of bitmap to create 96 Chapter 16 - Image Creation Functions Returns Returns the status of the create handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_create_handle_ddb() This function allows importing of an old-style Windows HBITMAP or Device Dependent Bitmap (DDB). This does not alter the original bitmap, but simply copies and converts the data to the library’s internal DIB format. Syntax int SNBDAPI CIMG_create_handle_ddb(Graphics *g, Bitmap* pBitmap, IntPtr hpal); Remark Table 16.3: CIMG_create_handle_ddb Function Variables Variable Description g Bitmap hpal Graphics object GDI + Bitmap object Windows palette for the bitmap image Returns Returns the graphics object. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_create_handle_keep() This function imports a Windows DIB created externally from the library. It returns a standard image handle for displaying, saving, or printing. Note: This function does not make a copy of the image DIB; it uses the pointer and data directly. After a call to this function, do not delete the lpbih pointer or alter it in any way. Syntax int SNBDAPI CIMG_create_handle_keep(CDIB_HEADER *dib_header); 97 Chapter 16 - Image Creation Functions Remark Table 16.4: CIMG_create_handle_keep Function Variable Variable Description dib_header Pointer to a CDIB_HEADER structure that contains the image header. For more information, see public class CDIB_HEADER. Returns Returns the status of the keep image handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 98 Chapter 17 - HTML Functions Chapter 17 - HTML Functions This chapter describes the HTML functions available in the current version of RasterMaster .NET. Note: The HTML plugin option requires .NET 4.0 CIMGLOW_set_html_input() This function sets parameters for HTML rendering. Syntax int SNBDAPI CIMGLOW_set_html_input(int print_dpi, int bits_pix); Remarks Table 17.1: CIMGLOW_set_html_input function variable descriptions. Variable print_dpi bits_pix Description Used for rendering purposes. The default value is 200.0. Sets the bits per pixel. Only 1, 24, and 32 are supported. The default value is 24. Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_page_size() This function sets the page size in pixels for screen size purposes. These values are just a suggestion and will probably be over-written to more appropriate values during program execution. The measurement units are in inches. Syntax int SNBDAPI CIMGLOW_set_html_page_size(float w, float h); Remarks Table 17.2: CIMGLOW_set_html_page_size function variable descriptions . 99 Chapter 17 - HTML Functions Variable w h Description Sets the width. The default value is 8.5. Sets the height. The default vaule is 11.0. Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H,Snowbound Error Codes for a list of error codes. Functions Available in RasterMaster .NET V18.1 and Earlier The functions in this section are available in RasterMaster .NET V18.1 and any releases previous to V18.1. CIMGLOW_set_html_capabilities() This function sets various parameters for the HTML renderer: Enables or disables image capabilities for the HTML renderer. Enables or disables JavaScript capabilities for the HTML renderer. Enables or disables the use of the page size ratio capability of the HTML document. Enables or disables the exclusive use of print page breaks to signal page boundaries. Sets the ratio of the width to the height of the pages extracted from the HTML document. Note: The new version of our HTML renderer engine has JavaScript and image downloading enabled by default. Malicious JavaScript code and maliciously constructed embedded images may compromise the security of the host computer. Please use these features with caution. Syntax int SNBDAPI CIMGLOW_set_html_capabilities(int isImageEnabled, int isJavascriptEnabled, int isRatioEnabled, int isPageBreaksExclusive, Double dRatio); Remarks Table 17.3: CIMGLOW_set_html_capabilities Function Variables 100 Chapter 17 - HTML Functions Variable isImageEnabled isJavascriptEnabled isRatioEnabled isPageBreaksExclusive dRatio Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Sets the width/height ratio. The default value is 8.5/11.0. (i.e. US LETTER portrait-mode). Note: The ratio value is not set if the isRatioEnabled value is disabled. Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_home_dir() This function sets the home directory for the HTML renderer. Syntax int SNBDAPI CIMGLOW_set_html_home_dir(String dir); Remarks Table 17.4: CIMGLOW_set_html_home_dir function variable descriptions. Variable dir Description This value does not support double-byte characters (i.e. ASCII only). Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 101 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.5: CIMGLOW_set_html_image_capability function variable descriptions. Variable isEnabled Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_javascript_capability() This function enables or disables JavaScript capabilities for the HTML renderer. Notes: The new version of our HTML renderer engine has JavaScript and image downloading enabled by default. Malicious JavaScript code and maliciously constructed embedded images may compromise the security of the host computer. Please use these features with caution. JavaScript is interpreted differently with each web browser. In particular, our new renderer engine does not support all Microsoft Internet Explorer-only functions. Syntax int SNBDAPI CIMGLOW_set_html_javascript_capability(int isEnabled); 102 Chapter 17 - HTML Functions Remarks Table 17.6: CIMGLOW_set_html_javascript_capability function variable descriptions. Variable isEnabled Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_page_size_ratio() This function sets the ratio of the width to the height of the pages extracted from the HTML document. Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio(int ratio); Remarks Table 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 capability is disabled. Returns Returns the status of the Snowbound error code. A value of 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_page_size_ratio_capability() This function enables or disables the use of the page size ratio capability of the HTML document by forcing a page size ratio capability in the HTMLdocument. Syntax int SNBDAPI CIMGLOW_set_html_page_size_ratio_capability(int isEnabled); 103 Chapter 17 - HTML Functions Remarks Table 17.8: CIMGLOW_set_html_page_size_ratio_capability function variable descriptions . Variable isEnabled Description Set the value to 0 to disable. Set the value to 1 to enable. The default value is 1. Returns Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_screen_dpi() This function sets the screen DPI used for layout purposes. Syntax int SNBDAPI CIMGLOW_set_html_screen_dpi(Double screen_dpi); Remarks Table 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 anything but zero (0). Returns Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_use_page_breaks_exclusively() CIMGLOW_set_html_use_page_breaks_exclusively() This function enables or disables the ability to force the exclusive use of print page breaks to signal page boundaries. Syntax int SNBDAPI CIMGLOW_set_html_use_page_breaks_exclusively(int isEnabled); 104 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_html_utf_bom() This function forces this Unicode Byte-Order-Mark (BOM) to all HTML data read by RasterMaster .NET. The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. Its code point is U+FEFF. BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in. Since Unicode can be encoded as 16-bit or 32-bit integers, a computer receiving Unicode text from arbitrary sources needs to know which byte order the integers are encoded in. The BOM gives the producer of the text a way to describe the text stream's endianness to the consumer of the text without requiring some contract or metadata outside of the text stream itself. Once the receiving computer has consumed the text stream, it presumably processes the characters in its own native byte order and no longer needs the BOM. Hence the need for a BOM arises in the context of text interchange, rather than in normal text processing within a closed environment. Syntax int SNBDAPI CIMGLOW_set_html_utf_bom(int utf_bom); Remarks Table 17.11: CIMGLOW_set_html_utf_bom Function Variables Variable Description utf_bom May be set to one of the following values as defined in imglib.h: Please see Table 17-12 for byte order marks by encoding. 105 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 (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 FF FE 00 00 255 254 0 0 2B 2F 76, and one of 43 47 117, and one of the the following: following: [ 38 | 39 | 2B | 2F ] [56 | 57 | 43 | 47 ] F7 64 4C 247 100 76 ÷dL 221 115 102 115 Ýsfs 14 254 255 ?þÿ (? is the ascii "shift out" Encoding UTF_32LE UTF_72 UTF_1 UTF_EBCDIC DD 73 66 73 SCSU 106 0E FE FF3 ??þÿ (? is the ascii null character) ÿþ?? (? is the ascii null character) +/v, and one of the following: 89+/ Chapter 17 - HTML Functions Encoding Representation Representation Representation (hexadecimal) (decimal) (ISO-8859-1) character) FB EE 28 optionally 251 238 40 optionally followed by FF4 followed by 255 84 31 95 33 132 49 149 51 BOCU_1 GB_17030 ûî( optionally followed by ÿ â–¡1â– 3 (â–¡ and â– are unmapped 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 (nonBOM) character. For xx=00, 01, 10, 11, this byte is, respectively, 38, 39, 2B, or 2F when encoded as base64. If no following character is encoded, 38 is used for the fourth byte and the following byte is 2D. 3SCSU allows other encodings of U+FEFF, the shown form is the signature recommended in UTR #6. 4 For BOCU-1 a signature changes the state of the decoder. Octet 0xFF resets the decoder to the initial state. Returns Returns the status of the Snowbound error code or the current BOM the system will use. See Appendix H, Snowbound Error Codes for a list of error codes. 107 Chapter 18 - Open Office 2007 XML (OOXML) Functions Chapter 18 - Open Office 2007 XML (OOXML) Functions This chapter describes the RasterMaster .NET Office Open XML (OOXML) format functions. RasterMaster .NET Microsoft Office plugin supports the seamless conversion of Word 2007 and Excel 2007 documents which use the OOXML format. These documents are frequently stored with the file extension .docx/.xlsx. The CIMG_decompress_bitmap() function will automatically detect OOXML format documents and process them when the Aspose.Words library has been installed and registered with RasterMaster .NET. If the Aspose library is not found by RasterMaster .NET, the system will return the error code DLL_NOT_LOADED (-24). CIMGLOW_set_ooxml_license() This function loads the OOXML license file. Note: Please use CIMGLOW_ooxml_license_enable() to enable the license file. CIMGLOW_ license_enable() only needs to be called once to cover all of the Office types: Word, Excel, and PPT. Syntax int CIMGLOW_set_ooxml_license(String licenseFile); Remark Table 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, Snowbound Error Codes for a list of error codes. CIMGLOW_ooxml_license_enable() This function simplifies Aspose licensing by setting the license path. 108 Chapter 18 - Open Office 2007 XML (OOXML) Functions Syntax int CIMGLOW_ooxml_license_enable(char* licensePath, int nPathLength); Remark Table 18.2: CIMGLOW_ooxml_license_enable Function Variable Variable licensePath Description Buffer to receive path name of folder containing Aspose License file or NULL if no licenses found. This buffer must be allocated by calling application. Returns Returns the status of the Snowbound error code. If no license file is found, returns -52, OOXML_LICENSE_NOT_FOUND. If a license is found but is invalid, returns -53, OOXML_ LICENSE_EXPIRED. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 109 Chapter 19 - Image Saving Functions Chapter 19 - Image Saving Functions This chapter describes RasterMaster .NET image saving functions. CIMG_save_bitmap() This function saves an image to disk in any format desired. It supports unicode file name input. You can save images as black and white, grayscale or color by specifying the appropriate bit depth and choosing an output format that supports that bit depth. See Chapter 30, Color Promotion Functions and Chapter 31, Color Reduction Functions for more information on changing the color and bit-depth of an image. See the Supported Bit Depths for Image Formats in Appendix B, Supported File Formatfor details on what bit-depths are available for each format. One way to decrease the output file size is to use CIMGLOW_set_document_input to specify a lower DPI before opening the input file with CIMG_decompress_bitmap. When saving to a JPEG file format, you can decrease the file size by decreasing the quality level of the compression using the CIMGLOW_set_comp_quality method. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l ASP Conversion l ASP Memory Copy l Batch_XPS_Convert l Conversion l Convert_Doc l Encryption l Merge Image l Scan l Split to Multiple Pages l WPFAnnotation_CSHARP l WPFConversion_CSHARP 110 Chapter 19 - Image Saving Functions l WPFScanning_CSHARP l XPSMem_CSHARP Note: If the type is -1, the library looks at the file extension for determining the output file type. Syntax int SNBDAPI CIMG_save_bitmap(String *filename, int format); Remark Table 19.1: CIMG_save_bitmap Function Variables Variable Description filename File or path/filename for output image See Appendix B, Supported File Format for all image types allowed and all files shipped with the product format Returns Returns the status of the save bitmap operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_save_bitmap_fd() This function saves an image to disk in any desired format. This allows saving anywhere into an open file handle for embedded images. After calling OpenFile, the programmer may seek any position in the file. This save function begins writing compressed data in the format specified by type at this location. Note: If the type is -1, the library looks at the file extension for determining the output file type. Syntax int SNBDAPI CIMG_save_bitmap_fd(FileStream *filestream, int format); Remark Table 19.2: CIMG_save_bitmap_fd Function Variables 111 Chapter 19 - Image Saving Functions Variable Description filestream Windows file handle obtained from OpenFile or _lopen See Appendix B, Supported File Format for all image types allowed format Returns Returns the status of the save bitmap file handle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_save_bitmap_mem() This function saves an image to a memory pointer in the format specified by the file type. After calling GlobalAlloc() and GlobalLock(), the programmer sends the pointer to the saving function. This function operates on only one page at a time. For multi-page saving, please use CIMG_save_bitmap(). The total size of the compressed image is returned in bytes. If using the same pointer more than once, it is suggested that you clear the first 10 bytes to zero to avoid the library presuming the memory location already contains an image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l ASP Memory Copy l Memory Copy Syntax long SNBDAPI CIMG_save_bitmap_mem(Array *data, int format); Remark Table 19.3: CIMG_save_bitmap_mem Function Variables Variable Description data Windows memory pointer already allocated See Appendix B, Supported File Format for all image types allowed format Returns Returns the total size of the compressed image. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes. 112 Chapter 19 - Image Saving Functions CIMGLOW_write_tiff_stream() The function creates a TIFF file directly from raw or compressed data. This is best used when receiving raw data (no header information) directly from a scanner or other input device. Syntax int SNBDAPI CIMGLOW_write_tiff_stream(CDIB_HEADER *dib_header, Array *arrData, int data_size, int file_type, String *strFileName); Remark Table 19.4: CIMGLOW_write_tiff_stream Function Variables Variable dib_header arrData data_size file_type strFileName Description Pointer to a CDIB_HEADER structure contains the image header. For more information, see public class CDIB_ HEADER. Data to write out Size of data stream in bytes TIFF file type to write Output file name Returns Returns the status of the TIFF stream. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 113 Chapter 20 - Image Saving Option Functions Chapter 20 - Image Saving Option Functions This chapter describes the RasterMaster .NET image saving option functions. CIMG_set_encrypt() This global function allows encrypting images while saving. The key passed in by the function is the encryption key. The same key must be used before the image is read. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Encryption sample. Note: The key need only be set once for each instance of the program. Syntax int SNBDAPI CIMG_set_encrypt(int on_off, int key); Remark Table 20.1: CIMG_set_encrypt Function Variables Variable Description on_off key Turns encryption on or off for an image at save A long user defined key for encryption Returns Returns the set encryption. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_comp_quality() This function sets the compression ratio to quality factor to use when saving JPEG images. This is a global setting and affects all threads. The default value is 70. This is a write only setting. There is no get method. 114 Chapter 20 - Image Saving Option Functions Syntax int SNBDAPI CIMGLOW_set_comp_quality(int quality); Remark Table 20.2: CIMGLOW_set_comp_quality Function Variable Variable Description quality Integer between 1 - 100 1 = Smallest file size but least quality 100 = Best image quality and largest file size Returns Returns the set compression ratio. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_image_orientation() This global function sets the orientation for CALS or TIFF images. It orients the image in 45 degree increments. Syntax int SNBDAPI CIMGLOW_set_image_orientation(int orient); Remark Table 20.3: CIMGLOW_set_image_orientation Function Variable Variable Description orient Integer value between 0 and 8 Returns Returns the status of the image orientation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 115 Chapter 20 - Image Saving Option Functions CIMGLOW_set_jpeg2000_comp_ratio() This global function specifies the amount of compression when saving a JPEG2000 file. The value is the ratio of the output file size to the original uncompressed file size. Note: JPEG2000 is available as an optional add on to the Windows DLL and ActiveX product. Syntax int SNBDAPI CIMGLOW_set_jpeg2000_comp_ratio(int ratio); Remark Table 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 Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_jpg_interleave() This global function sets values for blue and red chroma decimation. This function should be used before saving images to JPEG format. A value of 2 for h and 2 for v will skip every other chroma pixel horizontally and vertically. This may give better compression results for saving images as JPEG. The default is 2:1, though the best quality will be at 1:1. Developers should experiment with a value, to determine which will give the best image compression while maintaining acceptable quality. Syntax int SNBDAPI CIMGLOW_set_jpg_interleave(int h_int, int v_int); Remark Table 20.5: CIMGLOW_set_jpg_interleave Function Variables 116 Chapter 20 - Image Saving Option Functions Variable Description h_int v_int Horizontal interleaving factor Vertical interleaving factor Returns Returns the status of the JPEG interleave factor. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_pdf_output() This global function sets the destination size for saving PDF files. The xsize and ysize are the output sizes in points. A point is 1/72 of an inch. Only PDF, PCL, and AFP file formats can be saved. The PCL and APF file formats are saved as bitmap. The PDF file format can be saved as bitmap or searchable text.. Syntax int SNBDAPI CIMGLOW_set_pdf_output(double width, double height); Remark Table 20.6: CIMGLOW_set_pdf_output Function Variables Variable Description double width double height Width of image in points Height of image in points Returns Returns the status of PDF output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_tiff_save_strips This global function saves data in strips, which is known as ‘stripped TIFFs’, when saving to TIFF file formats with the following compression types: 117 l Uncompressed l LZW l Packbits l Group 4 Chapter 20 - Image Saving Option Functions This breaks up the data into smaller segments instead of all lines of the image being saved in the same offset. Syntax int SNBDAPI CIMGLOW_set_tiff_save_strips(int on_off); Remark Table 20.7: CIMGLOW_set_tiff_save_strips Function Variable Variable Description on_off 0 = Off 1 = On Returns Returns the status of stripped TIFFs. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_tiff_tag() This global function writes new tags as well as all current tags. This function can be called multiple times for adding multiple tags. Note: If you read in a TIFF file, RasterMaster .NET does not save any of the tags. None of the tag data is saved except for the needed data such as bits per pix, height, and DPI. This is saved in the LPBITMAPINFOHEADER struct in RasterMaster .NET's internal format. Any other tags are not preserved. You could read in the tags and data you need from a source TIFF, then set new tags and data before saving. Setting the tag ID to -1 clears out all extra tags from being written to the file. It stores the previous values between calls. Then, set new tag values as shown in the following example: Simage.CIMGLOW_set_tiff_tag(-1,0,0,null); Syntax int SNBDAPI CIMGLOW_set_tiff_tag(CTIFF_TAG *tag); Remark Table 20.8: CIMGLOW_set_tiff_tag Function Variable 118 Chapter 20 - Image Saving Option Functions Variable Description tag ID of tag to write. For more information, see public clas CTIFF_TAG Returns Returns the status of TIFF tags. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 119 Chapter 21 - Image Display Functions Chapter 21 - Image Display Functions This chapter describes the RasterMaster .NET image display functions. bool repaintBackground() This function predetermines if the background needs to be repainted. Syntax bool repaintBackground(double zoom, int type); Remark Table 21.1: bool repaintBackground Variables Variable double zoom type Description Zoom factor: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag Returns Returns the status of the background. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_display_bitmap() This function is a standard image display routine. This function detects the video display adapter and may reduce the number of colors in the image when displaying, such as when displaying a 24-bit image on a 256 color display adapter. If display quality is poor, try some of the color reduction functions such as, CIMG_ mediancut_color()or CIMG_bayer_color(). See CIMG_mediancut_color() and CIMG_bayer_color() for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Animate 120 Chapter 21 - Image Display Functions l Contrast l Conversion l Convert_Doc l DDB Effect l FileMem l Image Processing l Memory Copy l Page l Panning l Print l Scan l Split to Multiple Pages l Text Search l Thumbnail l Tiff Tag Syntax int SNBDAPI CIMG_display_bitmap(Graphics *g, int x, int y, int width, int height); Remark Table 21.2: CIMG_display_bitmap Function Variables Variable Description g x y width height Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image 121 Chapter 21 - Image Display Functions Returns Returns the status of the display bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_display_bitmap_aspect() This function is an image display routine with corrected aspect ratio. After displaying the image, it turns scrollbars on or off for correct scrolling. A zoom factor of 100 displays the image with a one to one pixel ratio. A zoom of 0 fits the image horizontally or vertically into the window. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Alpha l ASP Image View l Web Image Viewer Component Syntax int SNBDAPI CIMG_display_bitmap_aspect(Control *panel, Graphics *g, CIMG_RECT *view, double zoom, int type); Remark Table 21.3: CIMG_display_bitmap_aspect Variables Variable Description panel g view Standard .NET control Graphics object Display area of interest Zoom factor: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag double zoom type Returns Returns the status of the display bitmap aspect operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 122 Chapter 21 - Image Display Functions CIMG_display_bitmap_transp() This function displays transparent GIF images. It only draws the foreground color when displaying, not the background color. This function compares each pixel to the background color passed in and does not draw foreground pixels that are identical. To get the background color from an image, use the CIMGLOW_get_transp_color()function. See CIMGLOW_get_transp_color() for more information. Syntax int SNBDAPI CIMG_display_bitmap_transp(Graphics *g, int xpos, int ypos, int width, int height, int tcolor); Remark Table 21.4: CIMG_display_bitmap_transp Function Variables Variable Description g xpos ypos width height tcolor Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Horizontal width to display image Vertical height to display image Background color of image to ignore Returns Returns the status of the display bitmap tranparent GIF operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_display_ddb() This function displays a DDB obtained from CIMG_dib_to_ddb() or any other DDB desired. This may display 4 and 8-bit images faster on some display adapters. See CIMG_dib_to_ddb() for more information. Syntax int SNBDAPI CIMG_display_ddb(bitmap* pBitmap, Graphics *g, int xpos, int ypos); Remark Table 21.5: CIMG_display_ddb Function Variables 123 Chapter 21 - Image Display Functions Variable Description Bitmap g xpos ypos GDI + Bitmap object Graphics object Starting X position to display image Starting Y position to display image Returns Returns the status of the device dependent bitmap (DDB) display operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 21.1 CIMG_display_ddb C#:Bitmap Bmp = simage.CIMG_create_bitmap_class (picDisplay.Width, picDisplay.Height); simage.CIMG_display_ddb(bmp,e.Graphics,0,0); CIMG_display_fit_to_height() This function displays the full height of the image vertically scaling it to fit. It crops the image horizontally for aspect ratio correction and enables the scroll bars. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Animate l Merge Image Syntax int SNBDAPI CIMG_display_fit_to_height(Graphics *g, Control *win_ control, int xs, int ys, int width, int height); Remark Table 21.6: CIMG_display_fit_to_height Function Variables Variable Description g win_control xs ys Graphics object Window form control object X starting position to display Y starting position to display 124 Chapter 21 - Image Display Functions Variable Description width height width to display height to display Returns Returns the status of the display fit to height operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_display_fit_to_width() This function displays the full width of the image horizontally scaling it to fit. It crops the image vertically for aspect ratio correction and enables the scroll bars. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Animate sample. Syntax int SNBDAPI CIMG_display_fit_to_width(Graphics *g, Control *win_ control, int xs, int ys, int width, int height); Remark Table 21.7: CIMG_display_fit_to_width Function Variables Variable Description g win_control xs ys width height Graphics object Window form control object X starting position to display Y starting position to display width to display height to display Returns Returns the status of the display fit to width operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_set_croprect() This function sets the current crop rectangle. After decompression the default cropping rectangle is the entire size of the image. 125 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 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 rect Rectangle to set new size to crop. For more information, see public class CIMG_RECT. Returns Returns the current crop rectangle for the image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_set_croprect_scroll() This function sets the cropping rectangle for the image. It also turns on or off the scrollbars to enable scrolling. If aspect is set to 1, the aspect ratio is corrected. This slightly changes the cropping rectangle in the X or Y direction. Syntax int SNBDAPI CIMG_set_croprect_scroll(Control *win_control, int xpos, int ypos, int scr_width, int scr_height, int aspect); Remark Table 21.9: CIMG_set_croprect_scroll Function Variables Variable Description win_control xpos ypos scr_width Window form control object Starting X coordinate for cropping rectangle Starting Y coordinate for cropping rectangle Width of cropping rectangle 126 Chapter 21 - Image Display Functions Variable Description scr_height Height of cropping rectangle 1 or True = aspect ratio on 0 = aspect ratio off aspect Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_zoom_bitmap() This function is the standard library zoom function. A zoom value of 100 tells the function to display the whole image at the coordinates in the CIMG_display_bitmap() call. Any value greater than 100 crops the image so it is not fully displayed in the current window. Syntax int SNBDAPI CIMG_zoom_bitmap(Control *win_ctrl, int zoom_factor); Remark Table 21.10: CIMG_zoom_bitmap Function Variables Variable Description win_ctrl zoom_factor Window form control object. Amount to zoom. Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_zoom_bitmap_1_to_1() This function is used to display images with a one-to-one pixel correspondence. A zoom value of 100 tells the function to display each pixel of the image for one pixel on the screen. int SNBDAPI CIMG_zoom_bitmap_1_to_1(Control *win_control, int zoom_ level, int center_flag); Remark Table 21.11: CIMG_zoom_bitmap_1_to_1 Function Variables Variable Description win_control Window form control object. 127 Chapter 21 - Image Display Functions Variable Description zoom_level center_flag Amount to zoom. Re-centers image if set to 1. Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_zoom_bitmap_rect() This function is most effective for resizing a window. Call after the zoom event has been processed when repainting the image with CIMG_display_bitmap(). The scaled image coordinates and size are returned for your use. A CIMG_RECT is the same as a Rect, except the elements of the structure are long, not short. Syntax int SNBDAPI CIMG_zoom_bitmap_rect(Control *win_control, CIMG_RECT *pRTZoom, CIMG_RECT *pRTClient, int mode); Remark Table 21.12: CIMG_zoom_bitmap_rect Function Variables Variable Description win_control pRTZoom Window form control object CIMG_RECT structure, rectangle in image to zoom Using image or screen coordinates 0 = Screen Coordinates 1 = Image Coordinates mode Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_map_image_to_wnd() This function translates the image coordinates passed in to reflect the window coordinates for the displayed image. It takes into account scaling and cropping of the image on screen. Syntax int SNBDAPI CIMGLOW_map_image_to_wnd(Control *win_control, Int *px, Int *py); 128 Chapter 21 - Image Display Functions Remark Table 21.13: CIMGLOW_map_image_to_wnd Function Variables Variable Description win_control px py Window form control object Pointer to an integer of an X coordinate to convert Pointer to an integer of a Y coordinate to convert Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_map_wnd_to_image() This function translates window coordinates to image coordinates for the displayed image. This is useful for passing coordinates to the crop functions. Use CIMG_set_croprect_scroll () to display an area of the image and enable scrolling. See CIMG_set_croprect_scroll() for more information. Syntax int SNBDAPI CIMGLOW_map_wnd_to_image(Control *win_control, int *px, int *py); Remark Table 21.14: CIMGLOW_map_wnd_to_image Function Variables Variable Description win_control px py Window form control object Pointer to an integer of an X coordinate to convert Pointer to an integer of a Y coordinate to convert Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. double calcAspectZoom() This function allows you to retrieve the ASPECT_ZOOM value for each of the aspect type properties. 129 Chapter 21 - Image Display Functions 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: 0 = fit to window if type = aspect default 100 = display pixels one to one if type = aspect default Returns the zoom value of the particular tag. Returns the zoom value as an ASPECT_ZOOM. double zoom type Example 21.2 double calcAspectZoom snowPanel1.Type = ZOOM_TYPE.ASPECT_DEFAULT; snowPanel1.Zoom = 0; CIMG_display_bitmap_aspect (?,?,?,?,?,snowPanel1.Zoom,snowPanel1.Type); EQUALS: CIMG_RECT view = new CIMG_RECT (snowPanel1.Left,snowPanel1.Top,snowPanel1.Right,snowPanel1. Bottom); double aspectzoom = snowPanel1.calcAspectZoom (view,snowPanel1.Zoom,snowPanel1.Type); CIMG_display_bitmap_aspect(?,?,?,?,?,aspectzoom,ZOOM_ TYPE.ASPECT_ZOOM) Returns Returns the ASPECT_ZOOM value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. removeScrollbars() This function removes scrollbars from the given control. 130 Chapter 21 - Image Display Functions 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, Snowbound Error Codes for a list of error codes. 131 Chapter 22 - Image Display Option Functions Chapter 22 - Image Display Option Functions This chapter describes the RasterMaster .NET image display option functions. CIMG_animate() This function draws all frames of the animated GIF file passed in as bm_name once. Call this function repetitively for continuous display. Use the delay time in the image for proper frame synchronization. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Animate sample. Syntax int SNBDAPI CIMG_animate(Graphics *g, String *bm_name, int xs, int ys, int xsize, int ysize); Remark Table 22.1: CIMG_animate Function Variables Variable Description g bm_name xs ys xsize ysize Graphics object Animated GIF filename to use Starting x position to draw Starting y position to draw X size of image drawing rectangle Y size of image drawing rectangle Returns Returns the status of the animate operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_bitmap_palette() This function loads the palette from the image into the video adapter’s lut. 4 and 8-bit images have palettes associated with them. For best display quality, the video adapter’s lut or video dac must be loaded with this palette. 132 Chapter 22 - Image Display Option Functions For a 24-bit image displaying on a 256-color adapter, it loads a special rainbow palette which the library creates internally. For 1-bit images with aliasing set to SCALE_TO_GRAY, it loads a 256 gray scale palette. Syntax int SNBDAPI CIMG_bitmap_palette(Graphics *g); Remark Table 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. 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 xpos ypos width height Graphics object Starting X coordinate for display of image Starting Y coordinate for display of image Width of desired image to display Height of desired image to display Display the following effect: effect 1 - (Default) Displays image with no image effects 2 - Displays image from the bottom to the top of the 133 Chapter 22 - Image Display Option Functions Variable Description Window 3 - Displays image in the Window from the right to the left side in vertical lines 4 - Displays image in the Window from the left to the right side using vertical lines 5 - Displays image in the Window in a window horizontal blind fashion 6 - Displays image in the Window as staggered blocks 7 - Displays image in the Window as blocks from the center of the Window 8 - Displays image in the Window in a window vertical blind fashion 9 - Displays image in the Window as small blocks from the center of the Window 10 - Displays image in the Window as blocks in a zigzag pattern Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_set_gamma() This function corrects for the gamma or response curve of the monitor. The default is 100. This drastically improves the quality of gray scale or 24-bit images. Syntax int SNBDAPI CIMG_set_gamma(int gamma); Remark Table 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, Snowbound Error Codes for a list of 134 Chapter 22 - Image Display Option Functions error codes. CIMG_set_lut() This function changes the contrast or brightness of the image. Positive values add contrast or brightness to the image while negative values darken or decrease the contrast of the image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Contrast sample. Syntax int SNBDAPI CIMG_set_lut(int contrast, int brightness); Remark Table 22.5: CIMG_set_lut Function Variables Variable Description contrast brightness Integer value from -127 to 127 Integer value from -127 to 127 Returns Returns the status of the set look up table operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_window_level() This function turns window-leveling on or off for 16 or 8-bit gray scale images. Window-leveling remaps pixel values to increase or decrease the dynamic range of gray values. Many medical images have been created to use only a portion of the total range of gray values possible. They appear very dark or washed out and need contrast enhancement or window leveling. This is typical. The window-leveling function improves the contrast to allow more details to be present in the image at display time. A normal 16 bit image that does not need window leveling should be display correctly. If the min and max values are set to 0, the function automatically calculates the best values for min and max. The image data is never changed since the pixel remapping is done at display time. Syntax int SNBDAPI CIMG_window_level(int min_gray_value, int max_gray_ value, int on_off); 135 Chapter 22 - Image Display Option Functions Remark Table 22.6: CIMG_window_level Function Variables Variable Description min_gray_value max_gray_value Starting pixel gray value Ending pixel gray value Turn Windows leveling on or off 0 = Off 1 = On on_off Returns Returns the status of the set window level operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_autocolor() This global function displays multiple palette images at the same time. A single rainbow palette created by the library is realized when CIMG_bitmap_palette() is called for any palette image. See CIMG_bitmap_palette() for more information. This forces the library to dither all 8-bit images to this palette for best display quality when using multiple palette images. Syntax int SNBDAPI CIMGLOW_autocolor(int color); Remark Table 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, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 136 Chapter 22 - Image Display Option Functions CIMGLOW_set_alias() This function sets the aliasing factor for the specified image. It is used to turn aliasing on or off for a specific image when one or more images are loaded in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Page l Thumbnail l Web Image Viewer Component Syntax int SNBDAPI CIMGLOW_set_alias(int alias); Remark Table 22.8: CIMGLOW_set_alias_img Function Variable Variable Description alias Sets the aliasing factor. Choose from: 0 = No aliasing 1 = Use the preserve black algorithm 2 = Use the scale to gray algorithm 3 = Use the scale to color algorithm 4 = Alias all. Use scale to gray and scale to color Returns Returns the status of the aliasing factor. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_alias_quality() This function sets the effectiveness of scale to gray and preserve black algorithms. This function works when using CIMGLOW_set_alias(). A value of 100 ensures that no black pixels will be discarded when displaying the image. See CIMGLOW_set_alias() for more information. Syntax int SNBDAPI CIMGLOW_set_alias_quality(int alias_quality); 137 Chapter 22 - Image Display Option Functions Remark Table 22.9: CIMGLOW_set_alias_quality Function Variable Variable Description alias_quality Alias Quality; 0 to 100 0 = Discard black pixels 100 = Do not discard any black pixels Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_dithermode() This global function dithers 24-bit images to a 256-color display. Also 8 and 24-bit images are dithered on 16-color display adapters. If the display is set to DITHER_NONE, you are at the mercy of the display driver. For instance, 24-bit images on a 256 color display adapter can take 2 or more minutes to display with dither mode off. Syntax int SNBDAPI CIMGLOW_set_dithermode(int mode); Remark Table 22.10: CIMGLOW_set_dithermode Function Variable Variable Description mode Use the above values to decide how or how not to dither. The default is -1. Returns Returns the status of the set dither mode reduction operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Screen Display Dither Mode Constants Example 22.1 CIMGLOW_set_dithermode DITHER_NONE 0 /* Allows for Windows to do the color reduction. This is not recommended, but available. */ 138 Chapter 22 - Image Display Option Functions DITHER_BAYER 1 /* Uses the Bayer dithering algorithm for color reduction. */ DITHER_DIFFUSION 2 /* Use error diffusion for color reduction. */ ** GLOBAL FUNCTION** CIMGLOW_set_imnet_page_size() This function allows you to set the document size for the IMNET format. Note: The default value is 200 for the DPI and 0 for the width and height. Syntax int SNBDAPI CIMGLOW_imnet_page_size(int iWidth, int iHeight, int iDPI); Remark Table 22.11: CIMGLOW_set_imnet_page_size Function Variables Variable Description iWidth iHeight iDPI Sets the document’s width Sets the document’s height Sets the document in dots per inch (DPI) Returns Returns the status of the set IMNET page size operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_rop() This function allows images to be displayed on the screen using ANDing, ORing or any other legal Windows opcode. Syntax int SNBDAPI CIMGLOW_set_rop(int raster_operation); 139 Chapter 22 - Image Display Option Functions 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 destination bitmap. SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator. SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator. SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. NOTSRCCOPY = Copies the inverted source bitmap to the destination. raster_operation NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. PATCOPY = Copies the pattern to the destination bitmap. PATPAINT = Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator.Combines the destination bitmap with the pattern using the Boolean XOR operator. DSTINVERT - Inverts the destination bitmap. BLACKNESS - Turns all output black. WHITENESS - Turns all output white. 140 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_transp_color() This function sets the transparent color for GIF images. Syntax int SNBDAPI CIMGLOW_set_transp_color(int color); Remark Table 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_wipedelay() This function is used with CIMG_display_ddb_effect() to speed up or slow down the speed that the image is drawn on the screen. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DDB Effect sample. Syntax int SNBDAPI CIMGLOW_set_wipedelay(int wipe_delay); Remark Table 22.14: CIMGLOW_set_wipedelay Function Variable Variable Description wipe_delay Delay time in seconds 141 Chapter 22 - Image Display Option Functions Returns Returns the delay time. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 142 Chapter 23 - Information Query Functions Chapter 23 - Information Query Functions This chapter describes the RasterMaster .NET information query functions. CIMG_bitmap_info() This function gets information about the current image and returns a pointer to the DIB data in memory. All images decompressed or imported into the library are converted to a Windows DIB. It contains a header BITMAPINFOHEADER, palette RGBQUAD, and the raw DIB data. See Chapter 33 - Format For Decompressed Images for more information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Animate l Annaction l Annotation l ASP Conversion l ASP Image View l ASP Memory Copy l ASP Multiple Pages l Batch_XPS_Convert l Contrast l Convert_Doc l DocClean l DDB Effect l Image Processing l FileMem 143 Chapter 23 - Information Query Functions l Panning l Scan l Text Search l Thumbnail l WPFAnnotation_CSHARP l WPFConversion_CSHARP l WPF Image l WPFScanning_CSHARP l VectorConvertMem_CSHARP l XPSMem_CSHARP Syntax LPDIB_HEADER SNBDAPI CIMG_bitmap_info(CDIB_HEADER *dib header); Remark Table 23.1: CIMG_bitmap_info Function Variable Variable Description dib_header Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. Returns Returns a memory handle for the DIB. Returns a pointer to an image in memory. CIMG_get_bitmap_palette() This function returns the palette of the image specified in HPALETTE format. The developer is responsible for releasing HPALETTE when finished with it. Syntax HPALETTE SNBDAPI CIMG_get_bitmap_palette(void); Returns Returns the palette as an HPALETTE format of the image. 144 Chapter 23 - Information Query Functions CIMG_get_croprect() This function returns the current crop rectangle. After decompression, the default cropping rectangle is the height and width of the image. Syntax int SNBDAPI CIMG_get_croprect(CIMG_RECT *rect); Remark Table 23.2: CIMG_get_croprect Function Variable Variable Description rect Rectangle to hold new size of object. For more information, see public class CIMG_RECT. Returns Returns the current crop rectangle for the image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_get_display_rect() This function returns the coordinates of the last displayed rectangle. Syntax int SNBDAPI CIMG_get_display_rect(int *xs, int *ys, int *xsize, int *ysize); Remark Table 23.3: CIMG_get_display_rect Function Variables Variable Description xs ys xsize ysize Starting x position (left) Starting y position (top) Height of display Width of display Returns Returns the coordinates of the last displayed rectangle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 145 Chapter 23 - Information Query Functions CIMG_get_version(int, int, int, int) This function returns version information for your RasterMaster .NET. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Conversion sample. Syntax int SNBDAPI CIMG_get_version(int *major, int *minor, int *update, int*fix); Remark Table 23.4: CIMG_get_version Function Variable Variable Description major minor update fix Returns the major number of the library version. Returns the minor number of the library version. Returns the address update number of the library version. Returns the fix address number of the library version. Example 23.1 CIMG_get_version int major=0, minor=0, update=0, fix=0; status = simage.CIMG_get_version(ref major, ref minor, ref update, ref fix); Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_get_version(String) This function returns version information for your RasterMaster .NET. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Conversion sample. Syntax int SNBDAPI CIMG_get_version(String **version); 146 Chapter 23 - Information Query Functions Remark Table 23.5: CIMG_get_version Function Variable Variable Description version Returns a string with "major.minor.update.fix". For example, "17.11.8.0" Example 23.2 CIMG_get_version ToolStripStatusLabel lblStatus; this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel (); [... add status to form] String strVersion = null; status = simage.CIMG_get_version(ref strVersion); if (status >= 0) { lblStatus.Text = ".NET library " + strVersion; } else { lblStatus.Text = "Error getting RasterMaster .NET library version: " + simage.ToErrorMessage(status); } Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_ifl_version() This function returns version information for your RasterMaster .NET. Syntax int SNBDAPI CIMG_ifl_version(int *major, int *minor); Remark Table 23.6: CIMG_ifl_version Function Variable 147 Chapter 23 - Information Query Functions Variable Description major minor Pointer to 8 bytes of memory to receive the major version number Pointer to 8 bytes of memory to receive the minor version number Returns Returns version information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_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.7: CIMGLOW_get_anim_delay Function Variable Variable Description filename Path/filename of the file to return animation delay time Returns Returns the animation delay time for GIF files which have a graphic extension block containing the animation delay time parameter. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_auto_detect() This global function returns the current RasterMaster .NET auto-detection for the specified file type on the current file. Syntax int SNBDAPI CIMGLOW_get_auto_detect(int format); Remark Table 23.8: CIMGLOW_get_auto_detect Function Variable Variable Description format Image format type from the defined list in imglib.h 148 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, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_get_bitmap_header() This function fills in the CDIB_HEADER structure for the image. It is used to get height, width, bits_pix and other information. bits_pix and other information. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMGLOW_get_bitmap_header(CDIB_HEADER *dib_header); Remark Table 23.9: CIMGLOW_get_bitmap_header Function Variables Variable Description dib_header Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_bitmap_name() This function returns a text string from the image, if available. It is mainly used for TIFF images. Each buffer should be at least 200 bytes. Syntax int SNBDAPI CIMGLOW_get_bitmap_name(String *strName, String *strDate); Remark Table 23.10: CIMGLOW_get_bitmap_name Function Variables 149 Chapter 23 - Information Query Functions Variable StrName StrDate Description Pointer to a string to receive the name or author from the last image decompressed Pointer to a string to receive the date from the last image decompressed Returns Returns the text string from the image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 23.3 CIMGLOW_get_bitmap_name C#:simage.CIMGLOW_get_bitmap_name(ref strBMName, ref strDateInfo); CIMGLOW_get_custstring() This function returns a string stored in RasterMaster .NET. The name of the corporation licensed to use this product is embedded in RasterMaster .NET by Snowbound Software. This allows detection of the DLL or OCX to ensure that the user has the correct version. Syntax int SNBDAPI CIMGLOW_get_custstring(String *custstring); Remark Table 23.11: CIMGLOW_get_custstring Function Variable Variable Description custstring Pointer to string in which to store custom string data Returns Returns the string stored in RasterMaster .NET. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_fileinfo() This function gets image information by filling in the lpbih structure containing height, width and bits per pixel for the image. This structure should be allocated large enough to fit the size of the lpbih structure (40 bytes). 150 Chapter 23 - Information Query Functions Syntax int SNBDAPI CIMGLOW_get_fileinfo(String *filename, CDIB_HEADER *dib_header); Remark Table 23.12: CIMGLOW_get_fileinfo Function Variables Variable Description filename Any valid existing image on the disk Pointer to a CDIB_HEADER structure. For more information, see public class CDIB_HEADER. dib_header Returns Returns the image information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_fileinfo_fd() This function reads and returns the file header information from the image file and specific page number passed in. It fills in the DIB_HEADER structure with width, height, dpi and bits per pixel. Syntax int SNBDAPI CIMGLOW_get_fileinfo_fd_(FileStream *filestream, CDIBHEADER *dib_header); Remark Table 23.13: CIMGLOW_get_fileinfo_fd Function Variables Variable Description filestream Pointer to FileStream object Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. dib_header Returns Returns the status of the file header information operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 151 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.14: CIMGLOW_get_fileinfo_page Function Variables Variable Description filename Image path and file name Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. Page number starts at 0 dib_header page Returns Returns the file information. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_fileinfo_fd() This function reads and returns the file header information from the image file passed in. It fills in the DIB_HEADER structure with width, height, DPI, and bits per pixel. Syntax int SNBDAPI CIMGLOW_get_fileinfo_fd(FileStream *filestream, CDIB_ HEADER *dib_header); Remark Table 23.15: CIMGLOW_get_fileinfo_fd Function Variables Variable Description filestream Handle returned from a Windows OpenFile() call Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. dib_header 152 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, Snowbound Error Codes for a list of error codes. CIMGLOW_get_filetype() This function returns the filetype as defined in imglib.h. Syntax int SNBDAPI CIMGLOW_get_filetype(String *filename); Remark Table 23.16: CIMGLOW_get_filetype Function Variable Variable Description filename Path/filename of image to return file type Returns Returns the filetype as defined in the image library (imgelib.h). For example, a Word file would return the file type number 86. For a list of file type numbers, please see Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_filetype_fd() This function returns the file types as defined in imglib.h for the file handle of the image currently open. The regular decompress bitmap starts at the beginning of the file, position zero. If the image you want to open is embedded in a file, use CIMG_ decompress__bitmap_ fd to open the content at the current position without rewinding to the beginning of the file. Syntax int SNBDAPI CIMGLOW_get_filetype_fd(FileStream *filestream); Remark Table 23.17: CIMGLOW_get_filetype_fd Function Variable Variable Description filestream File handle obtained from OpenFile() or _lopen() Windows call 153 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, pleasesee Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_filetype_mem() This function gets the file type number of the image stored in memory at the location pointed to by the filename pointer. Syntax int SNBDAPI CIMGLOW_get_filetype_mem(Array *data); Remark Table 23.18: CIMGLOW_get_filetype_mem Function Variable Variable Description data Pointer to image in memory Returns Returns the standard library image handle. For example, a Word file would return the file type number 86. For a list of file type numbers, please see Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_filetype_url() This function gets the file type number of the image stored in the given Uniform Resource Locator (URL) address. Syntax int SNBDAPI CIMGLOW_get_filetype_url(String *strURL); Remark Table 23.19: CIMGLOW_get_filetype_url Function Variable Variable Description strURL The URL address to point to the image 154 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 Appendix B, Supported File Formats. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_image_orientation_page() This function returns the rotation angle for the filename and page specified. It is used to get the orientation of images in multi-page file formats. It returns the same values as CIMGLOW_get_ image_orientation(). Syntax int SNBDAPI CIMGLOW_get_image_orientation_page(String *filename, int page); Remark Table 23.20: CIMGLOW_get_image_orientation_page Function Variables Variable Description filename page Path/filename of image to return orientation information Page number to return orientation Returns Returns the rotation angle for the filename and page specified. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_pages() This function returns the number of pages for a multi-page file. If the file is not of the multi-page variety (such as TIFF, .DCX, PDF, or MO:DCA:IOCA) the function returns 1. It supports unicode file name input. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l ASP Multiple Pages l Convert_Doc l Page 155 Chapter 23 - Information Query Functions l Scan l Split to Multiple Pages l Text Search l Thumbnail l WPFAnnotation_CSHARP l WPFConversion_CSHARP l WPFScanning_CSHARP Syntax int SNBDAPI CIMGLOW_get_pages(String *filename); Remark Table 23.21: CIMGLOW_get_pages Function Variable Variable Description filename Path/filename of image to return page information Returns Returns the number of pages for a multi-page file. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_pages_fd() This function returns the number of pages for a multi-page file. If the file is not of the multi-page variety (such as TIFF or MO:DCA:IOCA) the function returns 1. Syntax int SNBDAPI CIMGLOW_get_pages_fd(FileStream *filestream); Remark Table 23.22: CIMGLOW_get_pages_fd Function Variable Variable Description filestream Handle returned from a Windows OpenFile() call 156 Chapter 23 - Information Query Functions Returns Returns the number of pages for a multi-page file. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_pages_mem() This function returns the number of pages from an image stored in the pointer passed as the first argument. This is similar to CIMGLOW_get_pages() but is used for the image stored in a memory pointer. Syntax int SNBDAPI CIMGLOW_get_pages_mem(Array *data); Remark Table 23.23: CIMGLOW_get_pages_mem Function Variable Variable Description 32 Pointer to image in memory Returns Returns the number of pages from an image stored in the pointer passed as the first argument. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_pages_url() This function returns the number of pages from an image stored in the given Uniform Resource Locator (URL) address. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMGLOW_get_pages_url(String *strURL); Remark Table 23.24: CIMGLOW_get_pages_url Function Variable Variable Description strURL The URL address to point to the image. 157 Chapter 23 - Information Query Functions Example 23.4 CIMGLOW_get_pages_url status = simage.CIMGLOWLOW_get_pages_url ("http://www.snowbound.com/images/HomeBanner0.jpg"); status = simage.CIMGLOWLOW_get_pages_url ("http://localhost/images/test.pdf"); Returns Returns the number of pages from an image stored in the given URL address. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_tiff_tag() This function reads a TIFF tag from the file specified by bm_name. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. A return value of 0 indicates a non-string value. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Tiff Tag sample. int SNBDAPI CIMGLOW_get_tiff_tag(int tag, int max_bytes, int *ptr_ value, String *strFileName, String *strBuff); Remark Table 23.25: CIMGLOW_get_tiff_tag Function Variables Variable Description tag max_bytes ptr_value strFileName strBuff TIFF tag number to return Maximum bytes to read for string tags Pointer to tag value returned Filename to read tags from String buffer for returning string tags Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 158 Chapter 23 - Information Query Functions You can use the TIFF tag to get the colorspace type by specifying tag #262. Value is what is returned. For this tag you will not need the bytearray. Example 23.5 CIMGLOW_get_tiff_tag int tag_no = 262; int max_bytes = 0; int[] value = new int[1]; byte[] data = null; myFrame.Simage.CIMGLOW_get_tiff_tag(tag_no, max_bytes, value, st, data, page); /* PHOTOMETRIC INTERPRETATION */ #define TIFF_PHOTO_WHITE_IS0 0 #define TIFF_PHOTO_WHITE_IS1 1 #define TIFF_PHOTO_RGB 2 #define TIFF_PHOTO_PALETTE 3 #define TIFF_PHOTO_TRANSP 4 #define TIFF_PHOTO_CMYK 5 #define TIFF_PHOTO_YCC 6 #define TIFF_PHOTO_CIELAB 8 CIMGLOW_get_tiff_tag_page() This function reads a TIFF tag from the file specified by filename and the page specified by page. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. Return values of 0 indicate non-string values. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page(String *filename, int page, CTIFF_TAG *tag); Remark Table 23.26: CIMGLOW_get_tiff_tag_page Function Variables Variable Description filename page Path/filename of image to return orientation information Page number from which to read tags TIFF tag number to return. For more information, see ‘‘public class CTIFF_TAG’’ tag 159 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, Snowbound Error Codes for a list of error codes. CIMGLOW_get_tiff_tag_page_fd() This function reads a TIFF tag from the file specified by filestream and page specified by page. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. Return values of 0 indicate non-string values. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page_fd(Filestream *filestream, int page, CTIFF_TAG *tag); Remark Table 23.27: CIMGLOW_get_tiff_tag_page_fd Function Variables Variable Description filestream page Handle returned from a Windows OpenFile() call Page number from which to read tags TIF tag number to return. For more information, see public class CTIFF_TAG. tag Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_tiff_tag_page_mem() This function reads a TIFF tag from the image buffer. The tag may be either a string returned in buff or a long, int, or char returned in value. Syntax int SNBDAPI CIMGLOW_get_tiff_tag_page_mem(Array *data, int page, CTIFF_TAG *tag); Remark Table 23.28: CIMGLOW_get_tiff_tag_page_mem Function Variables 160 Chapter 23 - Information Query Functions Variable Description data page Memory Pointer to image data Page number from which to read tags TIF tag number to return. For more information, see public class CTIFF_TAG. tag Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 23.6 CIMGLOW_get_tiff_tag_page_mem() CTIFF_TAG tifTag = new CTIFF_TAG(); tifTag.tag = 315; tifTag.tagvalue = 0; tifTag.buff_max_bytes = 255; tifTag.buff = new byte[255]; status = simage.CIMGLOW_get_tiff_tag_page_mem(arrImageData, 0, tifTag); UTF8Encoding utf8Encoder = new UTF8Encoding(); String tagString = utf8Encoder.GetString(tifTag.buff); int tagValue = tifTag.tagvalue; CIMGLOW_get_tile_info() This function fills in the tile structure information on width, height, tile width, and tile height. Syntax int SNBDAPI CIMGLOW_get_tile_info(String *filename, CSNBDTILESTRUCT *tile, int page); Remark Table 23.29: CIMGLOW_get_tile_info Function Variables Variable Description filename Path/filename of tiled image for which to return information Pointer to the tile information structure to return. For more information, see public class CSNBDTILESTRUCT. Page number of the tile information structure to return tile page 161 Chapter 23 - Information Query Functions Example 23.7 CIMGLOW_get_tile_info typedef struct tagSNBDTILESTRUCT { Long width; Long height; Long tile_width Long tile_height Long num_tiles; SNBDTILESTRUCT Returns Returns the file name of a tiled image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_transp_color() This function gets the transparent color for GIF images. int SNBDAPI CIMGLOW_get_transp_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_is_tiled_image() This function returns 1 if the image passed as argument is a tiled image. Currently TIFF and JEDMICS images can be tiled. Syntax int SNBDAPI CIMGLOW_is_tiled_image(String *filename); Remark Table 23.30: CIMGLOW_is_tiled_image Function Variable Variable Description filename Path/filename of the file to return animation delay time 162 Chapter 23 - Information Query Functions Returns Returns the value of the tiled image. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_read_pixel() This function reads and returns a pixel value from the image. The xpos and ypos specify the location in the image from which to read. See CIMG_runs_to_dib() for more information. Syntax int SNBDAPI CIMGLOW_read_pixel(int xpos, int ypos); Remark Table 23.31: CIMGLOW_read_pixel Function Variables Variable Description xpos ypos X coordinate of pixel to read Y coordinate of pixel to read Returns Returns the status of the read pixel operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_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.32: CIMGLOW_set_bitmap_header Function Variables Variable Description dib_header Pointer to a CDIB_HEADER structure in which to fill. For more information, see public class CDIB_HEADER. 163 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, Snowbound Error Codes for a list of error codes. You can use the CIMGLOW_set_bitmap_header and the CIMG_resize_bitmap functions to change the resolution (DPI) of your output document as shown in the example below: Example 23.8 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, newImageHeight); status = simage.CIMGLOW_set_bitmap_header(sdibHeader); CIMGLOW_set_document() This function sets the format parameter is an integer to represent an image type. Syntax int SNBDAPI CIMGLOW_set_document(int dpi, int bits, int format); Remark Table 23.33: CIMGLOW_set_document Function Variables Variable Description dpi Sets the document in dots per inch. Sets the bits per pixel. 1 = black and white documents 24 = color images Sets the format parameter. bits format 164 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_document_input(int, int) This function sets the level of color and resolution quality when reading in documents for most document formats. It is used for the PDF, Word, Excel, PCL, and AFP formats. This function should be called before the input document is read in using CIMG_decompress_bitmap(). You can override RasterMaster .NET’s default bits-per-pixel and DPI settings using this method. You may want to process just black and white documents. Use this method to set the input bits-per-pixel to 1 for black and white input without the extra overhead and performance costs of processing color images. You can use this function to do the following: l Read in color or grayscale documents by setting a higher bits-per-pixel. Please see Appendix B, Supported File Formats for details on what bits per pixel are supported for each format. l Increase your output image quality by increasing the input document DPI. l Enhance your performance by decreasing the document DPI or bits per pixel. This method does not affect the Office 2007 -2010 formats. Please see CIMGLOW_set_ document_input(int, int, int) to set the input quality for a specific format, including Office 2007 formats. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Note: The default is 200 dpi and 24 bits per pixel for PDF. The default is 300 dpi and 1 bit per pixel for PCL, AFP, Word, and Excel. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi, int bits_pix); Remark Table 23.34: CIMGLOW_set_document_input Function Variables Variable Description dpi Sets the input resolution in dots per inch. A higher dpi 165 Chapter 23 - Information Query Functions Variable Description bits_pix yields a higher quality document that takes longer to process and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents 24 = color images See Appendix B, Supported File Formats for information on these and other pixel depths supported by each format. Returns Returns the status of the document input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_document_input(int, int, int) This function sets the level of color and resolution quality when reading in documents for the specified document format. This function should be called before the input document is read in using CIMG_decompress_bitmap(). You can override RasterMaster .NET’s default bits-per-pixel and DPI settings for the specified format using this function. You can use this function to do the following: l l Set the input bits-per-pixel to 1 for black and white input to remove the extra overhead and performance costs of processing color images. Read in color or grayscale documents by setting a higher bits-per-pixel. Please see Appendix B, Supported File Formats for details on what bits per pixel are supported for each format. l Increase your output image quality by increasing the input document DPI. l Increase your processing throughput by decreasing the document DPI or bits per pixel. Note: The default is 200 dpi and 24 bits per pixel for PDF. The default is 300 dpi and 1 bit per pixel for PCL, AFP, Word, and Excel. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi, int bits_pix, int format); 166 Chapter 23 - Information Query Functions Remark Table 23.35: CIMGLOW_set_document_input Function Variable Variable Description dpi Sets the input resolution in dots per inch. A higher dpi yields a higher quality document that takes longer to process and takes up more memory and storage space. Sets the bits per pixel. 1 = black and white documents 24 = color images bits_pix See Appendix B, Suported File Formats for information on these and other pixel depths supported by each format. Sets the format parameter. A file format number as format specified in Appendix B, Supported File Formats 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_document_page_size(int, int, int) This function sets the document's page size. Note: Currently this method only supports .xls and .xlsx files. Syntax int SNBDAPI CIMGLOW_set_document_page_size(double width, double height, int format); Remark Table 23.36: CIMGLOW_set_document_page_size Function Variable Variable Description width height Sets the page size width. Using unit inches. Sets the page size height. Using unit inches. Sets the format parameter. Currently, the only supported file format is Excel. A file format number as specified in Appendix B, Supported File Format i.e. Excel(XLS) is 84. format 167 Chapter 23 - Information Query Functions Example 23.9 CIMGLOW_set_document_page_size status = simage.CIMGLOW_set_document_page_size(20.0, 20.0, (int)CIMG_IMAGE_TYPE.xls); Returns Returns the status of the document page size. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 168 Chapter 24 - Text Search Functions Chapter 24 - Text Search Functions This chapter describes the RasterMaster .NET text search functions. CIMG_save_document() This function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_ bitmap() function only creates a bitmap file. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. Syntax int SNBDAPI CIMG_save_document(String *strName, char *buff, int filetype); Remarks Table 24.1: CIMG_save_document Function Variables Variable Description *strName buff filetype Name of the output PDF file Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59 Returns Returns the document file output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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 169 Chapter 24 - Text Search Functions /PageNumber=XPage number being extracted. /PageWidth=XWidth of page in points. (1/72 of an inch) /PageHeight=XHeight of page in points. (1/72 of an inch) %%EOFMarks the end of this file. No more data to process. /FontStart of font data and attributes. /FontName=TextStandard font face name. /FontHeight=XFont height in points (1/72 of an inch). /FontBold=XSet to 1 for bold font otherwise 0. /FontItalic=XSet to 1 for Italic font otherwise 0. /Xpos=XX starting coordinate of text string. /Ypos=XY starting coordinate of text string. %%SOTStart of a text string after the carriage return. Text Data here %%EOTEnds a text string. /ImageStart of image data and attributes. /ImageWidth=XWidth in pixels of the image data. /ImageHeight=XHeight in pixels of the image data. /Bitsperpixel=XNumber of bits per pixel. /Compression=TextCompression type used. CCITT_G4, JPEG, or NONE. /Length=XLength of binary image data. %%SOIStarts the binary image data. Binary data here %%EOIEnds the binary image data. /DrawImage Xs Ys Width HeightDraws the last defined image at the location specified by the arguments. /Moveto XS YSMoves current graphics drawing position. /LineXS YSDraws a line from current graphics drawing position to a location specified by the arguments. /Rectangle XS YS WIDTH HEIGHT Draws a rectangle at the specified coordinates. /Curve X1 Y1 X2 Y2 X3 Y3Draws a curve from the current graphics drawing position to the end coordinates using the first 4 arguments as guide points. 170 Chapter 24 - Text Search Functions CIMG_save_mem() This function saves the current snowbound object to a image buffer. It calculates the size of the memory buffer and grows it appropriately. Syntax int SNBDAPI CIMG_save_mem(Array* arrBuffer, int initial_size, int buff_inc, int format, Int32* buff_size); Remark Table 24.2: CIMG_save_mem Function Variables Variable Description arrBuffer initial_size Byte array buffer image save in. Initial size of the image buffer to allocate. Amount to grow the buffer if more space is needed to save. Format code to save as. Saved image buffer size. buff_inc format buff_size Returns Returns the memory buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_save_mem_page() This function saves the current page and appends it to the current image buffer. It calculates the size of the memory buffer and grows it appropriately. Syntax int SNBDAPI CIMG_save_mem_page(Array* arrBuffer, int buff_inc, int format, Int32* buff_size); Remark Table 24.3: CIMG_save_mem_page Function Variables Variable Description arrBuffer Byte array buffer image save in. Amount to grow the buffer if more space is needed to save. Format code to save as. Saved image buffer size. buff_inc format buff_size 171 Chapter 24 - Text Search Functions Returns Returns the memory buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_append_page() This function extract pages from image file and append them to image buffer. Currently only works for PDF formatt. Syntax int SNBDAPI CIMGLOW_append_page(String *strFileName, Array* arrBuffer); Remarks Table 24.4: CIMGLOW_append_page Function Variables Variable Description strFileName *arrBuffer Input document name. Image buffer to save /in Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_extract_text() This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files. It returns the buffer of extracted text in ASCII format. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Convert_Doc l Text Search Syntax int SNBDAPI CIMGLOW_extract_text(String *strFileName, Byte *arrBuffer, int *ptrLength, int page); 172 Chapter 24 - Text Search Functions Remarks Table 24.5: CIMGLOW_extract_text Function Variables Variable Description *strFileName *arrBuffer Name of file from which to extract text Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text *ptrLength page Returns Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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 %%SOI %%EOI Table 24.6: Extracted Text Variables Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters. Variable Description %%SOF %%EOF Page Signals the start of the buffer Marks the end of extracted text Specified once at the beginning of the file to indicate the 173 Chapter 24 - Text Search Functions Variable Width Height Font Name FontHeight Description page number Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate page height in pixels Name of font Font height in pixels Font to be drawn plain or in bold FontBold 1 = bold 0 = plain Font to be drawn in normal or italic FontItalic 1 = italic 0 = normal X pos in pixels Y pos in pixels Start of text block End of text block Start of image End of image Start of Text Unicode/UTF. End of Text Unicode/UTF. Xpos Ypos %%SOT %%EOT %%SOI %%EOI %%SOTU %%EOTU CIMGLOW_extract_text_mem_pointer() This function extracts text from memory. It returns the buffer pointer of extracted text in ASCII format. This function runs faster than CIMG_extract_text_mem. It is only supported by C++ and C#. Syntax int SNBDAPI CIMGLOW_extract_text_mem_pointer(Array *arrImage, Byte *arrBuffer, int *ptrLength, int page); Remarks Table 24.7: CIMGLOW_extract_text_mem_pointer Function Variables Variable Description *arrImage *arrBuffer Memory array to image data Pointer of buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer *ptrLength 174 Chapter 24 - Text Search Functions Variable Description page Page number of file from which to extract text Returns Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_extract_page() This function extracts a page from document and save to image buffer. Currently only works for PDF format. Syntax int SNBDAPI CIMGLOW_extract_page(String *strFileName, Array* arrBuffer, int page); Remarks Table 24.8: CIMGLOW_extract_page Function Variables Variable Description strFileName *arrBuffer page Input document name. Image buffer to save /in Page number of file from which to extract text Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_extract_page_mem() This function extracts a page from memory and save to image buffer. Currently only works for PDF format. Syntax int SNBDAPI CIMGLOW_extract_page_mem(Array *arrImage, Array* arrBuffer, int page); Remarks Table 24.9: CIMGLOW_extract_page_mem Function Variables 175 Chapter 24 - Text Search Functions Variable Description arrImage *arrBuffer page Input image buffer. Image buffer to save /in Page number of file from which to extract text Returns Returns the image buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_search_text() This function returns an array of structures of classes of the type, SNBD_SEARCH_RESULT. For each class or structure there is an array of rectangles. This is to allow a search term to wrap to a new line requiring more than two rectangles to highlight. The nCount parameter will be set to the number of rectangles required for each instance of a search term. The rectangles will be sorted from the top of the page to the bottom from the left side to the right. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Text Search sample. Syntax int SNBDAPI CIMGLOW_search_text(CIMG_SEARCH_RESULT[] sbdRCList, Array *txtbuffer, String *strSearch, int case_sense, int *ptrerror, int *pRecNum); Remark Table 24.10: CIMGLOW_search_text Function Variables Variable sbdRCList txtBuffer strSearch instance case_sense ptrerror pRecNum 176 Description Array of CIMG_SEARCH_RESULT specifying the location of the string found. For more information, see public class CIMG_SEARCH_RESULT. Character buffer to search. Returned from a call to CIMGLOW_extract_text(). Search string Occurance of search string to find, start from 0 Is search case sensitive. 0 = Not case sensitive 1 = case sensitive Error code Number of items in search result array. Chapter 24 - Text Search Functions Returns Returns the status of the array of structures of classes of the type, SNBD_SEARCH_ RESULT. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_document_input() This function sets the level of color and resolution quality when reading in documents for the specified document format. Syntax int SNBDAPI CIMGLOW_set_document_input(int dpi,int bitsperpixel, int format, double width, double height); Remark Table 24.11: CIMGLOW_set_document_input Function Variables Variable Description dpi bitsperpixel format width height Input resolution in dots per inch. Bits per pixel. Format code number. Page width. Units in inches. Page width. Units in inches. Returns Returns the status of the document input. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 177 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 barcodes, then you can customize RasterMaster .NET to use particular fonts when processing your AFP files. RasterMaster .NET is easy to customize to improve the look of your AFP documents. Snowbound Software allows you to map the fonts in your AFP/MODCA document to fonts on your system using a mapping file named snbd_map.fnt. The snbd_map.fnt file is custom crafted to specify the fonts used in your AFP files and on your system. If you provide a representative sample AFP document to Snowbound Software by entering a support issue at http://support.snowbound.com, we will provide you with a custom snbd_map.fnt file usually in a few business days that will improve the display and print quality of your AFP documents. RasterMaster .NET automatically loads the snbd_map.fnt file if it is found in one of the following directories: l l The directory into which images are being read . For example: C:\\AFP\\fontmap The directory where your application exists as long as you are not changing directories with a dialog box The following functions allow you to set font mapping: 1. The CIMGLOW_set_fontmap_path() function sets the path of the font mapping file. See CIMGLOW_set_fontmap_path() for more information. 2. The CIMGLOW_set_fontmap() function programmatically sets the font mapping. See CIMGLOW_set_fontmap() for more information. Format of Font Mapping Data Any AFP font name can now be mapped to the following: 178 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,Times New Roman,14,0,1 Table 25.1: Description of a sample entry in the snbd_map.fnt file Variable Description C0BC25I3 Courier 10 0 0 Font resource name in the AFP file. New face name to map to. New size in points or 1/72 of an inch. Bold attribute, 0 - off , 1 - on. Italic attribute 0 - off, 1 - on. Color Documents Rendered as Black and White AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use CIMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance. If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Format for details on which formats support color information at different bitdepths. CIMGLOW_set_fontmap_path() This function defines the path where Snowbound Software will look for the font mapping file, snbd_map.fnt. If the path is not currently set, RasterMaster .NET looks for it in the current directory. The current directory is whatever folder the program is currently in, usually wherever the file being decompressed is located. Syntax int SNBDAPI CIMGLOW_set_fontmap_path(String *strPath); 179 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. strPath The snbd_map.fnt file will be appended to the path name. CIMGLOW_set_fontmap_path("c:\\temp"); This variable is limited to 50 bytes. Therefore, the path must be below 50 characters. Example 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_fontmap() This function programmatically sets font mapping. Syntax int SNBDAPI CIMGLOW_set_fontmap(String *strFontMap, int mapLength); Remarks Table 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 variable overrides existing font mapping in the snbd_ map.fnt file. strFontMap The following are some examples of the data in this variable: C0H400xx90,PrecisionID Postnet L DEMO,12,0,0 C0BPOSBX,CCodePostnet,10,0,0 180 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, Snowbound Error Codes for a list of error codes. CIMGLOW_set_pdf_flags() This function programmatically sets PDF flags. Syntax int SNBDAPI CIMGLOW_set_pdf_flags(int flags); Remarks Table 25.4: CIMGLOW_set_pdf_flags Function Variables Variable Description flags New flags for PDF. Returns Returns the status of the PDF flags. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_pdf_fontpath() This function ]sets the PDF font path. Syntax int SNBDAPI CIMGLOW_set_pdf_fontpath(String* fontPath); Remarks Table 25.5: CIMGLOW_set_pdf_fontpath Function Variables 181 Chapter 25 - AFP Font Mapping Functions Variable Description fontPath The source path of PDF font locatio. Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_pdfa_fontpath() This function sets the PDF/A font location. Syntax int SNBDAPI CIMGLOW_set_pdfa_fontpath(String* fontPath); Remarks Table 25.6: CIMGLOW_set_pdfa_fontpath Function Variables Variable Description fontPath PDF/A font location. Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_pdfa_fontmap() This function sets PDF/A font mapping.. Syntax int SNBDAPI CIMGLOW_set_pdfa_fontmap(String* mapData, int len); Remarks Table 25.7: CIMGLOW_set_pdfa_fontmap Function Variables Variable Description mapData Font mapping data string. Len Length of font mapping string. 182 Chapter 25 - AFP Font Mapping Functions Returns Returns the status of the font mapping data. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 183 Chapter 26 - Housekeeping Functions Chapter 26 - Housekeeping Functions This chapter describes the RasterMaster .NET housekeeping functions. CIMG_delete_bitmap() This function removes the image from memory when you are finished with it or when terminating the application. After a call to this function the image handle is no longer valid. This call should be used for each image handle generated by the library. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Annaction l Annotation l DocClean l Thumbnail l WPF Image Note: Each call to acquire an image by decompressing or scanning will delete any previous image memory as long as you are using the same Snowbound object. When you are finished with an object and are no longer using it you must call the IMG_delete_ bitmap() function to free up memory associated with the image header and data. Syntax int SNBDAPI CIMG_delete_bitmap(void); Returns Returns the status of the delete bitmap operation. A value of 0 or 1 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 184 Chapter 26 - Housekeeping Functions CIMG_delete_bitmap_keep() This function can be used in conjunction with CIMG_create_handle_keep() to delete all internal library structures and data. It will not delete the pointer passed to CIMG_create_ handle_keep(). See CIMG_create_handle_keep() for more information. Syntax int SNBDAPI CIMG_delete_bitmap_keep(void); Returns This function returns a DDB or old-style Windows bitmap (HBITMAP or Device Dependent Bitmap). The original image is not altered. CIMG_unload_plugins() This global function unloads all RasterMaster .NET plugins from memory. These plugins include snbdpl1.dll (the LZW plugin), pdfplug.dll (the PDF plugin), abic32.dll (the ABIC plugin), and more. Syntax int SNBDAPI CIMG_unload_plugins(void); Returns Returns the unloaded RasterMaster .NET plugins from memory. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** CIMGLOW_set_bitmap_name() This function sets a text string such as image name or author for the image, if the format supports it. Each buffer should be at least 200 bytes. Syntax int SNBDAPI CIMGLOW_set_bitmap_name(String *strName, String *strDate); Remark Table 26.1: CIMGLOW_set_bitmap_name Function Variables 185 Chapter 26 - Housekeeping Functions Variable strName strDate Description String to set name or author for any subsequent images to be saved String to set date for any subsequent images to be saved Returns Returns the pointer to memory. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** Example 26.1 CIMGLOW_set_bitmap_name C#:status = simage.CIMGLOW_set_bitmap_name(strBMName, strDateInfo); CIMGLOW_set_tiff_indexing() CIMGLOW_set_tiff_indexing() This function sets the TIFF indexing page. Syntax int SNBDAPI CIMGLOW_set_tiff_indexing(int pages); Remark Table 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, Snowbound Error Codes for a list of error codes. 186 Chapter 27 - DocClean Functions Chapter 27 - DocClean Functions This chapter describes the RasterMaster .NET DocClean functions. DocClean is an optional extension of RasterMaster .NET that provides a group of functions that are useful for cleaning up scanned color, grayscale and black and white images. CIMG_auto_orient() This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you may want to fix the image by using CIMG_rotate_bitmap(). See CIMG_rotate_bitmap() for more information. Syntax int SNBDAPI CIMG_auto_orient(int32 *p_angle); Remark Table 27.1: CIMG_auto_orient Function Variables Variable p_angle Description Angle returned as the current orientation. Number of pixels to add to the autocrop rectangle. Either 90 or 0 is returned. Returns Returns the status of the auto orient detection operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_deskew_bitmap() When a page is scanned in it may be skewed to some degree. This function uses the angle returned from CIMG_get_deskew_angle() to do the rotation. An angle of 0 means there is no skew. If the angle is not zero, you can provide the deskew angle returned from CIMG_deskew_ bitmap to rotate the page so it no longer appears skewed. Note: When a call is made to CIMG_deskew_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_deskew_bitmap(int angle); 187 Chapter 27 - DocClean Functions Remark Table 27.2: CIMG_deskew_bitmap Function Variable Variable angle Description Angle value set. Returns Snowbound Error Code. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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); Remark Table 27.3: CIMG_despeckle_bitmap Function Variable Variable quality Description Sets the coarseness of the amount of data to be filtered or removed. Quality factor 1 - 100 1 = Remove only single pixels 100 = Removes large black areas Returns Returns the status of the despeckle operation. May return a FORMAT_NOT_ALLOWED error message for 4 or 8-bit color palette images.A value of 0 indicates success. Any value less than 188 Chapter 27 - DocClean Functions zero is a Snowbound error code. See Appendix H, Snowbound 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 red green blue colourTolerance mismatchTolerance Description 24-bpp: Red component of the detection color or the full background color for 1, 4 and 8-bit per pixel images. May have the value of [0-255]. 1-bpp/4-bpp/8bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color. Ignored for non-24-bpp images. May have the value of [0-255]. Blue component of the detection color. Ignored for non-24-bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear distance value. Mismatch tolerance percentage. If negative, it will default to 75. An example of a valid value is 50.26. If the percentage of background pixels on the page is less than the mismatch tolerance, the image will not be inverted. 189 Chapter 27 - DocClean Functions Returns Returns 1 if the image is inverted and 0 if the image is not inverted. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_detect_blank_page() This function can be used to detect blank pages. It can also be used to detect pages that are essentially blank though there are some scan artifacts or other “dirt” on them. This function returns the percentage of pixels present that are not equal to the passed detection or background color. If autodetect is set to 1, then the detection or background color will be determined automatically and will correspond to the dominant color in the image. The tolerance value can be set to allow for a more lenient color matching the algorithm. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax double SNBDAPI CIMGLOW_detect_blank_page(int autodetect, int red, int green, int blue, int tolerance, int isLowQuality, int isLowMemory, Double* pctMismatch); Remark Table 27.5: CIMGLOW_detect_blank_page Function Variables Variable autodetect red green blue tolerance isLowQuality isLowMemory 190 Description Auto-detect the background color (0: no; 1: yes). 1 will force the system to ignore the passed color. 24-bpp: Red component of the detection color. May have the value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color. Ignored for non24-bpp images. May have the value of [0-255]. Blue component of the detection color. Ignored for non24-bpp images.May have the value of [0-255]. Per color-channel pixel-value match tolerance linear distance value. Use this value in comparing background pixels. This number is in the range [0-255]. Execute the low-quality version of the autodetect algorithm (0: no; 1: yes). The low-quality version will not guarantee the global maximum, but it will execute much faster. The tolerance level is not taken into consideration. Execute the low-memory version of the autodetect Chapter 27 - DocClean Functions Variable Description algorithm (0: no; 1: yes). The low-memory version will not guarantee the global maximum. The tolerance level is not taken into consideration. This setting is only for 24-bpp images. The percentage of pixels on the page that is not equal to the background color. If the percentage is zero or near zero, the page is blank. pctMismatch Note: The percentage is a floating point number. For example, a return value of 50.26 means 50.26% of the page is non-blank. Returns Returns 1 if the function returns no error. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_image_dilation() This function performs image dilation on the specified image. This function will thicken the content of an image making lines and text thicker. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_image_dilation(int coarseness); Remark Table 27.6: CIMGLOW_image_dilation Function Variable Variable coarseness Description The coarseness or amount of dilation. Returns Returns the status of the image dilation operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes. 191 Chapter 27 - DocClean Functions CIMGLOW_image_erosion() This function performs image erosion on the specified image. This function will thin the content of an image making lines and text thinner. This can be used to remove artifacts introduced by scanning. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_image_erosion(int quality); Remark Table 27.7: CIMGLOW_image_erosion Function Variable Variable quality Description The coarseness or amount of erosion. Returns Returns the status of the image erosion operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_remove_halftone() This function removes small blobs from images. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_remove_halftone(int minSize, int maxSize); Remark Table 27.8: CIMGLOW_remove_halftone Function Variables Variable minSize maxSize 192 Description Minimum diameter of a blob. (This value should be at least 1.) Maximum diameter of a blob. (This value should be kept very small.) Chapter 27 - DocClean Functions Returns Returns the status of the halftone removal operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_remove_lines() This function horizontal and/or vertical lines from an image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Syntax int SNBDAPI CIMGLOW_remove_lines(int horizontal, int vertical, int min_value); Remark Table 27.9: CIMGLOW_remove_lines Function Variables Variable horizontal vertical min_value Description If set to 1, removes horizontal lines. If set to 1, removes vertical lines. The smallest possible value to be considered a line. Returns Returns the status of the line removal operation. A value greater or equal to 0 indicates success and represents the number of blobs removed. Any value less than zero is an error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_remove_holepunch() This function removes hole punches from specified areas on the page or automatically finds the hole punches. Specifying a fixed area to repair is faster than having the method find and fill the holes. This may be done manually by specifying the exact span of any hole punches along with the fill color. Alternatively, this may be done automatically where both the holes and the fill color are determined algorithmically. This function removes hole punches by filling in the hole area with a background color. The background color is passed in as red, green and blue or you can have the function automatically detect the background color. 193 Chapter 27 - DocClean Functions You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the DocClean sample. Note: This will not work with alpha-channel enabled images. Syntax int SNBDAPI CIMGLOW_remove_holepunch(int autoDetectFillColour, int red, int green, int blue, int autoFindHoles, CIMG_RECT* holes[], int holeNum, CIMG_RECT* ROIs[], int ROIsNum, int minHoleDiameter, int maxHoleDiameter); Remark Table 27.10: CIMGLOW_remove_holepunch Function Variables Variable autoDetectFillColour red green blue autoFindHoles holes holeNum ROIs 194 Description Auto-detect the fill colour (0: no; 1: yes). 1 will force the system to ignore the passed fill color. 24-bpp: Red component of the detection color or the full background color for 1, 4 and 8-bit per pixel images. May have the value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May have the value of [0-1], [0-127], and [0-255], respectively. Green component of the detection color for 24-bit images. Ignored for non-24-bpp images. May have the value of [0-255]. Blue component of the detection color for 24-bit images. Ignored for non-24-bpp images.May have the value of [0-255]. Auto-detect the hole punches (0: no; 1: yes). 1 will force the system to ignore the passed holes. Array of hole punch spans to fill. If there are regions-ofinterest (ROI), then all holes which do not completely lie within an ROI are ignored. Simiarly, holes which span several ROIs but not a single ROI will be ignored. May be NULL when autoFindHoles is 1. Number of elements in the holes array. May be 0 when autoFindHoles is 1. Array of regions-of-interest (ROI). ROIs are areas where holes may span. If ROIs is NULL and the holes are not automatically found, then the entire image will be taken as the ROI. If ROIs is NULL and the holes are automatically found, then sensible ROIs will be determined algorithmically. Chapter 27 - DocClean Functions Variable ROIsNum minHoleDiameter maxHoleDiameter Description Number of elements in the ROIs array. May be 0 when ROIs is NULL. Minimum diameter in pixels of any holes. This is only used when holes are automatically found. Maximum diameter in pixels of any holes. This is only used when holes are automatically found. Returns Returns the number of holes found. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 195 Chapter 28 - Image Processing Functions Chapter 28 - Image Processing Functions This chapter describes the RasterMaster .NET image-processing functions. CIMG_antique_effect() This function converts color images to look as though they are antique photos. It replaces colors with sepia tones, which are reddish brown monochrome tints. When applied to a photo, they give the picture a warm, antique feeling. Note: This method only works with 24-bit color images. Syntax int CIMG_antique_effect(void); CIMG_apply_profile() This function takes the input profile from the creating device, such as a scanner, and output profile for a printer or display and applies them to the image. If an input file is not available, the parameter can be set to to NULL or ZERO. Syntax int SNBDAPI CIMG_apply_profile(String **strInputProfile,String **strOutputProfile, int mode); Remarks Table 28.1: CIMG_apply_profile Function Variables Variable Description strInputProfile strOutputProfile mode String buffer containing the input profile. String buffer containing the output buffer. For mode choices, see below. Table 28.2: CIMG_apply_profile Variable Modes Mode Description 0 1 2 Apply permanently to the image data. Apply only at display time.* Apply only at print time.* 196 Chapter 28 - Image Processing Functions Mode Description 3 Apply at display and print time.* * Mode settings do not change the original image data. Returns Returns the status of the apply profile operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_auto_orient() This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you may want to fix the image by using CIMG_rotate_bitmap(). See CIMG_rotate_bitmap() for more information. Syntax int SNBDAPI CIMG_auto_orient(int32 *p_angle); Remark Table 28.3: CIMG_auto_orient Function Variable Variable Description p_angle Angle returned as the current orientation. Number of pixels to add to the autocrop rectangle. Either 90 or 0 is returned. Returns Returns the status of the auto orient operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_autocrop_bitmap() This function finds and clips any white border around the image on every side. The border is discarded and the image is resized to the new cropped rectangle plus the margin. The margin may be a value of 0. Note: This function only works with 1-bit images. If you use this function with an image that is not a 1-bit image, you will get a PIXEL_DEPTH_UNSUPPORTED (-21) error message. See Appendix H, Snowbound Error Codes for a list of error codes. 197 Chapter 28 - Image Processing Functions 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, Snowbound Error Codes for a list of error codes. CIMG_create_thumbnail() This function creates a thumbnail with the correct pixel depth and automatically selects the correct resize function for the image. See CIMG_resize_bitmap() and CIMG_resize_bitmap_ bicubic() for more information. To zoom larger, use CIMG_resize_bitmap(). To zoom to a smaller size, use CIMG_create_ thumbnail(). 1-bit images are converted to grayscale with our “scale to gray” algorithm. 8 and 24-bit images are resized with our bicubic interpolation algorithm. If you experience diminished quality when resizing, try calling CIMG_create_thumbnail to look at neighboring pixels when resizing for better quality. Use CIMG_create_thumbnail to preserve aspect ratio when converting to a thumbnail. This will create a gray scale aliased bitmap that must be saved with TIFF_LZW or TIFF_JPEG. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Thumbnail sample. Syntax int SNBDAPI CIMG_create_thumbnail(int width, int height); Remark Table 28.5: CIMG_create_thumbnail Function Variables Variable Description width height New width of image in pixels New height of image in pixels 198 Chapter 28 - Image Processing Functions Returns Returns the status of the create thumbnail operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_deskew_bitmap() This function uses the angle returned from CIMG_get_deskew_angle to do the rotation. This allows angle detection to be separate from the actual rotation in case the angle is 0 and no rotation is needed. See CIMG_get_deskew_angle() for more information. Note: When a call is made to CIMG_deskew_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_deskew_bitmap(int angle); Remark Table 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, Snowbound Error Codes for a list of error codes. CIMG_despeckle_bitmap() This function is a noise removal algorithm. Note: When a call is made to CIMG_despeckle_bitmap, the internal Snowbound image object is stored in memory for viewing. The function needs to be saved to the library for the change to be permanent. Syntax int SNBDAPI CIMG_despeckle_bitmap(int value); 199 Chapter 28 - Image Processing Functions Remark Table 28.7: CIMG_despeckle_bitmap Function Variable Variable Description value Quality factor 1 - 100 1 = Remove only single pixels 100 = Removes large black areas Returns Returns the status of the despeckle bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_dib_to_ddb() This function returns a DDB or old-style Windows bitmap (HBITMAP or Device Dependent Bitmap). The original image is not altered. Syntax DDB SNBDAPI CIMG_dib_to_ddb(int width, int height); Remark Table 28.8: CIMG_dib_to_ddb Function Variables Variable Description width height Width of desired DDB Height of desired DDB Returns DDB or old-style Windows bitmap (HBITMAP or Device Dependent bitmap). Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 28.1 CIMG_dib_To_ddb C#:IntPtr HBmp = simage.CIMG_dib_to_ddb(panImage.Width, panImage.Height); 200 Chapter 28 - Image Processing Functions CIMG_dib_to_runs() This function converts the internal library image format from Windows DIB format to a Snowbound runs format. This only works for 1-bit bi-level images. Syntax int SNBDAPI CIMG_dib_to_runs(void); Returns Returns the status of the Snowbound runs format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_erase_rect() This function draws the specified color inside or outside the rectangle passed in. It is used for black border erasing or to permanently fill a solid color inside an image. Syntax int SNBDAPI CIMG_erase_rect(int x, int y, int width, int height, int color, int in_outflag); Remark Table 28.9: CIMG_erase_rect Function Variables Variable Description x y width height color X start of rectangle in pixels Y start of rectangle in pixels width of the rectangle in pixels height of the rectangle in pixels Color to draw 1 = Draw inside rectangle 0 = Draw outside rectangle in_outflag Returns Returns the status of the erase rectangle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_flip_bitmapx() This function swaps horizontal pixels to produce a mirror image of the original image. It permanently changes the image in memory. 201 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, Snowbound Error Codes for a list of error codes. CIMG_flip_bitmapy() This function swaps vertical pixels to produce a mirror image of the original image. It permanently changes the image in memory. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Web Image Viewer Component sample. Syntax int SNBDAPI CIMG_flip_bitmapy(void); Returns Returns the status of the flip bitmapy operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_get_deskew_angle() This function detects the skew angle for 1-bit images by checking all angles starting at the start angle and continuing in one degree increments until the stop angle is reached. The example below uses -20 and 20 for starting and stopping angles. Your application may want to check for only positive or negative angles. Syntax int SNBDAPI CIMG_get_deskew_angle(int *angle, int start_degree, int end_degree); Remark Table 28.10: CIMG_get_deskew_angle Function Variables 202 Chapter 28 - Image Processing Functions Variable Description angle start_degree end_degree Pointer to integer to receive deskew angle Starting angle for which to check Ending angle for which to check Returns Returns the status of the get deskew angle operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_get_profile() This function gets an input profile from an image file. ICC profiles may be embedded in the image. In order to make an exact match, color profiles are created so that the identical color values can be printed or displayed. Supported file formats include: TIFF, JPEG, PICT, PDF, GIF and PNG. These formats can contain an embedded color profile. Syntax char * SNBDAPI CIMG_get_profile(String *strFile, String **strBuffer, int page, Int32 *ptrLength); Remarks Table 28.11: CIMG_get_profile Function Variables Variable Description strFile strBuffer page ptrLength File name for the image to be read in from the profile. String buffer of the profile. Page number to be read in from the profile. Length of the buffer. Returns Returns the character buffer. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_histogram_equalize() This function is a histogram equalization which improves the dynamic range of 8 or 16-bit gray scale images by remapping pixels based on a probability algorithm. Syntax int SNBDAPI CIMG_histogram_equalize(void); 203 Chapter 28 - Image Processing Functions Returns Returns the status of the histogram equalize operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_invert_bitmap() This function changes each bit in the image from 0 to 1 or from 1 to 0. This works well for inverting documents which have a black background. This permanently changes the image in memory. Syntax int SNBDAPI CIMG_invert_bitmap(void); Returns Returns the status of the invert bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_merge_annotation() This function merges a current annotation to an image object. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the WPFAnnotation_CSHARP sample. Syntax int SNBDAPI CIMG_merge_annotation(int iWidth, int iHeight); Remark Table 28.12: CIMG_merge_annotation Function Variables Variable Description iWidth iHeight Image width. Image height. Returns Returns the status of the merge annotations operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 204 Chapter 28 - Image Processing Functions CIMG_merge_bitmap() This function permanently merges an image from disk with the image in memory using the boolean function specified by raster_operation. This opcode allows ANDing and ORing over the current image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMG_merge_bitmap(String *filename, int raster_ operation, int x, int y); Remark Table 28.13: CIMG_merge_bitmap Function Variables Variable filename Description Path/filename of disk image to merge onto the image in memory specified by the filename. ROP opcode obtained from the list below or the Windows SDK manual. 0 or SRCCOPY = Copies the source bitmap to the destination bitmap. 1 or SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. 2 or SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator. raster_operation 3 or SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator. 4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. 5 or NOTSRCCOPY = Copies the inverted source bitmap to the destination. 6 or NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. 7 or MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. Note: These codes will not work in Unix. The valid Unix 205 Chapter 28 - Image Processing Functions Variable Description OP Codes are: GXclear CXand GXandReverse GXcopy GXandInverted GXnoop GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand 8 or MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. 9 or PATCOPY = Copies the pattern to the destination bitmap. 10 or PATPAINT = - Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. 11 or PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator. 12 or DSTINVERT = Inverts the destination bitmap. 13 or BLACKNESS = Turns all output black. x y 14 or WHITENESS = Turns all output white. Pointer to integer to receive the starting x coordinate. Pointer to integer to receive the starting y coordinate. Returns Returns the status of the merge bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_merge_bitmap() This function permanently merges an image from disk with the image in memory using the boolean function specified by raster_operation. This opcode allows ANDing and ORing 206 Chapter 28 - Image Processing Functions over the current image. 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 src Description Merges the source Snowbnd object image into the calling Snowbnd object at x and y with the specified raster operation ROP opcode obtained from the list below or the Windows SDK manual. 0 or SRCCOPY = Copies the source bitmap to the destination bitmap. 1 or SRCPAINT = Combines pixels of the destination and source bitmaps using the Boolean OR operator. 2 or SRCAND = Combines pixels of the destination and source bitmaps using the Boolean AND operator. 3 or SRCINVERT = Combines pixels of the destination and source bitmaps using the Boolean XOR operator. raster_operation 4 or SRCERASE = Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. 5 or NOTSRCCOPY = Copies the inverted source bitmap to the destination. 6 or NOTSRCERASE = Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. 7 or MERGECOPY = Combines the pattern and the source bitmap using the Boolean AND operator. Note: These codes will not work in Unix. The valid Unix OP Codes are: GXclear CXand GXandReverse GXcopy GXandInverted 207 Chapter 28 - Image Processing Functions Variable Description GXnoop GXxor GXor GXequiv GXinvert GXorReverse GXcopyInverted GXorInverted GXand 8 or MERGEPAINT = Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. 9 or PATCOPY = Copies the pattern to the destination bitmap. 10 or PATPAINT = - Combines the inverted source bitmap with the pattern using the Boolean XOR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. 11 or PATINVERT = Combines the destination bitmap with the pattern using the Boolean XOR operator. 12 or DSTINVERT = Inverts the destination bitmap. 13 or BLACKNESS = Turns all output black. x y 14 or WHITENESS = Turns all output white. Pointer to integer to receive the starting x coordinate. Pointer to integer to receive the starting y coordinate. Returns Returns the status of the merge bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_merge_bitmap_alpha() This function merges a 32-bit alpha channel image onto a normal 24-bit DIB using the transparency channel. Syntax int SNBDAPI CIMG_merge_bitmap_alpha(Snowbnd *src, CDIB_HEADER, *dib_header, int xpos, int ypos, int opaque); 208 Chapter 28 - Image Processing Functions Remark Table 28.15: CIMG_merge_bitmap_alpha Function Variables Variable src dib_header xpos ypos opaque Description Standard for snowbnd object 32-bit alpha channel image to merge Pointer to a CDIB_HEADER structure contains the image header. For more information, see public class CDIB_ HEADER. Starting x coordinate for which to merge image Starting y coordinate for which to merge image 1 = use transparency channel information to blend images 0 = do not draw any pixels with transparency channel information pixels set Returns Returns the status of the merge bitmap alpha channel image operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_process_bitmap() This function is used to perform the image processing function. A simple 3 x 3 matrix is applied to the image for 8 and 24-bit images. If the value for the matrix pointer is not NULL, it assumes that it contains values to be applied to the image. This function is a Sobel image processing function. It can be used as a relatively inexpensive edge detection function or to enhance the image. The method parameter allows you to specify which method to use to enhance the image. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Image Processing sample. Syntax int SNBDAPI CIMG_process_bitmap(int type, Array* matrix); Remark Table 28.16: CIMG_process_bitmap Function Variables Variable Description Specify the type of filter to be performed type 209 0 = User defined 3 * 3 matrix Chapter 28 - Image Processing Functions Variable matrix Description 1 = Isolate points 2 = Edge detection 3 = Horizontal edge detection 4 = Vertical edge detection 5 = 45 degree edge detection 6 = -45 degree edge detection 7 = Laplacian 8 = Dialation 9 = Roberts Cross Array that contains the operator value to apply to the image if it is not NULL, otherwise it returns the operator array. Returns Returns the status of the process bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_remove_red_eye() This function detects and converts very red eyes in photos to more natural colors. Notes: If xpos, ypos, xsize, or ysize is set to -1, the entire photo is searched. For best results, refine the search area. Works only with 24-bit color images. Syntax int SNBDAPI CIMG_remove_red_eye(int x, int y, int width, int height); Remarks Table 28.17: CIMG_remove_red_eye Function Variables Variable Description x y width height Starting top left area for x coordinate Starting top left area for y coordinate Width of area to search Height of area to search 210 Chapter 28 - Image Processing Functions Returns Returns the remove red eye operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_resize_bitmap() This function scales the image up or down to the new height and width. This permanently changes the height and width of the image. To zoom larger, use CIMG_resize_bitmap(). To zoom to a smaller size, use CIMG_ create_thumbnail(). To preserve aspect ratio: hres is the destination width. vres the destination height. Set the width and height to the original width and height of the image after decompress as shown in the following example: Example 28.2 Preserving Aspect Ratio vres = (int)((long)height * hres / width); CIMG_resize_bitmap(hres,vres); Note: IBM AFP printers require the width of an image to be an exact multiple of 8. To be on the safe side, set the width to a multiple of 8. Syntax int SNBDAPI CIMG_resize_bitmap(int width, int height); Remark Table 28.18: CIMG_resize_bitmap Function Variables Variable Description width height New width of image New height of image Returns Returns the resize bitmap operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 211 Chapter 28 - Image Processing Functions CIMG_resize_bitmap_bicubic() This function uses a bicubic interpolation algorithm to scale down images. This is good for creating high-resolution thumbnails of color images. If this function returns an error such as PIXEL_DEPTH_UNSUPPORTED or PALETTE_ IMAGES_NOT_ALLOWED, then try using CIMG_create_thumbnail() function because that will take a wider variety of input bit-depths than CIMG_resize_bitmap_bicubic function. Syntax int SNBDAPI CIMG_resize_bitmap_bicubic(int width, int height); Remark Table 28.19: CIMG_resize_bitmap_bicubic Function Variables Variable Description width height Width of image in pixels Height of image in pixels Returns Returns the resize bitmap bicubic interpolation algorithm operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_resize_bitmap_interp() This function scales the image up or down to the new height and width. The interp averages neighboring pixels for scaling down all image types. This permanently changes the height and width of the image. Syntax int SNBDAPI CIMG_resize_bitmap_interp(int width, int height); Remark Table 28.20: CIMG_resize_bitmap_interp Function Variables Variable Description width height New width of image New height of image 212 Chapter 28 - Image Processing Functions Returns Returns a FORMAT_NOT_ALLOWED error message for images with a bit-depth of 4. Returns a PALETTE_IMAGES_NOT_ALLOWED error message for color 8-bit images. May return a OUT_OF_MEMORY error message. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_rotate_bitmap() This function permanently rotates the image buffer in memory by the specified angle. The value is in hundredths of degrees. For example, for 90 degrees use 9000. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Alpha l ASP Image View Note: It is expected behavior that the image is smaller in each rotation using IMG_rotate_ bitmap. If an image is rotated by 90 degrees, RasterMaster .NET flips from portrait to landscape (or vice-versa) and preserves the page content. If the image is rotated by something other than 90 degrees, RasterMaster .NET shrinks the page so that all the content is preserved. RasterMaster .NET does not crop the edges during the rotation. Syntax int SNBDAPI CIMG_rotate_bitmap(int angle); Remark Table 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, Snowbound Error Codes for a list of error codes. 213 Chapter 28 - Image Processing Functions CIMG_runs_to_dib() The RasterMaster .NET library stores all 1-bit images as a series of runs. A call to this function forces the image to be stored as raw uncompressed data. This function only works for 1-bit images. Syntax int SNBDAPI CIMG_runs_to_dib(void); Returns Returns the stored raw uncompressed data operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_set_display_angle() This function rotates the angle of the image at display time when calling CIMG_display_ bitmap_aspect(). The original image data is not affected. See CIMG_display_bitmap_ aspect() for more information. To save the image as rotated, use CIMG_rotate_bitmap(). The image is permanently rotated in memory. See CIMG_rotate_bitmap() for more information. Use this function on all image types for fast rotation. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Alpha sample. Syntax int SNBDAPI CIMG_set_display_angle(int rotate_angle); Remark Table 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, Snowbound Error Codes for a list of error codes. 214 Chapter 28 - Image Processing Functions CIMG_sharpen_bitmap() This function sharpens or blurs the image. Positive values sharpen the image using a Laplacian function while negative values blur the image using an image-averaging filter. Syntax int SNBDAPI CIMG_sharpen_bitmap(int sharpness); Remark Table 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, Snowbound Error Codes for a list of error codes. CIMGLOW_get_palette() This function returns the palette entries of the specified image into an array of RGBQUAD structures. l 1-bit images = 2 entries l 4-bit images = 16 entries l 8/24-bit images = 256 entries 24-bit images have no palettes but the autocolor or rainbow palette is returned. Syntax int SNBDAPI CIMGLOW_get_palette(Array *arrRGBQuad); Remark Table 28.24: CIMGLOW_get_palette Function Variables Variable Description arrRGBQuad Array of RGBQUAD structures 215 Chapter 28 - Image Processing Functions Returns Returns the get palette operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_get_raster() This function gets a line of raw data from the line number specified by ypos. Syntax int SNBDAPI CIMGLOW_get_raster(Array *data, int ypos, int bytes); Remark Table 28.25: CIMGLOW_get_raster Function Variables Variable Description data ypos Buffer to receive a line of raw raster data. Line number of raster to get. Returns no more than this number of bytes. If set to -1, it calculates the number of bytes in one line and returns that amount. bytes Returns Returns no more than the number of bytes specified. If set to -1, the number of bytes in one line are calculated and returned. CIMGLOW_put_palette() This function sets the palette entries of the specified image from an array of RGBQUAD structures. l 1-bit images = 2 entries l 4-bit images = 16 entries l 8/24-bit images = 256 entries Syntax int SNBDAPI CIMGLOW_put_palette(IMG_RGBQUAD *input_prgb); Remark Table 28.26: CIMGLOW_put_palette Function Variables 216 Chapter 28 - Image Processing Functions Variable Description input_prgb Pointer to array of RGBQUAD structures Returns Returns the put palette operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_put_raster() This function puts a line of raw data into the DIB specified by data at the ypos line number. Syntax int SNBDAPI CIMGLOW_put_raster(Array *data, int ypos, int bytes); Remark Table 28.27: CIMGLOW_put_raster Function Variables Variable Description data ypos bytes Buffer of raw to data to put into DIB Line number in which to put data Replaces no more than this number of bytes Returns Returns the put raster operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_set_fast_convert() This function greatly improves performance for decompression and conversion. Pages must be decompressed sequentially. This function can be used with any of the decompression functions, either from File I/O based or memory. To turn this function on, set the off_on value to 1. To reset this function, set the off_on value to 0. This function makes the decompression functions non-reentrant or no longer thread safe when turned on. Note: This function currently only works with MO:DCA or AFP images. Syntax int SNBDAPI CIMGLOW_set_fast_convert(int off_on, int format); 217 Chapter 28 - Image Processing Functions Remark Table 28.28: CIMGLOW_set_fast_convert Function Variables Variable off_on format Description 0 = Off 1 = On Sets the format Returns Returns the set fast conversion operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 218 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. Document Conversion and Text Extraction The document conversion DLL extracts and converts vector or document file formats such as AFP/MO:DCA, PCL, and MS Word to vector PDF format. The PDF file will be in a true vector format, meaning that it will not be in a bitmap format. The PDF file will retain the original text and graphics commands. Font information such as the font typeface, font height, and bold/Italic attributes will remain the same. This allows the output PDF file to be created as text searchable. The PDF file created can be searched for words or phrases with the use of a text searching application. Currently, only AFP/MO:DCA, MS Word, Excel and PCL formats are supported. Conversion and text extraction occur in the following two step process: 1. A call is made to extract the text, graphics, and bitmap data. The CIMGLOW_extract_ text() function extracts text, graphics, and position information from the file name passed in. The buffer returned is used as an argument in the call to write out the new PDF file. See CIMGLOW_extract_text() for more information. 2. The CIMG_save_document() function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_bitmap() functions only create a bitmap file. This only supports the PDF file as an output file. See CIMG_save_document() for more information. CIMGLOW_extract_text() This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files. It returns the buffer of extracted text in ASCII format. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the following samples: l Convert_Doc l Text Search 219 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 *arrBuffer *ptrLength page Name of file from which to extract text Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text Returns Returns the buffer of extracted text in ASCII format. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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 %%SOI %%EOI Table 29.2: Extracted Text Variable Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters. 220 Chapter 29 - Document Conversion and Text Extraction Functions Variable Description %%SOF %%EOF Signals the start of the buffer Marks the end of extracted text Specified once at the beginning of the file to indicate the page number Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate page height in pixels Name of font Font height in pixels Font to be drawn plain or in bold 1 = bold 0 = plain Font to be drawn in normal or italic 1 = italic 0 = normal X pos in pixels Y pos in pixels Start of text block End of text block Start of image End of image Start of Text Unicode/UTF. End of Text Unicode/UTF. Page Width Height Font Name FontHeight FontBold FontItalic Xpos Ypos %%SOT %%EOT %%SOI %%EOI %%SOTU %%EOTU CIMGLOW_extract_text_mem() This function extracts text from memory. It returns the buffer of extracted text in ASCII format. Syntax int SNBDAPI CIMGLOW_extract_text_mem(Array *arrImage, Byte *arrBuffer, int *ptrLength, int page); Remarks Table 29.3: CIMGLOW_extract_text_mem Function Variables Variable Description *arrImage *arrBuffer Memory array to image data Buffer from which to receive extracted text Pointer to an integer to return the length of the extracted buffer Page number of file from which to extract text *ptrLength page Table 29.4: Extracted Text Variable 221 Chapter 29 - Document Conversion and Text Extraction Functions Variable Description Ypos Xpos Y pos in pixels X pos in pixels Specified once at the beginning of the file to indicate page width in pixels Specified once at the beginning of the file to indicate the page number Specified once at the beginning of the file to indicate page height in pixels Font to be drawn in normal or italic 1 = italic 0 = normal Font height in pixels Font to be drawn plain or in bold 1 = bold 0 = plain Name of font Start of text block Signals the start of the buffer End of text block Marks the end of extracted text Width Page Height FontItalic FontHeight FontBold Font Name %%SOT %%SOF %%EOT %%EOF Returns Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_save_document() This function takes a buffer passed in with text, graphics, and position information to create the document file output. The output file contains searchable text. Normally, the CIMG_save_ bitmap() function only creates a bitmap file. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Convert_Doc sample. Syntax int SNBDAPI CIMG_save_document(String *strName, char *buff, int filetype); 222 Chapter 29 - Document Conversion and Text Extraction Functions Remarks Table 29.5: CIMG_save_document Function Variables Variable Description *strName buff filetype Name of the output PDF file Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59 Returns Returns the document file output. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 29.2 Data Format for Extracted Text Buffer for both Windows and Java The coordinates system is originated at the upper left. X - Represents a floating point argument. As in 12.012, all of these arguments are in points of 1/72 of an inch. Text - Represents an ASCII string argument. STREAM COMMANDS and format of extracted file %%SOF- Start of file /PageNumber=XPage number being extracted. /PageWidth=XWidth of page in points. (1/72 of an inch) /PageHeight=XHeight of page in points. (1/72 of an inch) %%EOFMarks the end of this file. No more data to process. /FontStart of font data and attributes. /FontName=TextStandard font face name. /FontHeight=XFont height in points (1/72 of an inch). /FontBold=XSet to 1 for bold font otherwise 0. /FontItalic=XSet to 1 for Italic font otherwise 0. /Xpos=XX starting coordinate of text string. /Ypos=XY starting coordinate of text string. %%SOTStart of a text string after the carriage return. Text Data here %%EOTEnds a text string. /ImageStart of image data and attributes. /ImageWidth=XWidth in pixels of the image data. /ImageHeight=XHeight in pixels of the image data. /Bitsperpixel=XNumber of bits per pixel. /Compression=TextCompression type used. CCITT_G4, JPEG, or NONE. /Length=XLength of binary image data. %%SOIStarts the binary image data. Binary data here 223 Chapter 29 - Document Conversion and Text Extraction Functions %%EOIEnds the binary image data. /DrawImage Xs Ys Width HeightDraws the last defined image at the location specified by the arguments. /Moveto XS YSMoves current graphics drawing position. /LineXS YSDraws a line from current graphics drawing position to a location specified by the arguments. /Rectangle XS YS WIDTH HEIGHT Draws a rectangle at the specified coordinates. /Curve X1 Y1 X2 Y2 X3 Y3Draws a curve from the current graphics drawing position to the end coordinates using the first 4 arguments as guide points. CIMG_save_document_mem() This function takes a buffer passed in with text, graphics, and position information obtained from CIMGLOW_extract_text_mem() to save the document file output to memory. The output file contains searchable text. This currently only supports the PDF file as an output file. Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a PDF file already exists, a new page will be appended. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Convert_Doc sample. Syntax int SNBDAPI CIMG_save_document_mem(Array *imgArray, Array *buffArray, int filetype)); Remarks Table 29.6: CIMG_save_document_mem Function Variables Variable Description *imgArray buffArray filetype Memory array already allocated Buffer of extracted text, graphics, and bitmaps Currently only supports PDF - file type 59 224 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 RasterMaster .NET version 17.9.9 or later. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 225 Chapter 30 - Color Promotion Functions Chapter 30 - Color Promotion Functions This chapter describes the RasterMaster .NET color promotion functions. Generally adding more color depth to an image will use significantly more space and the larger image will take more time to process. However, there are circumstances when a black and white or grayscale image needs to be promoted to color, or a color space needs to be changed in order to make an image consistent with other pages in a document. AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use CIMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance. If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Formats for details on which formats support color information at different bitdepths. This chapter lists the functions from the functions that save images with less color (smaller size) to more color (largest output depth): CIMG_promote_8() CIMG_promote_24() CIMG_promote_32() This chapter also lists the following functions that change color spaces: CIMG_rgb_to_cmyk() CIMG_cmyk_to_rgb() CIMG_color_combine() CIMG_color_separate() CIMGLOW_get_tiff_tag() CIMG_promote_8() This function permanently converts a 1 or 4-bit image to an 8-bit image in the current DIB. Syntax int SNBDAPI CIMG_promote_8(void); 226 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, Snowbound Error Codes for a list of error codes. CIMG_promote_24() This function permanently converts a 1, 4, or 8-bit image to a 24-bit image in the current DIB. You can find the samples for using this function in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET Evaluation\Net\Samples. This function is used in the Merge Image sample. Syntax int SNBDAPI CIMG_promote_24(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H - Error Codes for a list of error codes. CIMG_promote_32() This function converts a 1, 4, 8, or 24-bit image to a 32-bit alpha channel image. 32-bit alpha images contain 24 bits of red, green, and blue planes (8-bits each), and an extra (8-bits) alpha channel plane for transparency. Syntax int SNBDAPI CIMG_promote_32(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Changing Color Spaces Functions CIMG_rgb_to_cmyk() This function converts 24-bit RGB data to 32-bit CMYK data. RasterMaster .NET products support full 32-bit CMYK data as an internal 32-bit DIB format. The black plane is created. Syntax int SNBDAPI CIMG_rgb_to_cmyk(void); 227 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, Snowbound Error Codes for a list of error codes. CIMG_cmyk_to_rgb() This function converts the 32-bit CMYK data to 24-bit RGB data. RasterMaster .NET supports full 32-bit CMYK data as an internal 32-bit DIB format. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_cmyk_to_rgb(void); Returns Returns the status of the convert CMYK to RGB operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_color_combine() This function combines 3 or 4 planes into a new 24 or 32-bit image. If the 4th argument is a valid handle, a 32-bit CMYK image is created. If the 4th argument is not valid or -1, a 24-bit RGB image is created. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_color_combine(Snowbnd *dest, Snowbnd *blue_handle, Snowbnd *green_handle, Snowbnd *red_handle, Snowbnd *k_handle, int planes_num); Remark Table 30.1: CIMG_color_combine Function Variables 228 Chapter 30 - Color Promotion Functions Variable blue_handle green_handle red_handle k_handle planes_num Description Standard for 8-bit gray-scale image which represents the blue plane (cyan). Standard for 8-bit gray-scale image which represents the green plane (magenta). Standard for 8-bit gray-scale image which represents the red plane (yellow). Standard for 8-bit gray-scale image which represents the black plane (black). If negative, creates a 24-bit RGB image. Number of planes for resulting image. Returns Returns the status of the color combine operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_color_separate() This function gets an individual plane of color data and returns a new RasterMaster .NET handle. The new color plane is an 8-bit gray scale image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. Syntax int SNBDAPI CIMG_color_separate(Snowbnd *dest, int plane); Remark Table 30.2: CIMG_color_separate Function Variables Variable Description The plane can be one of the following: plane For 32 bitcmyk planes are: 0 = cyan 1 = magenta 2 = yellow 3 = black For 24-bit rgb planes are: 0 = blue 1 = green 2 = red 229 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, Snowbound Error Codes for a list of error codes. CIMGLOW_get_tiff_tag() CIMGLOW_get_tiff_tag() This function reads a TIFF tag from the file specified by bm_name. The tag may be either a string returned in buff or a long, int, or char returned in value. If the return value is 1, the value returned is a string. A return value of 0 indicates a non-string value. You can use the TIFF tag to get the colorspace type by specifying tag #262. Syntax int SNBDAPI CIMGLOW_get_tiff_tag(int tag, int max_bytes, int *ptr_ value, String *strFileName, String *strBuff); Remark Table 30.3: CIMGLOW_get_tiff_tag Function Variables Variable Description tag max_bytes ptr_value strFileName strBuff TIFF tag number to return Maximum bytes to read for string tags Pointer to tag value returned Filename to read tags from String buffer for returning string tags Returns Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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, 230 Chapter 30 - Color Promotion Functions st, data, page); /* PHOTOMETRIC INTERPRETATION */ #define TIFF_PHOTO_WHITE_IS0 0 #define TIFF_PHOTO_WHITE_IS1 1 #define TIFF_PHOTO_RGB 2 #define TIFF_PHOTO_PALETTE 3 #define TIFF_PHOTO_TRANSP 4 #define TIFF_PHOTO_CMYK 5 #define TIFF_PHOTO_YCC 6 #define TIFF_PHOTO_CIELAB 8 231 Chapter 31 - Color Reduction Functions Chapter 31 - Color Reduction Functions This chapter describes the RasterMaster .NET color reduction functions. The quality of the conversion is determined by the input and output dots per inch resolution and the output compression type. Use color reduction functions to create a lower image quality that is smaller in size and is speedier to process. If you go from a higher to a lower resolution or a lossy compression type, then the quality of the image will degrade. This chapter lists the functions that save images with more color (largest output depth) to less color (smaller size). CIMG_color_gray() This function permanently converts a 4, 8, or 24-bit image to an 8-bit gray scale image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_color_gray(void); Returns Returns the status of the grayscale image operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_resize_to_gray() This function resizes down a 1-bit image to an 8-bit grayscale image using the scale to gray anti-aliasing algorithm. This converts a 1-bit image to an 8-bit suitable image for saving as a JPEG file format. This function is excellent for creating small thumbnails for large documents or 1-bit images. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. 232 Chapter 31 - Color Reduction Functions Syntax int SNBDAPI CIMG_resize_to_gray(int width, int height); Remark Table 31.1: CIMG_resize_to_gray Function Variables Variable Description width height Destination width of image to resize Destination height of image to resize Returns Returns the status of the resize to gray operation. A value of 0 indicates success. Returns a PIXEL_DEPTH_UNSUPPORTED error message if the image has a bit depth of more than one if the image is not black and white. May return an OUT_OF_MEMORY error message. Returns an OUT_OF_MEMORY error if there is not enough memory to complete the operation. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_popularity_color() This function permanently converts a 24-bit image to an 8-bit per pixel image using the popularity algorithm. The popularity algorithm chooses 256 of the most populous colors from the image. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_popularity_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 233 Chapter 31 - Color Reduction Functions CIMG_mediancut_color() This function permanently converts a 24-bit image to an 8-bit per pixel image using a combination of the popularity algorithm and error diffusion. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_mediancut_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_octree_color() This function converts 4, 8, or 24-bit images into 4 or 8-bit as specified. It uses a complex octree function to reduce to the best palette and number of colors chosen, or reduces the image to the palette passed into input_prgb if the pointer is not NULL. This is by far the best color reduction algorithm in the library. Note: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_octree_color(int bits_per_pixel, IMG_RGBQUAD *input_prgb, int entries); Remark Table 31.2: CIMG_octree_color Function Variables Variable Description bits_per_pixel Pixel depth to convert to: 4 or 8 234 Chapter 31 - Color Reduction Functions Variable Description input_prgb Pointer to array of RGBQUAD structures Number of colors to reduce 1 - 16 for 4-bit images 1 - 256 for 8-bit images entries Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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 specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_bayer_color(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_bayer_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a Bayer fixed matrix dithering technique. Note: The quality of the conversion to black and white or grayscale can be enhanced by 235 Chapter 31 - Color Reduction Functions specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_bayer_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_diffusion_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel using the Stucky error diffusion technique. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. CIMG_decompress_bitmap must be called before CIMG_diffusion_mono. It is designed for use on rasterized pages. It cannot be used on pages with vector content created by CIMGLOW_extract_text. Syntax int SNBDAPI CIMG_diffusion_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_thresh_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a threshold passed as the second argument. Note: The quality of the conversion to black and white or grayscale can be enhanced by 236 Chapter 31 - Color Reduction Functions specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_thresh_mono(int threshhold); Remark Table 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, Snowbound Error Codes for a list of error codes. CIMG_halftone_mono() This function permanently converts a 4, 8, or 24-bit image to a 1-bit per pixel image using a fixed halftone matrix dithering technique. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int SNBDAPI CIMG_halftone_mono(void); Returns Returns the standard library image handle. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMGLOW_detect_color() 237 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 output document size by ensuring the black and white pages are saved as 1-bit per pixel (monochrome) rather than 24-bits per pixel (color). Use this function to detect the presence of grayscale or color pixels on the current page. If the bit depth returned by this method is less than the bit-depth returned by CIMG_bitmap_info() in biBitCount, then you should consider converting to a lower bit per pixel format. Snowbound Software recommends converting to CCITT_TIFF_G4 format for black and white text images. Notes: The quality of the conversion to black and white or grayscale can be enhanced by specifying the alias and alias quality. We highly recommend the JPEG compression format as the best compression available in our library for photo type images. Syntax int CIMGLOW_detect_color(int); Returns Returns the bits per pixel of the image. If this function returns 1, then this image contains only black and white pixels. If this function returns 8, then this image contains grayscale data such as black and white photo or shaded graphics. If this function returns 24, then this image contains at least some content that uses full color. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. Example 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); 238 Chapter 31 - Color Reduction Functions } CIMG_delete_bitmap(); 239 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. 240 Chapter 32 - ASCII Formats and Functions 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; String *asciiTypeFace; CASCIITEXTATTR(); void reset(); }; Remark Table 32.1: public class CASCIITEXTATTR Variables Variable Default int asciiFlags int asciiXDpi int asciiYDpi 0 Determines which fields to use 200 Horizontal dots per inch 200 Vertical dots per inch if (asciiMargin == 0) CIMG_RECT *asciiMargin int asciiTabStop 241 Description asciiMargin = new CIMG_RECT(); asciiMargin->left = 1000; Margins in 1/1000 inches asciiMargin->right = 1000; asciiMargin>top = 750; asciiMargin->bottom = 750; Number of characters between 8 tab stops Chapter 32 - ASCII Formats and Functions Variable Default Description int asciiPageWidth int asciiPageHeight int asciiPointSize int asciiCharsPerLIne int asciiLinesPerPage 8500 11000 -1 80 60 int asciiWeight 0 int asciiItalic 0 String *asciiTypeFace Courier New Width of page in 1/1000 inches Height of page in 1/1000 inches Point size of the font Number of characters per line Number of lines per page Normal=0 Bold=1 Normal=0 Italic=1 Name of the font to use Table 32.2: ASCIITEXTATTR Function Flags 1L << means shift a binary bit to the left by 1 position. Essentially this is 2 to the power of however many positions you shift. Add up the values of all of the flags you want to turn on, then you end up with a hex number. Flag Description ASCIIXDPI ASCIIYDPI ASCIIMARGIN ASCIITABSTOP ASCIIPAGEWIDTH ASCIIPAGEHEIGHT ASCIIPOINTSIZE ASCIICHARSPERLINE ASCIILINESPERPAGE ASCIIWEIGHT ASCIIITALIC ASCIITYPEFACE (1L<<0) = 1 (1L<<1) = 2 (1L<<2) = 4 (1L<<3) = 8 (1L<<4) = 16 (1L<<5) = 32 (1L<<6) = 64 (1L<<7) = 128 (1L<<8) = 256 (1L<<9) = 512 (1L<<10) = 1024 (1L<<11) = 2048 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 indicate which field to update: Example 32.2 attr.asciiFlags attr.asciiFlags = 0xa40; attr.asciiWeight = 1; attr.asciiPointSize = 48; attr.asciiTypeFace = "Arial"; attr.asciiXDpi = maxResolution; 242 Chapter 32 - ASCII Formats and Functions attr.asciiYDpi = maxResolution; status = simage.CIMGLOW_set_ascii_attributes(attr); Table 32.3: Standard Page Sizes ASCIIXSIZELETTER ASCIIYSIZELETTER 8500L 11000L /* 8 1/2" */ /* 11" */ ASCIIXSIZELEGAL ASCIIYSIZELEGAL 8500L 14000L /* 8 1/2" */ /* 14" */ ASCIIXSIZEEXECUTIVE ASCIIYSIZEEXECUTIVE 7250L 10500L /* 7 1/4" */ /* 10 1/2" */ ASCIIXSIZEENVELOPE ASCIIYSIZEENVELOPE 4125L 9500L /* 4 1/8" */ /* 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 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.3CIMGLOW_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); 243 Chapter 32 - ASCII Formats and Functions 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 page Path/filename of the ASCII file to convert Page number to start at 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 H, Snowbound Error Codes 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 244 Chapter 32 - ASCII Formats and Functions 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, Snowbound 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 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, Snowbound 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. Note: Please note that this method is not thread safe. Syntax int SNBDAP CIMGLOW_set_ascii_attributes(CASCIITEXTATTR *ascii); Remark Table 32.7: CIMGLOW_set_ascii_attributes Function Variable 245 Chapter 32 - ASCII Formats and Functions Variable Description ascii Pointer to CASCIITEXTATTR structure. For more information, 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, Snowbound Error Codes for a list of error codes. ** GLOBAL FUNCTION** 246 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 functions 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 consists 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 1bit 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 WORD WORD WORD 0 1 2 3 - 12 Total byte 5 White until 10 Black from 100 White to count. pixel 5. pixel 5 to pixel 10. end of raster. 247 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; 40. public int biWidth; public int biHeight; public short biPlanes; public short biBitCount; public int biCompression; public int biSizeImage; raster in bytes. public int biXPelsPerMeter; per inch. public int biYPelsPerMeter; per inch. public int biClrUsed; public int biClrImportant; } BITMAPINFOHEADER; Size of this structure, always Width of the image in pixels. Height of the image in pixels. Always 1. (as per Microsoft) Bits per pixel 1,4,8 or 24. 0 or 99 for 1 bit runs images. Height of the image X size of a Use this field to store dots Use this field to store dots Always set to 0. Always set to 0. Note: In RasterMaster .NET V17.6, the pelsPerMeter attribute queries return the actual value contained 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 .NET was returning the default value or the actual value that was set. Beginning with RasterMaster .NET 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. 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. 248 Chapter 33 - Format For Decompressed Images Table 33.1: MS_Windows DIB Palette Format Image Size RGBQUAD Entries 1-bit 4 bit 8 bit 24-bit 2 16 256 No Entries All images stored in memory have the following palette format: Example 33.3 RGBQUAD Entries public class { public byte public byte public byte public byte { RGBQUAD rgbBlue; rgbGreen; rgbRed; 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 4-bit 8- bit 8 pixels 2 pixels 1 pixel 3 bytes equals 1 pixel, starting with the blue, green, then red values 24-bit All rasters must end on a long or a multiple of 4 bytes. Extra bytes are added to rasters not meeting this criterion. They are stored with upside down or the last raster first up to the first or line 0. 249 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 .NET product or any other application or tool that displays images. You can use annotations to create watermarks or redactions. public class CANN_GRAPHIC_STRUCT Structure This structure represents an annotation object stored in its internal format within the RasterMaster .NET 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; 250 Chapter 34 - Annotation and Redlining Toolkit int line_style; String* create_date; String* create_user; } Variables Table 34.1: CANN_GRAPHIC_STRUCT Class Variables Variable Description CIMG_RECT rc String text Int data_size String font_name int italic int bold int font_height int fred int fblue int fgreen int bred int bblue int bgreen int width int height int bits_pix int transp int graphic_id int line_width int line_style String* create_date String* create_user Rectangle Byte array of text Size of data in bytes Name of font Indicates italicized font Indicates bold font Font height Red plane of foreground color Blue plane of foreground color Green plane of foreground Red plane of background color Blue plane of background color Green plane of background color Width of annotation object Height of annotation object Bits per pixel of image Indicates transparency Annotation object type Line width Line style The annotation object created date. The user name which created the annotation object. 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. 251 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_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. 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 freehand 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); 252 Chapter 34 - Annotation and Redlining Toolkit 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 graphics functions in the current images coordinates Data for text, freehand annotations, and edits The size in bytes for text, freehand, or edits imgRect data data_size 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 iColor The selected color returned in 3 bytes order, red, green, 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: 253 Chapter 34 - Annotation and Redlining Toolkit 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 annotations. 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 annotations. 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 254 Chapter 34 - Annotation and Redlining Toolkit 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. 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 width height Window form control object Width in pixels of image to annotate 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. 255 Chapter 34 - Annotation and Redlining Toolkit 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. 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_non_text_objects() This function remove no-text annotation objects. 256 Chapter 34 - Annotation and Redlining Toolkit Syntax int SNBDAPI CSANN_delete_non_text_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 graphic_num This is an internal number for each graphic returned by CSANN_get_object_num. It is the number in a linked list of graphics. Use this number after the call to CSANN_ get_object_number as CSANN_delete_object. This may change the number of existing graphics. CSANN_delete_text_objects() This function remove no-text annotation objects. Syntax int SNBDAPI CSANN_delete_text_objects(); 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: 257 Chapter 34 - Annotation and Redlining Toolkit 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 xs ys xz yz Graphics object Starting X position Starting Y position X size of window Y size of window CSANN_draw_object() This function draws the object (graphic_num) at the coordinates passed that are image coordinates. Syntax int SNBDAPI CSANN_draw_object(Graphics *g, int graphic_num, int xs, int ys, int xz, int yz); Remark Table 34.11: CSANN_draw_object Function Variables Variable Description g graphic_num xs ys xz yz Graphics object Specify the object to draw X position to start drawing Y position to start drawing X size to draw object Y size to draw object 258 Chapter 34 - Annotation and Redlining Toolkit 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 ys xsize ysize X starting coordinate to be returned Y starting coordinate to be returned X crop rectangle size to be returned 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); 259 Chapter 34 - Annotation and Redlining Toolkit Remark Table 34.13: CSANN_get_disprect Function Variables Variable Description xs ys xe ye Pointer of the left coordinate of display rectangle Pointer of the top coordinate of display rectangle Pointer of the right coordinate of display rectangle 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 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_get_object_bounds(int graphic_num, CIMG_RECT *objRect); Remark Table 34.14: CSANN_get_object_bounds Function Variables Variable Description graphic_num objRect Specify the object to return the bounding box Rectangle of bounding box 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 *datastring); Remark Table 34.15: CSANN_get_object_dataFunction Variables 260 Chapter 34 - Annotation and Redlining Toolkit Variable Description graphic_num datastring Specify the object from which to return data 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 cannGraphic Specify the object for which to return a structure pointer 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_ 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_num Function Variables 261 Chapter 34 - Annotation and Redlining Toolkit Variable Description win_control xpos ypos iGID Window form control object X coordinate in the windows coordinates Y coordinate in the windows coordinates 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 graphic_num Window form control object Graphic to highlight CSANN_map_image_to_wnd() This function converts the internal graphics coordinates relative to the image coordinates relative to the current window. 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 xs ys Displays current rectangle Set the X coordinate to convert Set the Y coordinate to convert 262 Chapter 34 - Annotation and Redlining Toolkit 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 xpos ypos Displays current rectangle Set the X coordinate to convert 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 messaging 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. 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 263 Chapter 34 - Annotation and Redlining Toolkit Variable Description win_control g msg wParam lParam graphic_id Window form control object Graphics object Window handling function message parameter Window handling function wParam parameter Window handling function lParam parameter Current graphic id to add Extra data to add to EDIT or POSTIT objects or name of bitmap to import strBuffer 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: Table 34-22: CSANN_move_object Function Variables Variable Description objRect graphic_num Rectangle for new object position and size Specify the object to move 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); 264 Chapter 34 - Annotation and Redlining Toolkit Remarks Table 34.23: CSANN_print_annotations Function Variables Variable Description g xs ys xz yz Graphics object Starting X position Starting Y position X size of window 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.24: CSANN_read_ann Function Variables Variable Description win_control filename Window form control object 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); 265 Chapter 34 - Annotation and Redlining Toolkit Remark Table 34.25: CSANN_read_ann_FlexSnap Function Variables Variable Description data strServer strFileName Memory pointer to return annotation data FlexSnap server URL address 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.26: CSANN_read_ann_mem Function Variables Variable Description win_control data Window form control object 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); Remark Table 34.27: CSANN_read_ann_mem_page Function Variables Variable Description win_control data page Window form control object Memory pointer to compress image data Desired page number starting at zero 266 Chapter 34 - Annotation and Redlining Toolkit 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 *filename, int page); Remark Table 34.28: CSANN_read_ann_page Function Variables Variable Description win_control filename page Window form control object Refers to the name of the file in which to read 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.29: CSANN_resize_object Function Variables Variable Description objRect graphic_num Rectangle for new object position to resize 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. 267 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. Syntax int SNBDAPI CSANN_rotate(int angle); Remark Table 34.30: 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.31: CSANN_set_bcolor Function Variables Variable Description iRed iGreen iBlue Red value 0 - 255 Green value 0 - 255 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. 268 Chapter 34 - Annotation and Redlining Toolkit Syntax int SNBDAPI CSANN_set_croprect(int xs, int ys, int xsize, int ysize); Remarks Table 34.32: CSANN_set_croprect Function Variables Variable Description xs ys xsize ysize Set the X starting coordinate Set the Y starting coordinate Set the X crop rectangle size 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 display area. Syntax int SNBDAPI CSANN_set_disprect(int xs, int ys, int xe, int ye); Remarks Table 34.33: CSANN_set_disprect Function Variables Variable Description xs ys xe ye Left coordinate of display rectangle Top coordinate of display rectangle Right coordinate of display rectangle Bottom coordinate of display rectangle CSANN_set_fcolor() This function sets the current foreground drawing color for all graphics. 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: 269 l Annaction l Annotation Chapter 34 - Annotation and Redlining Toolkit Syntax int SNBDAPI CSANN_set_fcolor(int iRed, int iGreen, int iBlue); Remark Table 34.34: CSANN_set_fcolor Function Variables Variable Description iRed iGreen iBlue Red value 0 - 255 Green value 0 - 255 Blue value 0 - 255 CSANN_set_font() This function sets the current type of font to use. It uses the values returned from the CHOOSEFONT common dialog box LOGFONT data structure. Syntax int SNBDAPI CSANN_set_font(String *fontname, int italic, int bold, int font_height); Remark Table 34.35: CSANN_set_font Function Variables Variable Description fontname italic bold font_height Name of font to use Use an italic font Use a bold font Size of the font to use CSANN_set_line_style() CSANN_set_line_style() This function sets current line style 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 270 Chapter 34 - Annotation and Redlining Toolkit Syntax int SNBDAPI CSANN_set_line_style(int style); Remark Table 34.36: CSANN_set_line_style Function Variables Variable Description Line drawing style. Currently, the RasterNote® Snowbound Annotation Toolkit supports the following line styles: PS_DASH 1 PS_DASHDOT 3 PS_DASHDOTDOT 4 PS_DOT 2 PS_SOLID 0 style 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.37: CSANN_set_line_width Function Variables 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 format for Snowbound annotations contains this information. 271 Chapter 34 - Annotation and Redlining Toolkit 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.38: CSANN_set_size Function Variables Variable Description width height Width of current image being annotated 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 l WPFAnnotation_CSHARP Syntax int SNBDAPI CSANN_write_ann(String *filename, int extra_size, Array *extra_data); Remark Table 34.39: CSANN_write_ann Function Variables Variable Description filename extra_size extra_data Pathname or file to write Size of extra data to write after the first header Pointer to extra data to write 272 Chapter 34 - Annotation and Redlining Toolkit 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 iAnnDataLen, String *strServer, String *strFileName); Remark Table 34.40: CSANN_write_ann_FlexSnap Function Variables Variable Description strAnnData iAnnDataLen strServer strFileName Memory pointer to annotation data Size of annotation data FlexSnap server URL address 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.41: CSANN_write_ann_mem Function Variables Variable Description Array *data extra_data extra_size Pathname or file to write Pointer to extra data to write Size of extra data to write after the first header 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 273 Chapter 34 - Annotation and Redlining Toolkit 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.42: CSANN_write_ann_mem_page Function Variables Variable Description data extra_size extra_data page Memory pointer to annotation data Size of extra data to write after the first header Pointer to extra data to write 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.43: CSANN_write_ann_page Function Variables Variable Description filename extra_size extra_data page Pathname or file to write Size of extra data to write after the first header Pointer to extra data to write Page number starting at zero Annotation Constants Table 34.44: Annotation Constants The annotation and redlining toolkit also comes with pre-determined annotation constants. They are as follows: 274 Chapter 34 - Annotation and Redlining Toolkit Annotation Constant CSANN_FILLED_RECT CSANN_HIGHLIGHTED_RECT CSANN_RECTANGLE CSANN_LINE CSANN_ELLIPSE CSANN_FILLED_ELLIPSE CSANN_FREEHAND CSANN_BITMAP CSANN_POSTIT CSANN_POLYGON CSANN_FILLED_POLYGON CSANN_ARROW CSANN_EDIT 1 2 3 4 5 6 7 8 9 10 11 12 13 275 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 WPF and Microsoft .NET Framework 4.0 supported functions. 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 .NET’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 .NET images in an Image control. l 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. The Samples directory in RasterMaster .NET has a WPF subdirectory that includes the following 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 276 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 width height Description Image width of the created object. 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, Snowbound 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 width height dpi 277 Description Image width of the created object. Image height of the created object. DPI of the created object. 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, Snowbound 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 width height Description Image width of the created object. 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, Snowbound 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 visual iShowUI Description WPF rendering class System::Windows::Media::Visual object. On/Off display of the Twain UI Dialog box. 278 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, Snowbound 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 visual iShowUI Description WPF rendering class System::Windows::Media::Visual object. On/Off display of the Twain UI Dialog box. 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, Snowbound 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 (System::Windows::Media::Visual *visual, int iShowUI, int iDuplex); 279 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Remark Table 35.6: CIMG_scan_acquire_feeder_fast_WPF Function Variables Variable visual iShowUI Description WPF rendering class System::Windows::Media::Visual object. On/Off display of the Twain UI Dialog box. 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, Snowbound 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 (System::Windows::Media::Visual *visual); Remark Table 35.7: CIMG_scan_open_source_WPF Function Variable Variable visual Description System::Windows::Media::Visual class for WPF rendering. 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, Snowbound 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. 280 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 iDuplex); Remark Table 35.8: CIMG_scan_pages_fast_WPF Function Variable Variable visual strFileName iFileType iShowUI Description WPF rendering support System::Windows::Media::Visual class. The output file name to create as a scanned image. Saves the file type. See Appendix B, Supported File Formats for file type formats in which to save compressed images. On/Off display of the Twain UI Dialog box. 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, Snowbound 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 *visual, String *strFileName, int iFileType, int iShowUI); Remark Table 35.9: CIMG_scan_pages_WPF Function Variables Variable visual 281 Description WPF rendering support System::Windows::Media::Visual Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Variable strFileName iFileType iShowUI Description class. The output file name to create as a scanned image. Saves the file type.See Appendix B, Supported File Format for file type formats in which to save compressed images. On/Off display of the Twain UI Dialog box. 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, Snowbound 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 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. 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 visual cap Description WPF rendering support System::Windows::Media::Visual class. 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, Snowbound 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. 282 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support 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 WPFScanning_CSHARP sample. 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 visual cap value Description WPF rendering support System::Windows::Media::Visual class. The current TWAIN capability to set. 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 scanning 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 *visual); Remark CIMG_scan_setup_WPF Function Variable Variable visual 283 Description WPF rendering support System::Windows::Media::Visual class. 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, Snowbound Error Codes for a list of error codes. 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 *visual, int width, int height); Remark Table 35.12: CSANN_create_ann_WPF Function Variables Variable visual width height Description WPF rendering support System::Windows::Media::Visual class. Width in pixels of image to annotate 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, Snowbound 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 visual Description WPF rendering support System::Windows::Media::Visual 284 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Variable xpos ypos iGID Description class. X coordinate in the windows coordinates. Y coordinate in the windows coordinates. The Graphic ID returned Returns Returns the graphic id. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. 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 (System::Windows::Media::Visual *visual, int graphic_num); Remark Table 35.14: CSANN_highlight_object_WPF Function Variables Variable visual graphic_num Description WPF rendering support System::Windows::Media::Visual class. 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, Snowbound 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 following samples: 285 l WPFAnnotation_CSHARP l WPFScanning_CSHARP Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Syntax int SNBDAPI CSANN_read_ann_WPF(System::Windows::Media::Visual *visual, String *filename); Remark Table 35.15: CSANN_read_ann_WPF Function Variables Variable visual filename Description WPF rendering support System::Windows::Media::Visual class. Refers to the name of the file in which to read. 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, Snowbound 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 visual filename page Description WPF rendering support System::Windows::Media::Visual class. Refers to the name of the file in which to read. 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, Snowbound 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. 286 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Syntax int SNBDAPI CSANN_read_ann_mem_page_WPF (System::Windows::Media::Visual *visual, Array *data, int page); Remark Table 35.17: CSANN_read_ann_mem_page_WPF Function Variables Variable visual data page Description WPF rendering support System::Windows::Media::Visual class. Memory pointer to compress image data. 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, Snowbound 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 visual data Description WPF rendering support System::Windows::Media::Visual class. 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, Snowbound 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. 287 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions Syntax int SNBDAPI CIMG_get_pages_xps(String *strDocName); Remark Table 35.19: CIMG_get_pages_xps Function Variable Variable strDocName Description The path/filename of the image to return page information. 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, Snowbound 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: l Batch_XPS_Convert l VectorConvertMem_CSHARP l XPSMem_CSHARP Syntax int SNBDAPI CIMG_get_pages_xps_mem(Array* data); Remark Table 35.20: CIMG_get_pages_xps_mem Function Variable Variable data Description 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, Snowbound Error Codes for a list of error codes. 288 Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions 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 strDocName iPage Description The path/filename of the XPS file. The page index of the XPS document to render. Returns Returns the status of the decompress bitmap XPS operation. A value of 0 indicates success. Any value less than zero is a Snowbound error code. See Appendix H, Snowbound Error Codes for a list of error codes. CIMG_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: l Batch_XPS_Convert l VectorConvertMem_CSHARP l 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 data iPage 289 Description Pointer to image in memory. The page index of the XPS document to render. starting from 0. Chapter 35 - WPF and Microsoft .NET Framework 4.0 Support Functions 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, Snowbound Error Codes for a list of error codes. 290 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 .NET. 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 .NET. 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 bitmap formats that are a 2-dimensional array of bytes forming a picture. Normally, documents are drawn or “rendered” to a bitmap in RasterMaster .NET, but RasterMaster .NET can also produce searchable 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 dpi bits_pix Description Sets the document in dots per inch. Sets the bits per pixel. 1 = black and white documents 24 = color images 291 Chapter 36 - Working with PDF and Other Document File Formats Variable Description Sets the format parameter. format 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 bitmap 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 height Width of image in points 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 ActiveX, .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. 292 Chapter 36 - Working with PDF and Other Document File Formats 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,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 CIMGLOW_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 document formats. Save to PDF using CIMG_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 document. 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 searchable 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 Imaging 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. 293 Chapter 36 - Working with PDF and Other Document File Formats 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 document formats. 294 Appendix A - Classes and Support Values Appendix A - Classes and Support Values This appendix describes the classes and support values for RasterMaster .NET. 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 ZOOM_ASPECT.ASPECT_DEFAULT = 0 ZOOM_ASPECT.ASPECT_PRESERVE = 1 ZOOM_ASPECT.ASPECT_FIT_TO_WIDTH = 2 ZOOM_ASPECT.ASPECT_FIT_TO_HEIGHT = 3 ZOOM_ASPECT.ASPECT_ONE_TO_ONE = 4 ZOOM_ASPECT.ASPECT_ZOOM = 5 Description Zoom value will preserve aspect and every unit will increase or decrease image by that amount (1-1)% Preserves aspect ratio regardless of zoom value Fit image to width regardless of zoom value Fit image to height regardless of zoom value Fit one pixel to one pixel regardless 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 calcAspectZoom (view,zoom, ASPECT_..PRESERVE/FIT_ TO_ WIDTH) to return the zoom value of that particular tag and 295 Appendix A - Classes and Support Values Value Description to pass to display with the ASPECT_ZOOM type. General Error Define Values Retrieved from Status Property Note: Older error define values are retrieved from the StatusDetails Property. Table A.2: General Error Define Values Retrieved from Status Property Value GENERAL_STATUS.SYSTEM_CRASH = -100 GENERAL_STATUS.DELETE_ERROR = -101 GENERAL_STATUS.DEFAULT = -102 GENERAL_STATUS.SNOWBND_OK = 1 GENERAL_STATUS.SNOWBND_ERROR = -1 GENERAL_STATUS.IMAGE_NOT_AVAILABLE = -103 GENERAL_STATUS.SNOWBND_API_NOT_ AVAILABLE = -104 GENERAL_STATUS.NOT_VALID = -105 GENERAL_STATUS.DISPLAY_ERROR = -106 296 Description If an internal exception is thrown, this is the resulting value. Image data of the object failed What the internal values are initially set to Operation completed successfully Operation failed. See StatusDetails property. Internal image data available when trying to complete an operation API is not implemented Parameter is not valid General error display Appendix A - Classes and Support Values public class CIMG_RECT Syntax public class CIMG_RECT { public: CIMG_RECT(){}; CIMG_RECT(double inleft, double intop, double inright,double inbottom); double left; double top; double right; double bottom; }; Remark Table A.3: public class CIMG_RECT Variables Variable double left double top double right double bottom Description Left most position Top most position Width=right-left Height=bottomtop 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; }; 297 Appendix A - Classes and Support Values Remark Table A.4: public class CIMG_SEARCH_RESULT Variables Variable before after iInstance pSnbdRect 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; 298 Desription String. Reserved, not used now. String. Reserved, not used now. Occurrence of search string to find, start from 0. Rectangle point to the text string position found. Appendix A - Classes and Support Values CASCIITEXTATTR(); void reset(); }; Remark Table A.5: public class CASCIITEXTATTR Variables Variable 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 Description Determines which fields to use Horizontal dots per inch Vertical dots per inch Margins in 1/1000 inches Number of characters between tab stops Width of page in 1/1000 inches Height of page in 1/1000 inches Point size of the font Number of characters per line Number of lines per page Normal=0, Bold=1 Normal=0, Italic=1 Name of the font to use 299 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 { 300 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 int tag int tagvalue Byte buff[] int buff_max_bytes Description TIFF tag number to return or to write Tag value to write or to read String buffer for returning string tags 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; }; 301 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 formats. RasterMaster .NET 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 (bitdepth) 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, RasterMaster .NET 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 processing. 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 white, but contain much more information, and are much larger than 1-bit Full color images 4-bit, 8-bit, 16-bit 8-bit, 16-bit,24-bit, 32-bit 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 documents 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 http://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. 302 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 looking at the value in biBitCount. B = Base D = In Development O = Optional format/Additional charges may apply. Note: Optional formats are not available for UNIX. File Format Description IBM image compression for scanned checks. Note: Not yet supported with (reading) RasterMaster .NET x64 or RasterMaster DLL x64. Advanced Function Presentation™. AFP IBM format which uses CCITT G3, G4, and IBM MMR formats. 1-bit only. (MO:DCA) This is a multi-page file format Snowbound reads in ASCII text files and converts them to a bitmap. You may get a -7 FORMAT_NOT_ ALLOWED error when trying to convert the ASCII text format. To enable autoASCII 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. BMP_ Originated by Microsoft, COMPRESSED BMP supports 1, 4, 8, and 24-bit images. BMP_ Originated by Microsoft, UNCOMPRESSED BMP supports 1, 4, 8, and 24-bit images. ABIC Common Supports File Type Number Input Bit Depth Output Bit Depth 46 1 1 - O - No 74 1, 24 1, 24 .afp O O Yes 38 1 No .txt B - Yes 4, 8 4, 8 .bmp B - No .bmp B B No 12 1 1, 4, 8, 1, 4, 8, 16, 16, 24 24 File Ext. Win Win Read Write Text Search BROOK_TROUT Brooktrout FAX format. 29 1 1 .brk B B No CALS Government specified format. 18 1 1 .cal B B No 33 1 1 .tif B B No 53 1 1 .tif B B No 34 1 1 .tif B B No 52 1 1 .tif B B No 83 1 , 8, 24 1 , 8, 24 .cif O - No CCITT_G3 CCITT_G3_FO CCITT_G4 CCITT_G4_FO CFF 303 Group 3 compression for bitonal (1-bit) image data. Group 3 compression for bitonal (1-bit) image data. Group 4 compression for bitonal (1-bit) image data. Group 4 compression for bitonal (1-bit) image data. Compact Font Format is a lossless compaction of the Type 1 format using Type 2 charstrings. It is designed Appendix B - Supported File Formats File Format CIFF CIMS (ABIC) Description to use less storage space than Type 1 fonts by using operators 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 image format designed by Canon. Check Image Management System. Developed by Carreker. Same as ABIC. Note: Not yet supported with RasterMaster .NET x64 or RasterMaster DLL x64. Common Supports File Type Number Input Bit Depth Output Bit Depth 81 1 , 8, 24 1 , 8, 24 .cif O - No 80 1 No - O - No File Ext. Win Win Read Write Text Search CLIP Microsoft Windows clipboard format. 27 1, 4, 8, 24 1, 4, 8, 24, 32 .cip B B No COD Liberty IMS black and white format. 72 1 No .cod B B No 99 1,24 No .csv O - No 31 8 No .cut B - No 62 32 32 .dcs B B No CSV CUT DCS DCX DIB DICOM DOC DOCX Comma separated value list, a text spreadsheet. Cut images are only 8 bits per pixel and the palette is stored in a separate file. Originated by Media Cybernetics. The DCS format is a standard Quark Express Format. Each plane is stored as an EPS record. Intel created this format as a multi-page .PCX format. Each page is a .PCX file in whole which can be 1, 4, 8, and 24-bit. Standard Windows Device Independent Bitmap. Supports 1, 4, 8 and 24-bits. This is a multi-page file format. Medical image format supporting 1, 12, 16, and 24 pixel images. Microsoft Word format. Supports Microsoft Word 97, version 8 or later. Supports 1-bit images. Cannot decompress (view) document while open in MS Word. The following features have not yet been implemented: right-to-left text flow, underlined URLs, section and paragraph borders and shading, text boxes, multi-column paragraph, Windows Meta Files (WMF) clip art, autoshapes, and embedded OLE objects. Inconsistencies 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 11 1, 4, 8, 24 1, 4, 8, 24 .dcx B B No 48 1, 4, 8, 24 1, 4, 8, 16, 24, 32 .dib B B No 55 8, 16, 24 No .dcm B - No 86 1, 8, 24, 32 No .doc O - Yes 93 1, 8, 24, 32 No .docx O - Yes 304 Appendix B - Supported File Formats File Format DWG DXF Description developed by Microsoft . It is the default document format for saving applications 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 for computer aided design (CAD) data and metadata. The DWG format can be read in the VirtualViewer .NET Content Server. Autodesk® AutoCAD® format. Used for computer aided design (CAD) data and metadata. See the following, for the ful l specification : http://usa.autodesk.com/adsk/servlet/ Common Supports File Type Number Input Bit Depth Output Bit Depth 90 0 24 .dwg O - No 91 0 24 .dxf O - No 89 1 - .msg O - No 14 1, 4, 8, 24 1, 8, 24, 32 .eps B B No 63 8, 24, 32 1, 8, 24, 32 .eps B B No 64 No 1, 8, 24, 32 .eps - B No 69 No 1, 8, 24, 32 .eps - B No 78 1 1 - B - No 54 8, 24 No .fpx B - No 4 2, 3, 4, 5, 6, 7, 8 4, 8 .gif B B No 44 1, 2, 3, 4, 5, 6, 7, 8 4, 8 .gif B B No 22 4, 8 No .gx2 B - No File Ext. Win Win Read Write Text Search item?siteID=123112&id=8446698 The DWG format can be read in the VirtualViewer .NET Content Server. E-mail message created with MS Outlook. Encapsulated Postscript originated by Adobe. Postscript is an interpreted language. Snowbound does not suppor EPS t full Postscript but will extract an (preview) embedded . TIF file in the image. Sometimes called a bitmap representation file. EPS Compressed bitmap format. It is an Adobe encapsulated EPS_BITMAP Postscript file with either G4 or JPEG data embedded. EPS Compressed bitmap format. It is an Adobe encapsulated EPS_BITMAP_G4 Postscript file with either G4 or JPEG data embedded. EPS Compressed bitmap format. It is an Adobe encapsulated EPS_BITMAP_LZW Postscript file with either G4 or JPEG data embedded. Image format developed FileNet by FileNET Corporation for viewing documents. 24-bit tiled JPEG format FLASHPIX that includes multiple resolution images. Created by CompuServe for compressing 2, 3, 4, 5, 6, 7, and 8GIF bit palette images. Uses the LZW algorithm. Same as GIF except stores GIF_INTERLACED the raster data in an interlaced order. Originated by Brightbill Roberts GX2 for ShowPartner DOS applications. EMAIL 305 Appendix B - Supported File Formats File Format HTML ICONTYPE IFF_ILBM IMG IMNET IOCA (MO:DCA) * JBIG JBIG2 JEDMICS JPEG JPEG2000 KOFAX Description Supports 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 forms are often used to capture information from web sites. Full HTML, Javascript and CSS support. Microsoft icon format. Contains a standard device independent bitmap. Supports 1 and 4 bits uncompressed. Used on the Commodore Amiga computers for native bitmap format. Uses a run length format for 1, 4, and 8-bit palette images. Originated by Digital Research for storing 1-bit images. IMNET G4 compressed format. Image Object Content Architecture. IBM format which uses CCITT G3, G4, and IBM MMR formats. 1-bit only. This is a multi-page file format. Joint bi-level Image Experts Group. This is a highly compressed | format 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 results. Snowbound's viewers and 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 format for storing Government documents 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 lossy compression . This is by far the best compression available for these types of images supported in the current Snowbound library. JPEG 2000 specification. This is similar to JPEG but produces much better compression with better quality. It is supported as a separate plugin. An option exists to set the compression level for saving. Kofax Format. Common Supports File Type Number Input Bit Depth Output Bit Depth 82 0 24 .htm, .html - O* Yes 25 1, 4 No .ico B - No .iff B B No 26 1, 4, 8, 24 1, 4, 8, 24 File Ext. Win Win Read Write Text Search 28 1 No .img B - No 42 1 No - B - No 24 1, 24 1 .ico O O No 71 1 1 (with plugin) .jbg B - No 77 1 1 (with plugin) .jbg B B No 56 1 1 .jed B B No .jpg B B No 13 8, 24, 32 8, 24, 32 70 8, 24 8, 24 .jpg2 O O No 23 1 No - B - No 306 Appendix B - Supported File Formats File Format LASER_DATA LINE_DATA MACPAINT MAG MO:DCA MSP NCR ODF ODP ODS ODT OOXML PCL_1 (with plugin) PCL_1 (without plugin) PCL_5 307 Description Compression for documents originated by LaserData Corp. 1-bit images only. Presents data for each variable on a single line. Original Apple bitmap file format. All MacPaint images are 720 x 576 pixels 1 bit. Mag Format. Mixed Object: Document Content Architecture . IBM format which uses CCITT G3, G4, and IBM MMR formats. 1-bit only. This is a multi-page file format. Microsoft Paint program bitmap file format. Supports 1-bit images . Uses a type of RLE compression found also in compressed .BMP files. A simple header with CCITT group 4 data. Open Document Format is an XML-based file format for representing electronic documents such as spreadsheets, charts, presentations and word processing documents. Open Document Format for presentations. Open Document Format for spreadsheets. Open Document Format for word processing (text) documents. Office Open Extended Markup Language or Office Open XML (also informally known as OOXML or OpenXML) is a zipped XML-based file format developed by Microsoft for 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. Support for color and grayscale output. Supported as a separate plugin. This is a multi-page file format. Hewlett Packard printer file format. Support for color and grayscale output. Supported as a separate plugin. This is a multi-page file format. Hewlett Packard printer file format. Support for color and grayscale output. This is a multi-page file format. Common Supports File Type Number Input Bit Depth Output Bit Depth 19 1 No - B - No 75 1 1 - B - No 21 1 No - - - No 61 1 No .mag B - No 49 1, 24 1 .mca O O Yes 30 1 No .msp B - No 65 1 No .ncr B - No 98 No No .odf O - No 101 No No .odp O - Yes 97 1, 24 No .ods O - Yes 96 1, 24 No .odt O - Yes 94 1, 8, 24 No - O - Yes 57 1, 24 1 .pcl O B Yes 57 No 1 .pcl O B Yes 76 No 1 .pcl O B Yes File Ext. Win Win Read Write Text Search Appendix B - Supported File Formats File Format PCX PDF (with plugin) PDF (without plugin) PDF_15 Description Zsoft bitmap file format. Similar to pack bits compression. Supports 1, 4, 8, and 24-bit images. Portable Document Format. File format developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted documents 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 v1.4. Does not currently support JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations , 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 format developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted documents 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 v1.4. Does not currently support JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations , 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 format developed by Adobe to capture formatting File Type Number 2 Input Bit Depth Output Bit Depth Common File Ext. Win Win Read Write Supports Text Search 1, 4, 8, 24 1, 4, 8, 24 .pcx B B No 59 1, 2, 4, 8, 16, 24, 32 1, 24 .pdf O B Yes 59 No 1, 24 .pdf O B Yes 79 No 1, 24 .pdf O B Yes 308 Appendix B - Supported File Formats File Format Description File Type Number Input Bit Depth Output Bit Depth 92 No 1, 24 Common File Ext. Win Win Read Write Supports Text Search publishing applications. It allows the user to send formatted documents 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 v1.4. Does not currently support JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations , 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. PDF_16 Note: Only supported with RasterMaster .NET or RasterMaster DLL . This format is not yet supported in Rastermaster Java. Portable Document Format. File format developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted documents 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 v1.4. Does not currently support JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations , 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. Note: Only supported with RasterMaster .NET or RasterMaster DLL. This format is not yet supported in Rastermaster Java. 309 .pdf O B Yes Appendix B - Supported File Formats File Format PDF_LZW Description Portable Document Format. File format developed by Adobe to capture formatting information from a variety of desktop publishing applications. It allows the user to send formatted documents 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 v1.4. Does not currently support JPEG2000 in PDF for Java. Supports some types of Adobe specified PDF annotations , 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. Kodak photo CD format. Supports only 24-bit images. This format contains at leas t 5 images. Get these images as you would a multi-page file format. Common Supports File Type Number Input Bit Depth Output Bit Depth 88 No 1, 24 .pdf O B Yes 39 24 No .pcd B - No 41 1, 4, 8, 24, 32 1, 8, 24, 32 .psd B B No .pct B B No File Ext. Win Win Read Write Text Search Page 0 - 768 x 512 Page 1 - 384 x 256 Page 2 - 192 x 128 Page 3 - 1536 x 1024 PHOTOCD PHOTOSHOP PICT Page 4 - 3072 x 2048 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. Can be compressed or uncompressed. 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. Only the bitmap portion of data is decompressed. 15 1, 2, 4, 8, 1, 4, 8, 24 16, 24, 32 310 Appendix B - Supported File Formats File Format PNG (optional) PPT PPTX RAST RTF SCITEX SEARCHABLE_ PDF TARGA TARGA16 TIFF_2D 311 Description Uses pack bits compression . Supports 1, 2, 3, 4, 8, 16, 24, and 32-bit images. Originated by CompuServe to replace the .GIF file format. Uses the Huffman encoding variant . Supports 1, 4, 8, 15, 16, 24, and 32-bit images. Also supports interlaced and transparency. Microsoft PowerPoint Binary File Format which is the binary file format used by Microsoft PowerPoint 97, Microsoft PowerPoint 2000, Microsoft PowerPoint 2002, and Microsoft Office PowerPoint 2003. Reading support only. This is a multi-page file format. The .pptx format is part of a family of open office XML-based formats developed by Microsoft. It is the default documen t format for saving applications in Microsoft PowerPoint starting with Office 2007 . It is based on XML rather than Microsoft's .ppt format. Reading support only. This is a multi-page file format . Supported on Java 7. Sun raster format. Supports 1, 8, 24, and 32-bits. Run length encoded format. The Rich Text Format is a method of encoding formatted text and graphics for easy transfer between applications. The SCITEX format is a proprietary format originated from SCITEX Corporation. Gray scale color and CMYK color images. Usually compressed. Searchable PDF, also known as "vector PDF" is a regular PDF file that contains searchable text content vs rasterized text. The SCITEX format is a proprietary format originated from SCITEX Corporation. The SCITEX format is a proprietary format originated from SCITEX Corporation. Tagged image file format. Created by an independent group and was supported by Aldus. .TIF files can be any number of bits per pixel, File Type Number 43 Input Bit Depth Output Bit Depth 1, 4, 8, 1, 4, 8, 16, 16, 24, 32 24, 32 Common File Ext. Win Win Read Write Supports Text Search .png B B No 85 1, 8, 24, 32 No .ppt O - Yes 100 1, 8, 24, 32 No .pptx O - Yes 37 1, 8, 24 1, 8, 24 .ras B B No 87 1, 8, 24, 32 No .rft O - Yes 60 24, 32 24, 32 .sct B B No 59 No No .pdf O B Yes 32 16 24, 32 .tga B B No 32 16 24, 32 .tga B B No 17 1 No .tif B - No Appendix B - Supported File Formats File Format Description 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. This is a multi-page file format. TIFF file with Arithmetic Binary encoding. Requires a special ABIC version of our tools. TIFF_ABIC Very popular for check 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 format. TIFF file with Arithmetic Binary encoding. Requires a special ABIC version of our tools. TIFF_ABIC_BW Very popular for check imaging. BW is used f or 1-bit bi-level and TIFF_ABIC is for 4-bit gray scale images. This is a multi-page file format. ANSI baseline Group 3 or Group 4 compression TIFF_G3_FAX embedded in a TIFF. This is a multi-page file format. ANSI baseline Group 3 or Group 4 compression TIFF_G4_FAX embedded in a TIFF. This is a multi-page file format. ANSI baseline Group 3 or Group 4 compression TIFF_G4_FAX_FO embedded in a TIFF. This is a multi-page file format. ANSI baseline Group 3 TIFF_G4_ or Group 4 compression FAX_STRIP embedded in a TIFF. This is a multi-page file format. TIFF file compressed using the Huffman TIFF_HUFFMAN compression algorithm. This is a multi-page file format. Standard ANSI baseline JBIG compression TIFF_JBIG embedded in a TIFF. This is a multi-page file format. TIFF_JPEG Standard ansi baseline If you have issues JBIG compression viewing, please embedded in a TIFF. see Appendix I, This is a multi-page file format. Troubleshooting. Black and white gray scale format. TIFF_JPEG7 This is a multi-page file format. Common Supports File Type Number Input Bit Depth Output Bit Depth 46 4, 8 No .tif O - No 47 1 No .tif O - No 8 1 1 .tif B B No 10 1 1 .tif B B No 51 1 1 .tif B B No 67 No 1 .tif B B No 7 1 1 .tif B B No 66 1 1 .tif B B No 40 8, 24 8, 24, 32 .tif B B No 73 1, 8 1, 8 .tif B B No File Ext. Win Win Read Write Text Search 312 Appendix B - Supported File Formats File Format Description TIFF file compressed using the LZW compression algorithm. The LZW algorithm includes the TIFF_LZW look-up table of codes as part of the compressed file. This is a multi-page file format. Simple run length encoding algorithm. TIFF_PACK This is a multi-page file format. TIFF Uncompressed raw binary data UNCOMPRESSED . This is a multi-page file format. UTF-8 is a text format.It is a variable width UTF-8 encoding for the Unicode character set.It may start with the Byte Order Mark of 0xFF FE UTF-16 is a text format.It is a variable width encoding for the Unicode UTF-16 character set.It may start with the Byte Order Mark of 0xFE FF. Windows file format WBMP for wireless devices. A simple header with WINFAX CCITT group 3 compression. Microsoft Windows Metafile format . These may contain vector information such as lines and circles. Only the bitmap data is extracted. WMF This is in the form of a standard windows DIB. May 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 that it may contain WPG vector information. Supports 1, 4, 8, and 24-bit images. Only the bitmap data is extracted. Xwindows file format which encodes XBM each pixel as an ASCII byte . Only supports 8-bits per pixel. Xerox_EPS XLSX XLSX 313 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 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 developed by Microsoft. It is the default document format for saving applications in Microsoft Excel starting with Office 2007. It is based on XML rather than Microsoft's .xls format. Reading support only. This is a multi-page file format. File Type Number 9 16 0 38 87 Input Bit Depth Output Bit Depth 1, 4, 8, 1, 4, 8, 16, 24, 32 24, 32 1, 8, 24, 32 File Ext. Win Win Read Write Supports Text Search .tif B B No .tif B B No .tif B B No No .txt B - No No .txt B - No 1, 4, 8, 1, 8 16, 24, 32 1, 2, 4, 8, 1, 4, 8, 16, 16, 24, 32 24, 32 1 Common 68 1 1 .wbmp B B No 58 1 No - B - No 6 1, 4, 8, 24 1, 4, 8, 16, 24, 32 .wmf B B No 5 1, 4, 8, 24 1, 4, 8 .wpg B B No 20 1 1 .xbm B B No 45 1 No - B B No No .xls O - Yes No .xlsx O -- Yes 84 95 1, 8, 24, 32 1, 8, 24, 32 Appendix B - Supported File Formats File Format XPM XWD Description Xwindows bitmap file format stored as ASCII data. Each pixel is stored as an ASCII byte. UNIX XWD Raster format. Each pixel is stored as an ASCII byte. Common Supports File Type Number Input Bit Depth Output Bit Depth 35 1, 4, 8 8 .xpm B B No 36 1, 4, 8 1, 8, 24, 32 .xwd B B No File Ext. Win Win Read Write Text Search * = The .NET 4.0 framework must be installed in order to process HTML documents, even if you are using a .NET 2.0 build of VirtualViewer or RasterMaster. File Type Constants Listed by File Type Number Table B.2: File Type Constants listed by File Type Number File Type Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 File Type Name TIFF_UNCOMPRESSED BMP_UNCOMPRESSED PCX TARGA GIF WPG WMF TIFF_HUFFMAN TIFF_G3_FAX TIFF_LZW TIFF_G4_FAX DCX BMP_COMPRESSED JPEG EPS PICT TIFF_PACK TIFF_2D CALS LASER_DATA XBM MACPAINT GX2 KOFAX IOCA ICONTYPE IFF_ILBM CLIP IMG BROOK_TROUT 314 Appendix B - Supported File Formats File Type Number 30 31 32 33 34 35 36 82 37 38 39 40 41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 315 File Type Name MSP CUT TARGA16 CCITT_G3 CCITT_G4 XPM XWD HTML RAST ASCII PHOTOCD TIFF_JPEG PHOTOSHOP IMNET PNG GIF_INTERLACED Xerox_EPS TIFF_ABIC TIFF_ABIC_BW DIB MO:DCA_IOCA TIFF_G4_FAX_FO CCITT_G4_FO CCITT_G3_FO FLASHPIX DICOM JEDMICS PCL_1 WINFAX PDF SCITEX MAG DCS EPS_BITMAP EPS_BITMAP_G4 NCR TIFF_JBIG TIFF_G4_FAX_STRIP WBMP EPS_BITMAP_LZW JPEG2000 JBIG COD TIFF_JPEG7 Appendix B - Supported File Formats File Type Number 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 File Type Name AFP LINE_DATA PCL_5 JBIG2 FILENET PDF_15 CIMS CIFF HTML CFF EXCEL POWER_POINT DOC RTF PDF_LZW MSG DWG DXF PDF_16 DOCX OOXML XLSX ODT ODS ODF PPTX ODP SVG 103 MIME 104 PDF_A 316 Appendix C - Software Installation Appendix C - Software Installation This appendix describes how to install the evaluation or full copy of RasterMaster .NET. The appendix contains the following topics: Overview of the Installation Process Installing the Software Directory Structure Installed Files Overview of the Installation Process RasterMaster .NET 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@snowbound.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 ship as fully serialized builds which are very easy to install. This product is fully enabled as either a developer or runtime product. RasterMaster .NET 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 RasterMaster .NET, Snowbound requests that you place all Snowbound 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 (support@snowbound.com) for help with these issues. 317 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 plugin .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 Windows 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 l 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. You will see large thin Xs across each page after the first 50 pages or thumbnails. 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 package 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 example MS Office or AFP/MO:DCA. 318 Appendix C - Software Installation Installing the Software To install RasterMaster .NET: 1. Double-click on the downloaded executable. In this example, double-click on rmDotNet17.exe to display the Welcome dialog. 2. After reading the dialog, click Next to display the License Agreement dialog. 319 Appendix C - Software Installation 3. Read the license agreement. l l 320 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). If you do not agree with the license agreement, you cannot proceed with the installation. Appendix C - Software Installation 4. Accept the default destination folder and click Next to display the Ready to Install dialog. 321 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. 322 Appendix C - Software Installation 7. Once installation is complete, the Successful Installation dialog displays. 323 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<version><type><product>. The example below is a version 18.NET directory. RM18Net Docs Images Marketing Sample-Documents Samples Installed Files This section describes the files that are installed during the .NET Imaging SDK installation. The main installation directory is RM<Version><Product>Net. For example, if you install the version 17 .NET, the directory will be RM17Net. There is also a Docs, Marketing, and Samples subdirectory. 324 Appendix C - Software Installation Main Directory Files The files installed into the main directory are defined in Table C-1. Note: If you have an evaluation copy of RasterMaster .NET installed, please remove the Aspose.Total.Product.Family.lic file when you install your purchased version with the Office 2007-2010 option. Table C.1: RasterMaster .NET Default Directory File File Description abicplug.dll Aspose.Cells.dll ABIC plugin file containing the PDF plugin. Aspose.Cells library file. Aspose.Slides.dll Aspose slides library file. Aspose.Total.Product.Family.lic Aspose.Words.dll docplug.dll dwgplg.dll jb2plug.dll jp2plug.dll ooxmlplug.dll pclplug.dll pdfplug.dll Aspose product license. Aspose.Words library file. MS Word plugin file. DWG plugin file. HTML plugin file. The HTML plugin option requires .NET 4.0 JBIG2 plugin file. JPEG2 plugin file. Open Office XML (OOXML) plugin file. PCL plugin file containing the PCL plugin. PDF plugin file containing the PDF plugin. SbdNetAnn.dll Main Snowbound file. SnowboundDllLocations.exe Helps to locate installed DLL files. htmlplug.dll 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 325 Appendix C - Software Installation To display the public key information: sn -Tp sbdnetann.dll To skip strong name verification: sn -Vr sbdnetann.dll For more information about using a strong name, please refer to the following Microsoft.net document: http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpguide/html/cpconassigningassemblystrongname.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 Table C.2: RasterMaster .NET Docs Directory Files File Aspose_LicenseAgreement.pdf ^^Open Source Software Components used in Snowbound products.pdf RMDotNETProgrammersGuide.pdf RMDotNETProgrammersGuide.pdf Description Aspose end user license agreement. Open source sofware license agreement bundled with Snowbound Software products. Complete .NET programmers guide. NET Release Notes. Marketing Directory Files Table C-3.RasterMaster .NET Marketing Directory Files File Snowbound Corporate Overview.pdf Snowbound Software RasterMaster Overview.pdf Snowbound Software VirtualViewer Overview.pdf 326 Description Provides an overview of Snowbound Software including company facts, products, and formats. Provides an overview of Snowbound Software’s RasterMaster products. Provides an overview of Appendix C - Software Installation File Description Snowbound Software’s VirtualViewer products. Sample Directory Files The samples directory contains the .NET Imaging SDK samples that are described in Table C4. All of the .NET samples include C#.NET and VB.NET source code. For more information about each sample, see Appendix F, .NET Samples. Table C.3: RasterMaster .NET Samples Directory Sample Alpha_csharp Alpha_VB Animate_CSHARP Animate_VB annaction_csharp annaction_VB Annotation_CSHARP Annotation_VB ASCIIConversion_CSHARP ASCIIConversion_VB ASPConversion_CSHARP ASPConversion_VB ASPImageView_CSHARP Description Sample for using the .NET library in C# to load, display 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 and rotate to manipulate the image. See Alpha for more information. Sample for displaying an animated GIF image in C#. See Animate for more information. Sample for displaying an animated GIF image in Visual Basic. See Animate for more information. Sample for using the .NET library in C# mouse handler to add an annotation. See Annaction for more information. Sample for using the .NET library in Visual Basic mouse handler to add an annotation. See Annaction for more information. Sample for using the .NET library in C# to add an annotation. See Annotation for more information. Sample for using the .NET library in Visual Basic to add an annotation. See Annotation for more information. Sample for demonstrating ASCII conversion in C#. Sample for demonstrating ASCII conversion in Visual Basic. Sample for demonstrating a simple conversion in C#. See ASP Conversion for more information. Sample for demonstrating a simple conversion in Visual 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 327 Appendix C - Software Installation Sample ASPImageView_VB ASPMemCopy_CSHARP ASPMemCopy_VB ASPMultiPage_CSHARP ASPMultiPage_VB Contrast_CSHARP Contrast_VB Conversion_CSHARP Conversion_VB ddbeffect_CSHARP ddbeffect_VB Encrypt_csharp Encrypt_VB 328 Description 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 Visual Basic to load, display 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 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 reading 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 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 multiple page images. See ASP Multiple Pages for more information. Sample for comparing an image that had the brightness and contrast changed with the original/unmodified image in C#. See Contrast for more information. Sample for comparing an image that had the brightness 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 for more information. Sample for demonstrating a simple conversion in Visual Basic. See Conversion for more information. Sample for showing how to get the DDB display effect from an image in C#. See DDB Effect for more information. Sample for showing how to get the DDB display effect from an image in Visual Basic. See DDB Effect for more information. Sample demonstrating how to use the Snowbound.Net library in C# to transparently decompress and display images. See Encryption for more information. Sample demonstrating how to use the Snowbound.Net library in Visual Basic to transparently decompress and Appendix C - Software Installation Sample ImageProcessing_CSHARP ImageProcessing_VB memcopy_csharp Memcopy_VB mergeimage_CSHARP page_csharp Page_VB panning_csharp panning_VB Print_CSHARP Print_VB Scan_CSHARP Scan_VB SimpleMultiPages_CSHARP SimpleMultiPages_VB textsearch_CSHARP textsearch_VB Description display images. See Encryption for more information. Sample showing how to apply the image processing operator in C#. See Image Processing for more information. Sample showing how to apply the image processing operator in Visual Basic. See Image Processing for more information. Sample demonstrating how to use the Snowbound .NET library in C# for saving and reading the image from memory. See Memory Copy for more information. Sample demonstrating how to use the Snowbound .NET 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 Merge Image for more information. Sample for displaying any page and using anti-aliasing if desired in C#. See Page for more information. Sample for displaying any page and using anti-aliasing if desired in Visual Basic. See Page for more information. Sample demonstrating panning in C#. See Panning for more information. Sample demonstrating panning in Visual Basic. See Panning for more information. Sample demonstrating printing and previewing in C# using the Snowbound product. See Print for more information. Sample demonstrating printing and previewing in Visual Basic using the Snowbound product. See Print for more information. Sample demonstrating how to use the Snowbound .NET library in C# for scanning functions. See Scan for more information. Sample demonstrating how to use the Snowbound .NET library in Visual Basic for scanning functions. See Scan for more information. Sample demonstrating how to split multiple pages in C#. See Split to Multiple Pages for more information. Sample demonstrating how to split multiple pages in Visual Basic. See Split to Multiple Pages for more information. Sample showing how to search text in the image in C#. See Text Search for more information. Sample showing how to search text in the image in Visual Basic. See Text Search for more information. 329 Appendix C - Software Installation Sample TIFFTag_CSHARP TIFFTag_VB 330 Description Sample demonstrating how to use the Snowbound .NET library in C# for reading .tif tags. See Tiff Tag for more information. Sample demonstrating how to use the Snowbound .NET library in Visual Basic for reading .tif tags. See Tiff Tag for more information. 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, and ASP .NET 2.0. All of Snowbound Software’s samples were written under Visual Studio .NET. When you use Visual Studio to open a sample project file, Visual Studio will prompt you to convert the project to the new version. If you have more questions about installing or running these samples, please contact Snowbound Software’s technical support at http://support.snowbound.com . 331 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 Visual Studio 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 Control Panel > 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 framework 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 332 Chapter D - Set Up for ASP .NET Samples about software installation and troubleshooting. 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) 333 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) 334 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 ASPSample 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) 335 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 336 Chapter D - Set Up for ASP .NET Samples Figure D-8. Selecting .NET library dll 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) 337 Chapter D - Set Up for ASP .NET Samples Figure D-9. Adjusting the File Size 338 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 supported 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 withRasterMaster .NET. It is located in the SnbdImageViewer folder where the samples are installed. For example: C:\Program Files\Snowbound\RM16PlatExtNetAnn\AnnSamples\ SnbdImageViewer. Example E.1 Run the Component in Internet Explorer <object id="SnbdViewer1" classid="http://localhost/tempview/ snbdimageviewer.dll#SnbdImageViewer.SnbdViewer" height=1024 width=1280> <param name="docAddress" value="http://localhost/tempview/my_ test.pdf"> <param name="embedded" value="true"> </object> Example E.2 Create a Pop Up Window to Run the Component <object id="SnbdViewer1" classid="http://localhost/tempview/ snbdimageviewer.dll#SnbdImageViewer.SnbdViewer height=1024 width=1280> <param name="docAddress" value="http://localhost/tempview/my_ 339 Chapter E - Set Up for the Web Image Viewer Component test.pdf"> <param name="embedded" value="false"> </object> 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 l Navigate to Control Panel > Administrative Tools > Microsoft .NET Framework 1.1 Configuration. Configure the .NET framework security policy to trust the snbdimageviewer.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 SbdNetAnn.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 340 Edit the source code SnbdViewer.cs and add the following line: 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 display 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. 341 Appendix F - .NET Samples Appendix F - .NET Samples This appendix describes the .NET samples included with RasterMaster .NET. 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 customers 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 342 Appendix F - .NET Samples Panning Print Scan Split to Multiple Pages Text Search Thumbnail Tiff Tag Web Image Viewer Component WPFAnnotation_CSHARP WPFConversion_CSHARP WPFScanning_CSHARP WPF Image VectorConvertMem_CSHARP XPSMem_CSHARP Overview of the .NET Samples There are several samples included with RasterMaster .NET. 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. Use Windows 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 Operating System Snowbound Software’s 32-bit .NET library supports running on 64-bit operating systems by running in compatibility mode. 343 Appendix F - .NET Samples Note: Snowbound Software supports running RasterMaster .NET 32-bit applications on 64-bit 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: 344 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 Software\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 Software\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. 345 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 Software\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 Software\RasterMaster® .NET\Net\Samples. Listed below are the functions used in this sample: Snowbnd() loads the Init Snowbound .NET component. 346 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. 347 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 Software\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 Software\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 Software\RasterMaster® .NET\Net\Samples. Listed below are the functions used in this sample: Snowbnd() loads the Init Snowbound .NET component. 348 Appendix F - .NET Samples CIMG_decompress_bitmap() loads an image from the disk. 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 Software\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 Software\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. BatchConvert This sample demonstrates how to convert the files in one directory and store them in another. 349 Appendix F - .NET Samples You can find the samples in the following directory C:\Program Files\Snowbound Software\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() loads an image from the disk. 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, sbdnetann.dll. It can be used to see if the .NET library can be loaded on a machine or not. If there is an exception when loading the .NET library, all other samples will not run properly. The exception 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 Software\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 original/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 Software\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. 350 Appendix F - .NET Samples Conversion This 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 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 Software\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_get_version(int, int, int, int) returns version information for your RasterMaster .NET. CIMG_get_version(String) returns version information for your RasterMaster .NET. CIMG_save_bitmap() saves the image to the disk in any available format. CIMG_display_bitmap() displays the current image. 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 Software\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 information obtained from CIMGLOW_extract_text_mem() to save the document file output to memory. 351 Appendix F - .NET Samples 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 Software\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. 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 Software\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. 352 Appendix F - .NET Samples Encryption This sample demonstrates how to use the Snowbound.NET library to transparently decompress 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 Software\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. 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 Software\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 Software\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. 353 Appendix F - .NET Samples 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 Software\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_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 Software\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. 354 Appendix F - .NET Samples 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 Software\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. Panning This sample demonstrates panning. You can find the samples in the following directory C:\Program Files\Snowbound Software\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 Software\RasterMaster® .NET\Net\Samples. Listed below are the functions used in this sample: Snowbnd() loads the Init Snowbound .NET component. 355 Appendix F - .NET Samples 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 Software\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. 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 single 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. 356 Appendix F - .NET Samples You can find the samples in the following directory C:\Program Files\Snowbound Software\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. You can find the samples in the following directory C:\Program Files\Snowbound Software\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 Software\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. 357 Appendix F - .NET Samples 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 get the .tif tag. You can find the samples in the following directory C:\Program Files\Snowbound Software\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 tiff tag from the file specified. 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 Software\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. 358 Appendix F - .NET Samples 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. WPFAnnotation_CSHARP This sample demonstrates how to display images and annotations with the Windows Presentation Foundation (WPF) image functions. You can find the samples in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET\Net\Samples\VS2010Samples\WPF 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 Software\RasterMaster® .NET\Net\Samples\VS2010Samples\WPF. 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. 359 Appendix F - .NET Samples 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 Software\RasterMaster® .NET\Net\Samples\VS2010Samples\WPF. 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 parameters. CSANN_read_ann_WPF() reads annotation objects from a file. WPF Image This sample demonstrates how to the Windows Presentation Foundation (WPF) image functions. You can find the samples in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET\Net\Samples\VS2010Samples. Listed below are the functions used in this sample: 360 Appendix F - .NET Samples 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. VectorConvertMem_CSHARP This sample creates vector PDFs that contain searchable text using in-memory (vs. file) methods. You can find the samples in the following directory C:\Program Files\Snowbound Software\RasterMaster® .NET\Net\Samples\VS2010Samples. Listed below are the functions used in this sample: Snowbnd() loads the Init Snowbound .NET component. CIMGLOW_get_pages_mem() gets the page number from current image buffer. CIMG_decompress_bitmap_mem() reads the image from memory. CIMG_bitmap_info() gets information about the decompressed image. CIMGLOW_extract_text_mem() extract text from memory. CIMG_save_document_mem() 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. 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 Software\RasterMaster® .NET\Net\Samples\VS2010Samples\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 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. 361 Appendix G - Snowbound Error Codes Appendix G - 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 ToErrorMessage(). Detailed Status/Error Codes Table G.1: Error Codes Error Error Code OUT_OF_MEMORY -1 FILE_NOT_FOUND -2 CORRUPTED_FILE BAD_STRING -3 -4 BAD_RETURN -5 CANT_CREATE_FILE -6 FORMAT_NOT_ ALLOWED -7 NO_BITMAP_FOUND -8 DISK_FULL -9 BAD_DISPLAY_AREA -10 PAGE_NOT_FOUND -11 Description Failed on memory allocation. Problem with a standard memory allocation. Please see Determining Memory Requirements in Chapter 2 for more information on the the amount of memory required. Open call failed when trying to decompress an image. File format bad, or unreadable. String passed in is null or invalid. Internal DLL problem. Submit a support issue at http://support.snowbound.com and attach the document 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 write to that directory and that there is sufficient space available on the storage device. Image was not recognized as a format the library can decompress. Please see Appendix B, Supported File Format 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 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 failed. Tried to display with negative coordinates or out of range. Used for multi-page file format support when attempting to access a page which does not exist. This error code provides information of an empty Word-page which is not converted to an empty page 362 Appendix G - Snowbound Error Codes Error Error Code DISK_READ_ERROR -12 BAD_HANDLE -13 NO_CLIPBOARD_IMAGE-14 NO_SCANNER_FOUND -15 ERROR_OPENING_ SCANNER CANT_FIND_TWAIN_ DLL -16 -17 USER_CANCEL -18 EVAL_TIMEOUT -19 USING_RUNTIME -20 PIXEL_DEPTH_ UNSUPPORTED -21 PALETTE_IMAGES_ NOT_ALLOWED NO_LZW_VERSION DLL_NOT_LOADED -22 -23 -24 FORMAT_WILL_NOT_ -25 OTFLY NO_TCOLOR_FOUND -26 COMPRESSION_NOT_ -27 SUPPORTED Description in PDF or TIFF. File format was truncated and tried to read past end of file. Standard read i/o function failed. Application passed bad image handle. Not a valid Snowbound library image handle. Image not found on clipboard. TWAIN scanner driver not installed or not found (TWAIN.DLL). Bad scanner driver or driver not configured properly. TWAIN scanner driver not installed or not found (TWAIN.DLL). Cancel out of low level save or low level decompress. Usually not an error but termination of a function intentionally. Date on an evaluation copy of the Snowbound product has expired. Version not allowed for design mode. Tried to save an image to a format that does not support the image’s bits per pixel. Or tried to perform an image processing function on an image whose bits per pixel is not allowed. Please see Appendix B, Supported File Format for the pixel depths of each supported format. Some image processing operations does not work on palette images. 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 http://support.snowbound.com and attach the document you were processing when you received this error Format will not support on the fly decompression. No transparency color information found. Currently not supporting this compression format. NO_MORE_PAGES -28 FEEDER_NOT_READY NO_DELAY_TIME_ FOUND TIFF_TAG_NOT_FOUND NOT_A_TILED_IMAGE -29 Returned when scanning has completed all pages in the document feeder. No more pages ready in document feeder. -30 No delay time was found for the animated GIF. -31 -32 Could not find the .TIF tag. Not recognized as a TIFF tiled image. You are using a version that does not support this NOT_SUPPORTED_IN_ -33 363 Appendix G - Snowbound Error Codes Error Error Code Description -34 function. You do not have support for this file format. You may contact support or your account representative to get information on the RasterMaster option that will allow you to process the file format. Autofeed fail in the TWAIN Scanner. -35 TWAIN driver cannot do fast transfer. THIS_VERSION AUTOFEED_FAILED NO_FAST_TWAIN_ SUPPORTED The PDF processing option was not found. If you have the PDF processing option, please make sure the name of the directory containing Snowbound's pdfplug.dll is in the System environment variable Path. No ABIC plug-in code in this version. Internal error. An exception occurred during processing. Please enter a support ticket aat http://support.snowbound.com providing the document that 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_PDF_VERSION -36 NO_ABIC_VERSION -37 EXCEPTION_ERROR -38 NO_VECTOR_ CAPABILITY -39 No vector plug-in found in this version. -40 The PDF processing option was not found. If you have the PDF processing option, please make sure the name of the directory containing Snowbound's pclplug.dll is in the System environment variable Path. -41 NO JPEG2000 plug-in found in this version. -42 Did not find attempted search string. NO_WORD_VERSION -43 The PDF processing option was not found. If you have the PDF processing option, please make sure the name of the directory containing Snowbound's docplug.dll is in the System environment variable Path. PASSWORD_ PROTECTED_PDF -44 This PDF file was a password protected. NO_PCL_VERSION NO_JPEG2000_ VERSION SEARCH_STRING_ NOT_FOUND METHOD_NOT_FOUND -45 ACCESS_DENIED -46 The Snowbound method was not found. Please check the spelling of the method name and Snowbound library version. Access denied. Please check the security permissions. 364 Appendix G - Snowbound Error Codes Error Error Code BAD_LICENSE_ PRIMARY BAD_LICENSE_ SECONDARY -47 PASSWORD_ PROTECTED_FILE -48 OOXML_LICENSE_NOT_ FOUND OOXML_LICENSE_ EXPIRED FONT_PATH_FOLDER_ NOT_FOUND FONT_FONT_PATH_ FOLDER_IS_EMPTY FONT_PATH_FOLDER_ MISSING_FONTS FONT_PATH_FOLDER_ TOO_FEW_FONTS Description Primary level license loaded is bad. Secondary level license loaded is bad. This file was password protected for Word or other formats. The OOXML Aspose license file was not -52 found.Please see CIMGLOW_ooxml_license_ enable() to set the license path. The OOXML Aspose license file expired or is -53 otherwise invalid. -54 The PDF/A font path folder does not exist. -55 The PDF/A font path folder is empty. -56 The PDF/A font path folder has no fonts. The PDF/A font path folder has unexpected # of -57 fonts, too few. General Error Define Values Retrieved from Status Property Note: Older error define values are retrieved from the StatusDetails Property. Table G.2: General Error Define Values Retrieved from Status Property Value GENERAL_STATUS. SYSTEM_CRASH GENERAL_STATUS. DELETE_ERROR GENERAL_STATUS. DEFAULT GENERAL STATUS. 365 Error Code Description -100 If an internal exception is thrown, this is the resulting value. -101 Image data of the object failed -102 1 What the internal values are initially set to Operation completed successfully Appendix G - Snowbound Error Codes Value SNOWBND_OK GENERAL STATUS. SNOWBND_ERROR GENERAL_STATUS. IMAGE_NOT_AVAILABLE GENERAL STATUS. SNOWBND_API_NOT_ AVAILABLE GENERAL STATUS. NOT_VALID GENERAL STATUS. DISPLAY_ERROR Error Code -1 -103 Description Operation failed. See StatusDetails property. Internal image data unavailable when trying to complete an operation -104 API is not implemented -105 Parameter is not valid -106 General error display General Status/Error Codes Table G.3: General Status/Error Codes Error DELETE_ERROR DISPLAY_ERROR IMAGE_NOT_AVAILABLE NOT_VALID SNOWBND_API_NOT_AVAILABLE SNOWBND_ERROR SNOWBND_OK SYSTEM_CRASH Description The image in memory cannot be removed. Any problems with displaying an image will return this error code. No image data is available to do manipulations on. This is returned if a parameter passed into an API is not valid. This is returned if an API method is not implemented in the current build. General API error code of an unsuccessful action. General API status of a successful action. This is returned when a Critical Exception is thrown. 366 Appendix H - Troubleshooting Appendix H - Troubleshooting This appendix describes solutions to issues that you may run across when installing and using RasterMaster .NET. Receiving an Error Code When Loading, Saving or Converting a Document If you receive an error code when trying to load, save or convert a document with RasterMaster .NET, please check the list of error codes and their descriptions in Appendix H, Snowbound Error Codes 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 http://support.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 at http://support.snowbound.com and attach the document along with a screenshot of the output document in RasterMaster .NET. 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 .NET 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, Supported File Format 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 Functions for more detailed information. CIMGLOW_set_document_input (int dpi, int bits_pix, int format)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 Functions for more 367 Appendix H - 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 Original Document The first step in obtaining better quality conversions is to check the original images or documents 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 format. Text will usually work well. If your document requires color, then try saving to a color output format such as TIFF_Packbits, 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 l 368 Choose a different output format such as TIFF_LZW to produce an output document with sufficient pixel depth.Appendix B, Supported File Format shows a list of file formats and their supported bit depths. Use the following function prior to decompression to reduce the output dots per inch Appendix H - 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 format)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 Functions for more detailed information. Output Document Displays Incorrect or Missing Characters When you convert a document, the output document may display incorrect or missing characters if the document contains special characters which are commonly found in NonEnglish languages such as Chinese, Japanese and Thai. Make sure that your system is properly configured 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 processing 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 performance, the quality of the image may be less. This is true whenever working with any imaging software. To improve performance in RasterMaster .NET, 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 Excel, use the following function to set the DPI and bit depth prior to 369 Appendix H - Troubleshooting decompression. Please see Chapter 23, Information Query Functions for more detailed information. CIMGLOW_set_document_input (int dpi, int bits_pix, int format)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 RasterMaster .NET. This function returns a number that corresponds to a file type as defined in the RasterMaster library. Please see Appendix B, Supported File Format 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 document. 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 .NET. XLS or XLSX Page Content Truncated Your XLS or XLSX page content may be truncated because XLS and HTML formats do not include the page size in the document like Word and PDF. It can be set explicitly similar to how you can set the page size when printing. To set the page size to avoid truncated content, use the CIMGLOW_set_document_page_size function as shown in the example below. To explicitly set the page size to US Letter 8.5"x11", use: CIMGLOW_set_document_page_size(8.5, 11.0, XLS) To auto-grow the page width and grow the page to fit all columns, use: CIMGLOW_set_document_page_size(-1, 11.0, XLS) 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. 370 Appendix H - Troubleshooting 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 .NET Do Not Open In Third Party Image Viewers When converting a file to TIFF_JPEG with RasterMaster .NET, you may see that the resulting TIFF is blank when opened in a third party image viewer such as MS Office Document Imaging or Windows Photo Viewer. In some cases, the viewer may also display an error message indicating 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 .NET 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 .NET users may run into some errors and/or warnings when attempting to build an application with .NET 4.0 set as the target 371 Appendix H - Troubleshooting framework. Since RasterMaster .NET 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 attribute in your application configuration: <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> </startup> This should allow the application to be successfully built under .NET 4.0. For more information, refer to the following MSDN article: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/5d1186ec-ad55-4929-b1e48806cdc758af 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 > General > Security, and click Unblock. Then re-launch Visual Studio and attempt to build the application once again. Color Documents Rendered as Black and White AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in these documents, you may use IMGLOW_set_document_input(300,24) before calling CIMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information and using a relatively high resolution of 300 DPI will considerably increase the memory required to process the document, increase the size of the output document and decrease performance. If you have a mix of monochrome and color pages that you are converting and saving to another format, then you may want to use CIMGLOW_detect_color() to identify black and white pages that can safely be converted to a higher performance 1-bit deep format. The color pages should be converted to an output format that supports color, such as JPEG. Please see Appendix B, Supported File Format for details on which formats support color information at different bitdepths. Upgrading to the RasterMaster .NET 18.0 Library If you are upgrading from the RasterMaster .NET base library to the new RasterMaster .NET 18.0 library, you will need to replace references to sbdnet.dll with SbdNetAnn.dll. 372 Appendix H - Troubleshooting Getting RasterMaster .NET x32 to work with IIS 7.5 Follow the steps below to make it easier to use the RasterMaster .NET x32 evaluation build with IIS 7.5 and ASP.NET: 1. Make sure that you are targeting the x86 platform. For C# projects, go to Project Properties > Build. Choose x86 as the Platform Target. For Visual Basic projects, go to Project Properties > Compile > Advanced Compile Options > Advanced Compiler Settings. Choose x86 as the Platform Target. 2. Make sure this is set to true in your application configuration: <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> </startup> 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 373 Appendix I - TIFF Tags Appendix I - TIFF Tags This appendix describes the tags in the header and in Image File Directories (IFDs) used by TIFF (tagged image file format) files to declare and describe their content. Each TIFF file begins with a image file header which points to one or more image file directories which contain the image data and image information. To call the TIFF tags in RasterMaster .NET, use the CIMGLOW_get_tiff_tag() function. This function reads a TIFF tag from the file specified by bm_name. To set the TIFF tags in RasterMaster, use the CIMGLOW_set_tiff_tag() function. This function reads a TIFF tag from the file specified by bm_name.This function writes new tags as well as all current tags. The TIFF file format was created by an independent group and was supported by Aldus. .TIF files can be any number of bits per pixel, planes and several compression algorithms. The byte order may be Intel or Motorola format. The bytes may also be filled from right to left or left to right. Compression may be uncompressed, pack bits, LZW, modified Huffman, CCITT G4, CCITT G3, CCITT G3-2D or JPEG. The CCITT G4 file format only saves to black and white. If you have any questions about the TIFF file format and the tags described below, you may contact Snowbound Technical support on the web at http://support.snowbound.com . Sources for Tag Specifications The following are descriptions of the types of the sources of the tags: TIFF Baseline: The baseline set of tags were documented in TIFF 5.0 and carried over on pages 11-47 of the 1992 TIFF 6.0 specification. TIFF Extended: The extended set includes some additional tags and added values for existing tags, as documented on pages 48-115 of the TIFF 6.0 specification. TIFF Private: Originally, the term private meant just that. The TIFF 6.0 specification (page 8) states, “An organization might wish to store information meaningful to only that organization . . . . Tags numbered 32768 or higher, sometimes called private tags, are reserved for that purpose. Upon request, the TIFF administrator . . . will allocate and register one or more private tags for an organization . . . . You do not need to tell the TIFF administrator what you plan to use them for, but giving us this information may help other developers to avoid some duplication of effort.” Over time, however, many private tags have become well established and well documented, e.g., tag 34675 for the ICC profile, dubbed InterColorProfile in the TIFF/EP standard. Thus, many members of the private tag class can be viewed as open extensions rather than as containers for secret information. TIFF/EP, TIFF/IT, and DNG: A number of tags, some of which may once have been private, have been defined in TIFF/EP (ISO 12234-2, 2001), TIFF/IT (ISO 12639, 2004), and DNG_1_1, an Adobe-sponsored extension of the TIFF 6.0 specification. TIFF Private IFD: The TIFF 6.0 specification (page 9) states, “If you need more than 10 tags, we suggest that you reserve a single private tag, define it as a LONG TIFF data type, and use its value as a pointer (offset) to a private IFD [image file directory] or other data structure of your 374 Appendix I - TIFF Tags choosing. Within that IFD, you can use whatever tags you want, since no one else will know that it is an IFD unless you tell them.” As with private tags, we can understand private IFDs as an extension to TIFF, often very public and well documented. The private IFD tags of greatest interest to the Library of Congress are those associated with the EXIF_2_2 specification, pertaining to image generation by digital still cameras. Exif is an abbreviation for EXchangeable Image File format, although Exif does not relate to TIFF as, say, JFIF relates to JPEG_DCT. The Exif IFD is pointed to by the Private Exif IFD tag 34665. This and other Exif tags are listed in the numerical table below. For the Exif specification and other related information, see Exif.org. There are actually three private IFDs specified by the Exif standard. The other two are the GPS IFD, for positioning information, and the Interoperability IFD, used to encode compability information. With numerical sequences of their own, the GPS and interoperability tags are not included in the table below. HD Photo tags: Although not a true TIFF implementation, WMP_1_0 (originally called Windows Media Photo) is a 2006 specification with a container format that borrows heavily from TIFF and adds a few new tags of interest. Included in the table. Descriptions of Tags in Numerical Order Table I.1: TIFF Tags in Numerical Order1 Code Dec Hex Name Description Source of Tag A general indication of the kind of data that is contained in this subfile. This field is made up of a set of 32 flag bits. Unused bits are expected to be 0. Bit 0 is the low-order bit. Currently defined values for the bitmap are: 254 00FE NewSubfileType 0 - Image is reduced of another TIFF Baseline image in this file 1 - Image is a single page of a multipage 2 - Image is a transparency mask for another image in this file. The default is 0. A general indication of the kind of data that is contained in this subfile. 255 00FF SubfileType Currently defined values are: A general indication of the kind of 375 Baseline Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag data that is contained in this subfile. Currently defined values are: 1 = full resolution image data ImageWidth, ImageLength, and StripOffsets are required fields. 2 = reduced resolution image data ImageWidth, ImageLength, and StripOffsets are required fields. It is further assumed that a reduced resolution image is a reduced version of the entire extent of the corresponding full resolution data. 3 = single page of a multi-page image (see the PageNumber tag description). 256 0100 ImageWidth 257 0101 ImageLength 258 0102 BitsPerSample 259 0103 Compression Continued use of this field is not recommended. Writers should instead use the new and more general NewSubfileType field. The image's width, in pixels (X:horizontal). The number of Baseline columns in the image. The image's length (height) in pixels (Y:vertical). The number of rows Baseline (sometimes described as "scan lines") in the image. Number of bits per sample. Note that this tag allows a different number of bits per sample for each sample corresponding to a pixel. For example, RGB color data could use Baseline a different number of bits per sample for each of the three color planes. The default is 1. 1 = No compression, but pack data into bytes as tightly as possible, with no unused bits except at the end of a row. The bytes are stored Baseline as an array of bytes, for BitsPerSample <= 8, word if BitsPerSample > 8 and <= 16, and 376 Appendix I - TIFF Tags Code Dec Hex Name Description dword if BitsPerSample > 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. 2 = CCITT Group 3 1-Dimensional Modified Huffman run length encoding. See ALGRTHMS.txt BitsPerSample must be 1, since this type of compression is defined only for bilevel images (like FAX images...) 3 = Facsimile-compatible CCITT Group 3, exactly as specified in "Standardization of Group 3 facsimile apparatus for document transmission," Recommendation T.4, Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic Services, The International Telegraph and Telephone Consultative Committee (CCITT), Geneva, 1985, pages 16 through 31. Each strip must begin on a byte boundary. (But recall that an image can be a single strip.) Rows that are not the first row of a strip are not required to begin on a byte boundary. The data is stored as bytes, not words - byte-reversal is not allowed. See the Group3Options field for Group 3 options such as 1D vs 2D coding. 4 = Facsimile-compatible CCITT Group 4, exactly as specified in "Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus," Recommendation T.6, Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic Services, The International 377 Source of Tag Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag 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 PhotometricInterpretation value. 262 0106 PhotometricInterpretation 1 = For bilevel and grayscale images: 0 is imaged as black. 2**BitsPerSample-1 is imaged as white. If GrayResponseCurveexists, it overrides the PhotometricInterpretation value. Baseline 2 = RGB. In the RGB model, a color is described as a combination of the three primary colors of light (red, green, and blue) inparticular concentrations. For each of the three samples, 0 represents minimum intensity, and 2**BitsPerSample - 1 represents maximum intensity. For 378 Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag PlanarConfiguration = 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 StripOffsets. 3 = "Palette color." In this mode, a color is described with a single sample. The sample is used as an index into ColorMap. The sample is used to index into each of the red, green and blue curve tables to retrieve an RGB triplet defining an actual color. When this PhotometricInterpretation value is used, the color response curves must also be supplied. SamplesPerPixel must be 1. 4 = Transparency Mask. This means that the image is used to define an irregularly shaped region of another image in the same TIFF file. SamplesPerPixel and BitsPerSample must be 1. PackBits compression is recommended. The 1-bits define the interior of the region; the 0-bits define interior of the region; the 0-bits define the exterior of the region. The Transparency Mask must have the same ImageLength and ImageWidth as the main image. 1 = a bilevel "line art" scan. BitsPerSample must be 1. 263 0107 Threshholding 2 = a "dithered" scan, usually of continuous tone data such as photographs. BitsPerSample must be 1. 3 = Error Diffused. 379 Baseline Appendix I - TIFF Tags Code Dec Hex Name 264 0108 CellWidth 265 0109 CellLength 266 010A FillOrder 269 010D DocumentName 270 010E ImageDescription 271 010F 272 273 274 0110 0111 0112 Make Model StripOffsets Orientation Description Source of Tag The width of the dithering or halftoning matrix used to create a Baseline dithered or halftoned bilevel file. The length of the dithering or halftoning matrix used to create a Baseline dithered or halftoned bilevel file. The logical order of bits within a Baseline byte. The name of the document from Extended which this image was scanned. A string that describes the subject of the image. For example, a user may Baseline wish to attach a comment such as "1988 company picnic" to an image. Manufacturer of the scanner, video digitizer. Baseline Mandatory for TIFF/EP. The model name/number of the scanner, video digitizer. This tag is intended for user information only so Baseline format is arbitrary. Mandatory for TIFF/EP. For each strip, the byte offset of that strip. The offset is specified with respect to the beginning of the TIFF file. Note that this implies that each strip has a location independent of Baseline the locations of other strips. This feature may be useful for editing applications. This field is the only way for a reader to find the image data, and hence must exist. The orientation of the image with respect to the rows and columns. 1 = The 0th row represents the visual top of the image, and the 0th column represents the visual left Baseline hand side. 2 = The 0th row represents the visual top of the image, and the 0th column represents the visual right hand side. 380 Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag 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 hand side. 5 = The 0th row represents the visual left hand side of the image, and the 0th column represents the visual top. 6 = The 0th row represents the visual right hand side of the image, and the 0th column represents the visual top. 7 = The 0th row represents the visual right hand side of the image, and the 0th column represents the visual bottom. 8 = The 0th row represents the visual left hand side of the image, and the 0th column represents the visual bottom. It is extremely costly for most readers to perform image rotation "on the fly", i.e., when importing and printing; and users of most desktop publishing applications do not expect a file imported by the application to be altered permanently in any way. 277 0115 SamplesPerPixel 278 0116 RowsPerStrip 381 The default value is 1. The number of samples per pixel. SamplesPerPixel is 1 for bilevel, grayscale, and palette color images. Baseline SamplesPerPixel is 3 for RGB images. The number of rows per strip. The image data is organized into strips Baseline for fast access to individual rows Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag when the data is compressed though this field is valid even if the data is not compressed. 279 0117 StripByteCounts 280 0118 MinSampleValue 281 0119 MaxSampleValue 282 011A XResolution 283 011B YResolution 284 011C PlanarConfiguration The default is 2**32 - 1, which is effectively infinity. That is, the entire image is one strip. Recomended is a strip size of 8K. For each strip, the number of bytes in that strip. The existenceof this field greatly simplifies the chore of Baseline buffering compressed data, if the strip size is reasonable. The minimum component value Baseline used. The maximum component value Baseline used. The number of pixels per ResolutionUnit in the X direction, Baseline i.e., in the ImageWidth direction. The number of pixels per ResolutionUnit in the Y direction, Baseline i.e., in the ImageLength direction. 1 = The sample values for each pixel are stored contiguously, so that there is a single image plane. See PhotometricInterpretation to determine the order of the samples within the pixel data. So, for RGB data, the data is stored RGBRGBRGB...and so on. 2 = The samples are stored in separate "sample planes." The values in StripOffsets and Baseline StripByteCounts are then arranged as a 2-dimensional array, with SamplesPerPixel rows and StripsPerImage columns. (All of the columns for row 0 are stored first, followed by the columns of row 1, and so on.) PhotometricInterpretation describes the type of data that is stored in each sample plane. For example, RGB data is stored with the Red samples 382 Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag in one sample plane, the Green in another,and the Blue in another. If SamplesPerPixel is 1, PlanarConfiguration is irrelevant, and should not be included. 285 011D PageName 286 011E XPosition 287 011F YPosition 288 0120 FreeOffsets 289 0121 FreeByteCounts The default is 1. The name of the page from which Extended this image was scanned. The X offset of the left side of the image, with respect to the left side of Extended the page, in ResolutionUnits. The Y offset of the top of the image, with respect to the top of the page, in ResolutionUnits. In the TIFF Extended oordinate scheme, the positive Y direction is down, so that YPosition is always positive. For each string of contiguous unused bytes in a TIFF file, the byte Baseline offset of the string. For each string of contiguous unused bytes in a TIFF file, the Baseline 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. 290 0122 GrayResponseUnit 3 = Number represents thousandths Baseline of a unit. 4 = Number represents tenthousandths of a unit. 5 = Number represents hundredthousandths of a unit. 291 383 0123 GrayResponseCurve For historical reasons, the default is 2. However, for greater accuracy, 3 is recommended. For grayscale data, the optical Baseline Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag density of each possible pixel value. The purpose of the gray response curve and the gray units is to provide more exact photometric interpretation information for gray scale image data, in terms of optical density. Those options are for fax-images stored in TIFF format. This field is made up of a set of 32 flag bits. Unused bits are expected to be 0. It is probably not safe to try to read the file if any bit of this field is set that you don't know the meaning of. 292 0124 Group3Options Bit map: Extended 0 - 2-dimensional coding used. 1 - Image is uncompressed Group4Options 293 0125 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. Extended For 2-D coding, each strip is encoded as if it were a separate image. In particular, each strip begins on a byte boundary; and the coding for the first row of a strip is encoded independently of the previous row, using horizontal codes, as if the previous row is entirely white. Each strip ends with the 24-bit end-of-facsimile block (EOFB). 384 Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag Bit map: 0 - reserved (unused) 1 - uncompressed mode is used 2-31 - reserved To be used with XResolution and YResolution. 296 0128 ResolutionUnit 1 = No absolute unit of measurement. Used for images that may have a non-square aspect ratio, but no meaningful absolute dimensions. The drawback of ResolutionUnit=1 is that different applications will import the image at different sizes. Even if the decision is quite arbitrary, it might be better to Baseline use dots per inch or dots per centimeter, and pick XResolution and YResolution such that the aspect ratio is correct and the maximum dimension of the image is about four inches (the "four" is quite arbitrary.) 2 = Inch. 3 = Centimeter. 297 0129 301 012D TransferFunction 305 0131 Software 306 0132 DateTime 385 PageNumber The default is 2. This tag is used to specify page numbers of a multiple page (e.g. facsimile) document. Two word values are specified. The first value is the page number; the second Extended 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 Extended image in tabular style. Name and release number of the software package that created the Baseline image. User information only. Date and time of image creation. Baseline Uses the format "YYYY:MM:DD Appendix I - TIFF Tags Code Dec Hex Name 315 013B Artist 316 013C HostComputer Description Source of Tag HH:MM:SS", with hours on a 24hour clock, and one space character between the date and the time. The length of the string, including the null, is 20 bytes. Person who created the image. Baseline Copyright notice. The computer and/or operating system in use at the time of image Baseline creation. ENIAC. A mathematical operator that is applied to the image data before an encoding scheme is applied. 317 013D Predictor To be used when Compression=5 (LZW). Extended 1 = No prediction scheme used before coding. 2 = Horizontal differencing. Gives TIFF color image readers a better idea of what kind of color image it is. There will be borderline cases. 1 = Continuous tone, natural image. 318 013E ColorImageType 2 = Synthetic image, using a greatly Extended restricted range of colors. Such images are produced by most color paint programs. See ColorList for a list of colors used in this image. 319 013F ColorList 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. Extended ColorImageType should be 2. See ColorImageType. The list is organized as an array of RGB triplets, with no pad. The RGB 386 Appendix I - TIFF Tags Code Dec Hex 320 0140 Name ColorMap 321 0141 HalftoneHints 322 0142 TileWidth 323 0143 TileLength 324 0144 TileOffsets 325 0145 TileByteCounts 326 0146 BadFaxLines 327 0147 CleanFaxData 328 0148 ConsecutiveBadFaxLines 387 Description Source of Tag triplets are not guaranteed to be in any particular order. Note that the red, green, and blue components can either be a BYTE or a word in length. BYTE should be sufficient for most applications. This tag defines a Red-Green-Blue color map for palette color images. The palette color pixel value is used to index into all 3 subcurves. The subcurves are stored sequentially. The Red entries come first, followed by the Green entries, followed by the Blue entries. The width of each entry Baseline is 16 bits, as implied by the type of word. 0 represents the minimum 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 levels within a Extended colorimetrically-specified image that should retain tonal detail. The tile width in pixels. This is the Extended number of columns in each tile. The tile length (height) in pixels. This Extended is the number of rows in each tile. For each tile, the byte offset of that tile, as compressed and stored on Extended disk. For each tile, the number of Extended (compressed) bytes in that tile. Used in the TIFF-F standard, denotes the number of 'bad' scan Extended lines encountered by the facsimile device. Used in the TIFF-F standard, indicates if 'bad' lines encountered during reception are stored in the Extended data, or if 'bad' lines have been replaced by the receiver. Used in the TIFF-F standard, Extended denotes the maximum number of Appendix I - TIFF Tags Code Dec Hex Name 330 014A SubIFDs 332 014C InkSet 333 014D InkNames 334 014E NumberOfInks 336 0150 DotRange 337 0151 TargetPrinter 338 0152 ExtraSamples 339 0153 SampleFormat 340 0154 SMinSampleValue 341 0155 SMaxSampleValue 342 0156 TransferRange 343 0157 ClipPath 344 0158 XClipPathUnits 345 0159 YClipPathUnits 346 015A Indexed 347 015B JPEGTables 351 015F OPIProxy 400 0190 GlobalParametersIFD 401 0191 ProfileType Description consecutive 'bad' scanlines received. Offset to child IFDs. The set of inks used in a separated (PhotometricInterpretation=5) image. The name of each ink used in a separated image. The number of inks. The component values that correspond to a 0% dot and 100% dot. A description of the printing environment for which this separation is intended. Description of extra components. Specifies how to interpret each data sample in a pixel. Specifies the minimum sample value. Specifies the maximum sample value. Expands the range of the TransferFunction. Mirrors the essentials of PostScript's path creation functionality. The number of units that span the width of the image, in terms of integer ClipPath coordinates. The number of units that span the height of the image, in terms of integer ClipPath coordinates. Aims to broaden the support for indexed images to include support for any color space. JPEG quantization and/or Huffman tables. OPI-related. Used in the TIFF-FX standard to point to an IFD containing tags that are globally applicable to the complete TIFF file. Used in the TIFF-FX standard, Source of Tag Extended Extended Extended Extended Extended Extended Baseline Extended Extended Extended Extended Extended Extended Extended Extended Extended Extended Extended Extended 388 Appendix I - TIFF Tags Code Dec Hex 402 403 404 405 433 434 512 513 514 515 517 518 519 389 Name Description Source of Tag denotes the type of data stored in this file or IFD. Used in the TIFF-FX standard, 0192 FaxProfile denotes the 'profile' that applies to Extended this file. Used in the TIFF-FX standard, 0193 CodingMethods indicates which coding methods are Extended used in the file. Used in the TIFF-FX standard, 0194 VersionYear denotes the year of the standard Extended specified by the FaxProfile field. Used in the TIFF-FX standard, 0195 ModeNumber denotes the mode of the standard Extended specified by the FaxProfile field. Used in the TIFF-F and TIFF-FX standards, holds information about 01B1 Decode the ITULAB Extended (PhotometricInterpretation = 10) encoding. Defined in the Mixed Raster Content part of RFC 2301, is the default color 01B2 DefaultImageColor Extended needed in areas where no image is available. Old-style JPEG compression field. 0200 JPEGProc TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0201 JPEGInterchangeFormat TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0202 JPEGInterchangeFormatLength TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0203 JPEGRestartInterval TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0205 JPEGLosslessPredictors TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0206 JPEGPointTransforms TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. 0207 JPEGQTables TechNote2 invalidates this part of Extended the specification. Appendix I - TIFF Tags Code Dec Hex Name 520 0208 JPEGDCTables 521 0209 JPEGACTables 529 0211 YCbCrCoefficients 530 0212 YCbCrSubSampling 531 0213 YCbCrPositioning 532 0214 ReferenceBlackWhite 559 022F StripRowCounts 700 02BC XMP 32781 800D ImageID 32932 80A4 Wang Annotation 33421 828D CFARepeatPatternDim 33422 828E CFAPattern 33423 828F BatteryLevel 33432 8298 Copyright 33434 829A ExposureTime Description Source of Tag Old-style JPEG compression field. TechNote2 invalidates this part of Extended the specification. Old-style JPEG compression field. TechNote2 invalidates this part of Extended the specification. The transformation from RGB to YCbCr image data. Extended Mandatory for TIFF/EP YCbCr images. Specifies the subsampling factors used for the chrominance Extended components of a YCbCr image. Specifies the positioning of subsampled chrominance Extended components relative to luminance samples. Specifies a pair of headroom and footroom image data values (codes) Extended for each pixel component. Defined in the Mixed Raster Content part of RFC 2301, used to replace Extended RowsPerStrip for IFDs with variable-sized strips. XML packet containing XMP Extended metadata OPI-related. Extended Annotation data, as used in 'Imaging Private for Windows. TIFF/EP For camera raw files from sensors spec, p. with CFA overlay. 23 TIFF/EP For camera raw files from sensors spec, p. with CFA overlay. 23 TIFF/EP Encodes camera battery level at spec, p. time of image capture. 45 Copyright notice. Baseline Exif Private Exposure time given in seconds. IFD TIFF/EP 390 Appendix I - TIFF Tags Code Dec Hex Name 33437 829D FNumber Description Source of Tag spec, p. 38 Exif Private IFD The F number. TIFF/EP spec, p. 39 33445 82A5 MD FileTag 33446 82A6 MD ScalePixel 33447 82A7 MD ColorTable 33448 82A8 MD LabName 33449 82A9 MD SampleInfo 33450 82AA MD PrepDate 33451 82AB MD PrepTime 33452 82AC MD FileUnits 33550 830E ModelPixelScaleTag 33723 83BB IPTC/NAA 33918 847E INGR Packet Data Tag 33919 847F INGR Flag Registers 33920 8480 IrasB Transformation Matrix 391 Specifies the pixel data format encoding in the Molecular Dynamics Private GEL file format. Specifies a scale factor in the Molecular Dynamics GEL file Private format. Used to specify the conversion from 16bit to 8bit in the Molecular Private Dynamics GEL file format. Name of the lab that scanned this file, as used in the Molecular Private Dynamics GEL file format. Information about the sample, as used in the Molecular Dynamics Private GEL file format. Date the sample was prepared, as used in the Molecular Dynamics Private GEL file format. Time the sample was prepared, as used in the Molecular Dynamics Private GEL file format. Units for data in this file, as used in the Molecular Dynamics GEL file Private format. Used in interchangeable GeoTIFF_ Private 1_0 files. IPTC-NAA (International Press TIFF/EP Telecommunications Councilspec, p. Newspaper Association of America) 33 metadata. Intergraph Application specific Private storage. Intergraph Application specific flags. Private Originally part of Intergraph's GeoTIFF tags, but likely understood Private by IrasB only. Appendix I - TIFF Tags Code Dec Hex Name 33922 8482 ModelTiepointTag 34016 Site 34017 ColorSequence 34018 IT8Header 34019 RasterPadding 34020 BitsPerRunLength 34021 BitsPerExtendedRunLength 34022 ColorTable 34023 ImageColorIndicator 34024 BackgroundColorIndicator 34025 ImageColorValue 34026 BackgroundColorValue 34027 PixelIntensityRange 34028 TransparencyIndicator Description Source of Tag Originally part of Intergraph's GeoTIFF tags, but now used in interchangeable GeoTIFF_1_0 files. Private In GeoTIFF_1_0, either this tag or 34264 must be defined, but not both TIFF/IT Site where image created. spec, 7.2.3 TIFF/IT Sequence of colors if other than spec, CMYK. 7.2.8.3.2 TIFF/IT Certain inherited headers. spec, 7.2.3 TIFF/IT Type of raster padding used, if any. spec, 7.2.6 TIFF/IT Number of bits for short run length spec, encoding. 7.2.6 TIFF/IT Number of bits for long run length spec, encoding. 7.2.6 TIFF/IT Color value in a color pallette. spec, 7.2.8.4 TIFF/IT Indicates if image (foreground) color spec, or transparency is specified. 7.2.9 TIFF/IT Background color specification. spec, 7.2.9 TIFF/IT Specifies image (foreground) color. spec, 7.2.8.4 TIFF/IT Specifies background color. spec, 7.2.8.4 TIFF/IT Specifies data values for 0 percent spec, and 100 percent pixel intensity. 7.2.8.4 TIFF/IT Specifies if transparency is used in spec, HC file. 7.2.8.4 392 Appendix I - TIFF Tags Code Dec Hex Name Description 34029 ColorCharacterization Specifies ASCII table or other reference per ISO 12641 and ISO 12642. 34030 HCUsage Indicates the type of information in an HC file. 34031 TrapIndicator Indicates whether or not trapping has been applied to the file. 34032 CMYKEquivalent Specifies CMYK equivalent for specific separations. 34033 Reserved For future TIFF/IT use 34034 Reserved For future TIFF/IT use 34035 Reserved For future TIFF/IT use 34264 85D8 ModelTransformationTag 34377 8649 Photoshop 34665 8769 Exif IFD 34675 8773 InterColorProfile 34732 87AC ImageLayer 34735 87AF GeoKeyDirectoryTag 34736 87B0 GeoDoubleParamsTag 34737 87B1 GeoAsciiParamsTag 34850 8822 ExposureProgram Used in interchangeable GeoTIFF_ 1_0 files. In GeoTIFF_1_0, either Private this tag or 33922 must be defined, but not both Collection of Photoshop 'Image Private Resource Blocks. A pointer to the Exif IFD. Private TIFF/EP ICC profile data. spec, p. 47 Defined in the Mixed Raster Content part of RFC 2301, used to denote Extended the particular function of this Image in the mixed raster scheme. Used in interchangeable GeoTIFF_ 1_0 files. Mandatory in GeoTIFF_1_ Private 0. Used in interchangeable GeoTIFF_ Private 1_0 files. Used in interchangeable GeoTIFF_ Private 1_0 files. Exif Private The class of the program used by IFD the camera to set exposure when the picture is taken. 393 Source of Tag TIFF/IT spec, 7.2.8.4 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.6 TIFF/IT spec, 7.2.8.3.4 TIFF/IT spec TIFF/IT spec TIFF/IT spec TIFF/EP spec, p. Appendix I - TIFF Tags Code Dec Hex Name 34852 8824 SpectralSensitivity Source of Tag 41 Exif Private Indicates the spectral sensitivity of IFD each channel of the camera used. TIFF/EP Description 34853 8825 GPSInfo A pointer to the Exif-related GPS Info IFD. 34855 8827 ISOSpeedRatings Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. 34856 8828 34857 8829 OECF Interlace 34858 882A TimeZoneOffset 34859 882B SelfTimeMode 34908 885C HylaFAX FaxRecvParams 34909 885D HylaFAX FaxSubAddress 34910 885E HylaFAX FaxRecvTime 36864 9000 ExifVersion 36867 9003 DateTimeOriginal Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. spec, p. 48 TIFF/EP spec, p. 34 Exif Private IFD TIFF/EP spec, p. 47 Exif Private IFD TIFF/EP spec, p. 48 TIFF/EP Indicates the field number of spec, p. multifield images. 22 TIFF/EP Encodes time zone of camera clock spec, p. relative to GMT. 38 TIFF/EP Number of seconds image capture spec, p. was delayed from button press. 45 Used by HylaFAX. Private Used by HylaFAX. Private Used by HylaFAX. Private Exif The version of the supported Exif Private standard. Mandatory in the Exif IFD. IFD Exif The date and time when the original Private IFD image data was generated. Mandatory for TIFF/EP. TIFF/EP spec, p. 394 Appendix I - TIFF Tags Code Dec Hex Name Description 36868 9004 DateTimeDigitized The date and time when the image was stored as digital data. ComponentsConfiguration Specific to compressed data; specifies the channels and complements PhotometricInterpretation 37121 9101 37122 9102 CompressedBitsPerPixel Source of Tag 37 Exif Private IFD Exif Private IFD Exif Private Specific to compressed data; states IFD the compressed bits per pixel. TIFF/EP spec, p. 27 Exif Private IFD 37377 9201 ShutterSpeedValue Shutter speed. TIFF/EP spec, p. 39 Exif Private IFD 37378 9202 ApertureValue The lens aperture. TIFF/EP spec, p. 39 Exif Private IFD 37379 9203 BrightnessValue The value of brightness. TIFF/EP spec, p. 40 Exif Private IFD 37380 9204 37381 9205 395 ExposureBiasValue MaxApertureValue The exposure bias. The smallest F number of the lens. TIFF/EP spec, p. 40 Exif Private IFD Appendix I - TIFF Tags Code Dec Hex Name 37382 9206 SubjectDistance Source of Tag TIFF/EP spec, p. 40 Exif Private The distance to the subject, given in IFD meters. TIFF/EP Description spec, p. 44 Exif Private IFD 37383 9207 MeteringMode The metering mode. TIFF/EP spec, p. 41 Exif Private IFD 37384 9208 37385 9209 LightSource Flash 37386 920A FocalLength The kind of light source. Indicates the status of flash when the image was shot. TIFF/EP spec, p. 46 Exif Private IFD TIFF/EP spec, p. 42 Exif Private The actual focal length of the lens, in IFD mm. 37387 920B FlashEnergy Amount of flash energy (BCPS). 37388 920C SpatialFrequencyResponse SFR of the camera. 37389 920D Noise Noise measurement values. TIFF/EP spec, p. 44 TIFF/EP spec, p. 43 TIFF/EP spec, p. 49 TIFF/EP spec, p. 49 396 Appendix I - TIFF Tags Code Dec Hex Name 37390 920E FocalPlaneXResolution 37391 920F FocalPlaneYResolution 37392 9210 FocalPlaneResolutionUnit 37393 9211 ImageNumber 37394 9212 SecurityClassification 37395 9213 ImageHistory 37396 9214 SubjectLocation 37397 9215 ExposureIndex 37398 9216 TIFF/EPStandardID 37399 9217 Description Number of pixels per FocalPlaneResolutionUnit (37392) in ImageWidth direction for main image. Number of pixels per FocalPlaneResolutionUnit (37392) in ImageLength direction for main image. Unit of measurement for FocalPlaneXResolution(37390) and FocalPlaneYResolution(37391). UserComment 37520 9290 SubsecTime 397 TIFF/EP spec, p. 19 main subject in the overall scene. TIFF/EP spec, p. 45 TIFF/EP Encodes the camera exposure index spec, p. setting when image was captured. 47 For current spec, tag value equals 1 TIFF/EP 0 0 0. spec, p. Mandatory in TIFF/EP. 16 Type of image sensor. TIFF/EP spec, p. 22 Exif Private IFD Exif Private IFD Exif Private Mandatory in TIFF/EP. 37510 9286 TIFF/EP spec, p. 18 TIFF/EP spec, p. 19 TIFF/EP Number assigned to an image, e.g., spec, p. in a chained image burst. 32 TIFF/EP Security classification assigned to spec, p. the image. 33 TIFF/EP Record of what has been done to the spec, p. image. 33 Exif Private Indicates the location and area of the IFD SensingMethod 37500 927C MakerNote Source of Tag Manufacturer specific information. Keywords or comments on the image; complements ImageDescription. A tag used to record fractions of seconds for the DateTime tag. Appendix I - TIFF Tags Code Dec Hex Name 37521 9291 SubsecTimeOriginal 37522 9292 SubsecTimeDigitized 37724 935C ImageSourceData 40960 A000 FlashpixVersion 40961 A001 ColorSpace 40962 A002 PixelXDimension 40963 A003 PixelYDimension 40964 A004 RelatedSoundFile 40965 A005 Interoperability IFD 41483 A20B FlashEnergy 41484 A20C SpatialFrequencyResponse 41486 A20E FocalPlaneXResolution 41487 A20F FocalPlaneYResolution Source of Tag IFD A tag used to record fractions of Exif seconds for the DateTimeOriginal Private tag. IFD A tag used to record fractions of Exif seconds for the DateTimeDigitized Private tag. IFD Used by Adobe Photoshop. Private The Flashpix format version Exif supported by a FPXR file., Private Description IFD Mandatory in the Exif IFD The color space information tag is always recorded as the color space Exif Private specifier. IFD Mandatory in the Exif IFD. Exif Specific to compressed data; the Private valid width of the meaningful image. IFD Exif Specific to compressed data; the Private valid height of the meaningful image. IFD Exif Used to record the name of an audio Private file related to the image data. IFD A pointer to the Exif-related Private Interoperability IFD. Indicates the strobe energy at the Exif time the image is captured, as Private measured in Beam Candle Power IFD Seconds Records the camera or input device spatial frequency table and SFR Exif values in the direction of image Private width, image height, and diagonal IFD direction, as specified in ISO 12233. Indicates the number of pixels in the Exif image width (X) direction per Private FocalPlaneResolutionUnit on the IFD camera focal plane. Indicates the number of pixels in the Exif image height (Y) direction per Private FocalPlaneResolutionUnit on the IFD camera focal plane. 398 Appendix I - TIFF Tags Code Dec Hex Name Description 41488 A210 FocalPlaneResolutionUnit Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. 41492 A214 SubjectLocation Indicates the location of the main subject in the scene. 41493 A215 ExposureIndex Indicates the exposure index selected on the camera or input device at the time the image is captured. 41495 A217 SensingMethod 41728 A300 FileSource 41729 A301 SceneType 41730 A302 CFAPattern 41985 A401 CustomRendered 41986 A402 ExposureMode 41987 A403 WhiteBalance 41988 A404 DigitalZoomRatio 41989 A405 FocalLengthIn35mmFilm 41990 A406 SceneCaptureType 41991 A407 GainControl 399 Source of Tag Exif Private IFD Exif Private IFD Exif Private IFD Exif Indicates the image sensor type on Private the camera or input device. IFD Exif Indicates the image source. Private IFD Exif Indicates the image source. Private IFD Indicates the color filter array (CFA) Exif geometric pattern of the image Private sensor when a one-chip color area IFD sensor is used. Indicates the use of special Exif processing on image data, such as Private rendering geared to output. IFD Exif Indicates the exposure mode set Private when the image was shot. IFD Exif Indicates the white balance mode Private set when the image was shot. IFD Exif Indicates the digital zoom ratio when Private the image was shot. IFD Indicates the equivalent focal length Exif assuming a 35mm film camera, in Private mm. IFD Exif Indicates the type of scene that was Private shot. IFD Exif Indicates the degree of overall image Private gain adjustment. IFD Appendix I - TIFF Tags Code Dec Hex Name 41992 A408 Contrast 41993 A409 Saturation 41994 A40A Sharpness 41995 A40B DeviceSettingDescription 41996 A40C SubjectDistanceRange 42016 A420 ImageUniqueID 42112 A480 GDAL_METADATA 42113 A481 GDAL_NODATA 48129 BC01 PixelFormat 48130 BC02 Transformation 48131 BC03 Uncompressed 48132 BC04 ImageType 48256 BC80 ImageWidth Source of Tag Indicates the direction of contrast Exif processing applied by the camera Private when the image was shot. IFD Indicates the direction of saturation Exif processing applied by the camera Private when the image was shot. IFD Indicates the direction of sharpness Exif processing applied by the camera Private when the image was shot. IFD This tag indicates information on the Exif picture-taking conditions of a Private particular camera model. IFD Exif Indicates the distance to the Private subject. IFD Exif Indicates an identifier assigned Private uniquely to each image. IFD Used by the GDAL library, holds an XML list of name=value 'metadata' Private values about the image as a whole, and about specific samples. Used by the GDAL library, contains an ASCII encoded nodata or Private background pixel value. HD Photo A 128-bit Globally Unique Identifier Feature (GUID) that identifies the image Spec, p. pixel format. 17 HD Photo Specifies the transformation to be Feature applied when decoding the image to Spec, p. present the desired representation. 23 HD Photo Specifies that image data is Feature uncompressed. Spec, p. 23 HD Photo Specifies the image type of each Feature individual frame in a multi-frame file. Spec, p. 27 HD Photo The image's width, in pixels Feature (X:horizontal). The number of Spec, p. columns in the image. 21 Description 400 Appendix I - TIFF Tags Code Dec Hex Name Description 48257 BC81 ImageHeight Specifies the number of pixels or scan lines in the transformed photo. 48258 BC82 WidthResolution Specifies the horizontal resolution of a transformed image expressed in pixels per inch. 48259 BC83 HeightResolution Specifies the vertical resolution of a transformed image expressed in pixels per inch. 48320 BCC0 ImageOffset Specifies the byte offset pointer to the beginning of the photo data, relative to the beginning of the file. 48321 BCC1 ImageByteCount Specifies the size of the photo in bytes. 48322 BCC2 AlphaOffset Specifies the byte offset pointer the beginning of the planar alpha channel data, relative to the beginning of the file. 48323 BCC3 AlphaByteCount Specifies the size of the alpha channel data in bytes. 48324 BCC4 ImageDataDiscard 48325 BCC5 AlphaDataDiscard 48132 BC04 ImageType 50215 C427 50216 C428 50217 C429 50218 C42A 401 Oce Scanjob Description Oce Application Selector Oce Identification Number Oce ImageLogic Source of Tag HD Photo Feature Spec, p. 21 HD Photo Feature Spec, p. 21 HD Photo Feature Spec, p. 21 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 22 HD Photo Feature Spec, p. 23 HD Photo Feature Spec, p. 25 Signifies the level of data that has been discarded from the image as a result of a compressed domain transcode to reduce the file size. Signifies the level of data that has HD Photo been discarded from the planar alpha Feature channel as a result of a compressed Spec, p. domain transcode to reduce the file 26 size. HD Photo Specifies the image type of each Feature individual frame in a multi-frame file. Spec, p. 27 Used in the Oce scanning process. Private Used in the Oce scanning process. Private Used in the Oce scanning process. Private Used in the Oce scanning process. Private Appendix I - TIFF Tags Code Dec Hex Name Description Source of Tag Characteristics 50706 C612 DNGVersion 50707 C613 DNGBackwardVersion 50708 C614 UniqueCameraModel 50709 C615 LocalizedCameraModel 50710 C616 CFAPlaneColor Encodes DNG four-tier version DNG number; for version 1.1.0.0, the tag spec, p. contains the bytes 1, 1, 0, 0. Used in 17 IFD 0 of DNG files. Defines oldest version of spec with DNG which file is compatible. Used in IFD spec, p. 0 of DNG files. 17 Unique, non-localized nbame for DNG camera model. Used in IFD 0 of spec, p. DNG files. 18 Similar to 50708, with localized DNG camera name. Used in IFD 0 of spec, p. DNG files. 19 Mapping between values in the CFAPattern tag and the plane DNG numbers in LinearRaw space. Used spec, p. in Raw IFD of DNG files. 19 Required for non-RGB CFA images. 50711 C617 CFALayout 50712 C618 LinearizationTable 50713 C619 BlackLevelRepeatDim 50714 C61A BlackLevel 50715 C61B BlackLevelDeltaH 50716 C61C BlackLevelDeltaV 50717 C61D WhiteLevel DNG spec, p. 20 Lookup table that maps stored DNG values to linear values. Used in Raw spec, p. IFD of DNG files. 20 DNG Repeat pattern size for BlackLevel spec, p. tag. Used in Raw IFD of DNG files. 21 DNG Specifies the zero light encoding spec, p. level.Used in Raw IFD of DNG files. 21 Specifies the difference between zero light encoding level for each DNG column and the baseline zero light spec, p. encoding level. Used in Raw IFD of 22 DNG files. Specifies the difference between zero light encoding level for each DNG row and the baseline zero light spec, p. encoding level. Used in Raw IFD of 23 DNG files. Specifies the fully saturated DNG encoding level for the raw sample spec, p. values. Used in Raw IFD of DNG 23 Spatial layout of the CFA. Used in Raw IFD of DNG files. 402 Appendix I - TIFF Tags Code Dec Hex Name 50718 C61E DefaultScale 50719 C61F DefaultCropOrigin 50720 C620 DefaultCropSize 50721 C621 ColorMatrix1 50722 C622 ColorMatrix2 50723 C623 CameraCalibration1 50724 C624 CameraCalibration2 50725 C625 ReductionMatrix1 50726 C626 ReductionMatrix2 403 Description Source of Tag files. For cameras with non-square pixels, specifies the default scale factors DNG for each direction to convert the spec, p. image to square pixels. Used in Raw 24 IFD of DNG files. Specifies the origin of the final image area, ignoring the extra pixels at DNG edges used to prevent interpolation spec, p. artifacts. Used in Raw IFD of DNG 25 files. Specifies size of final image area in DNG raw image coordinates. Used in spec, p. Raw IFD of DNG files. 25 Defines a transformation matrix that converts XYZ values to reference DNG camera native color space values, spec, p. under the first calibration illuminant. 27 Used in IFD 0 of DNG files. Defines a transformation matrix that converts XYZ values to reference DNG camera native color space values, spec, p. under the second calibration 28 illuminant. Used in IFD 0 of DNG files. Defines a calibration matrix that transforms reference camera native DNG space values to individual camera spec, p. native space values under the first 28 calibration illuminant. Used in IFD 0 of DNG files. Defines a calibration matrix that transforms reference camera native DNG space values to individual camera spec, p. native space values under the 29 second calibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction matrix for use as the first stage in DNG converting color camera native spec, p. space values to XYZ values, under 30 the first calibration illuminant. Used in IFD 0 of DNG files. Defines a dimensionality reduction DNG matrix for use as the first stage in spec, p. Appendix I - TIFF Tags Code Dec Hex Name 50727 C627 AnalogBalance 50728 C628 AsShotNeutral 50729 C629 AsShotWhiteXY 50730 C62A BaselineExposure 50731 C62B BaselineNoise 50732 C62C BaselineSharpness 50733 C62D BayerGreenSplit 50734 C62E LinearResponseLimit 50735 C62F CameraSerialNumber Description Source of Tag converting color camera native space values to XYZ values, under 30 the second calibration illuminant. Used in IFD 0 of DNG files. Pertaining to white balance, defines DNG the gain, either analog or digital, that spec, p. has been applied to the stored raw 31 values. Used in IFD 0 of DNG files. Specifies the selected white balance at the time of capture, encoded as DNG the coordinates of a perfectly neutral spec, p. color in linear reference space 31 values. Used in IFD 0 of DNG files. Specifies the selected white balance DNG at the time of capture, encoded as xspec, p. y chromaticity coordinates. Used in 32 IFD 0 of DNG files. Specifies in EV units how much to DNG move the zero point for exposure spec, p. compensation. Used in IFD 0 of 32 DNG files. Specifies the relative noise of the camera model at a baseline ISO DNG value of 100, compared to reference spec, p. camera model. Used in IFD 0 of 33 DNG files. Specifies the relative amount of sharpening required for this camera DNG model, compared to reference spec, p. camera model. Used in IFD 0 of 33 DNG files. For CFA images, specifies, in arbitrary units, how closely the values of the green pixels in the DNG blue/green rows track the values of spec, p. the green pixels in the red/green 34 rows. Used in Raw IFD of DNG files. Specifies the fraction of the encoding range above which the DNG response may become significantly spec, p. non-linear. Used in IFD 0 of DNG 34 files. DNG Serial number of camera. Used in spec, p. IFD 0 of DNG files. 404 Appendix I - TIFF Tags Code Dec Hex Name 50736 C630 LensInfo 50737 C631 ChromaBlurRadius 50738 C632 AntiAliasStrength 50739 ShadowScale 50740 C634 DNGPrivateData 50741 C635 MakerNoteSafety 50778 C65A CalibrationIlluminant1 50779 C65B CalibrationIlluminant2 50780 C65C BestQualityScale 50781 RawDataUniqueID 50784 C660 Alias Layer Metadata 50827 OriginalRawFileName 50828 OriginalRawFileData 405 Source of Tag 35 DNG Information about the lens. Used in spec, p. IFD 0 of DNG files. 35 Normally for non-CFA images, DNG provides a hint about how much spec, p. chroma blur ought to be applied. 36 Used in Raw IFD of DNG files. Provides a hint about the strength of DNG the camera's anti-aliasing filter. spec, p. Used in Raw IFD of DNG files. 36 Used by Adobe Camera Raw to DNG control sensitivity of its shadows spec, p. slider. Used in IFD 0 of DNG files. 38 Provides a way for camera manufacturers to store private data DNG in DNG files for use by their own raw spec, p. convertors. Used in IFD 0 of DNG 37 files. Lets the DNG reader know whether DNG the Exif MakerNote tag is safe to spec, p. preserve. Used in IFD 0 of DNG 38 files. Illuminant used for first set of DNG calibration tags. Used in IFD 0 of spec, p. DNG files. 26 Illuminant used for second set of DNG calibration tags. Used in IFD 0 of spec, p. DNG files. 26 Specifies the amount by which the values of the DefaultScale tag need DNG to be multiplied to achieve best spec, p. quality image size. Used in Raw IFD 24 of DNG files. Contains a 16-byte unique identifier DNG for the raw image file in the DNG file. spec, p. Used in IFD 0 of DNG files. 39 Alias Sketchbook Pro layer usage Private description. Name of original file if the DNG file DNG results from conversion from a nonspec, p. DNG raw file. Used in IFD 0 of DNG 39 files. DNG If the DNG file was converted from a spec, p. Description Appendix I - TIFF Tags Code Dec Hex Name 50829 ActiveArea 50830 MaskedAreas 50831 AsShotICCProfile 50832 AsShotPreProfileMatrix 50833 CurrentICCProfile 50834 CurrentPreProfileMatrix Description Source of Tag non-DNG raw file, then this tag contains the original raw data. Used 40 in IFD 0 of DNG files. Defines the active (non-masked) DNG pixels of the sensor. Used in Raw spec, p. IFD of DNG files. 41 List of non-overlapping rectangle coordinates of fully masked pixels, DNG which can optimally be used by spec, p. DNG readers to measure the black 42 encoding level. Used in Raw IFD of DNG files. Contains ICC profile that, in conjunction with the AsShotPreProfileMatrix tag, DNG specifies a default color rendering spec, p. from camera color space 42 coordinates (linear reference values) into the ICC profile connection space. Used in IFD 0 of DNG files. Specifies a matrix that should be applied to the camera color space DNG coordinates before processing the spec, p. values through the ICC profile 43 specified in the AsShotICCProfile tag. Used in IFD 0 of DNG files. The CurrentICCProfile and CurrentPreProfileMatrix tags have the same purpose and usage as the AsShotICCProfile and DNG AsShotPreProfileMatrix tag pair, spec, p. except they are for use by raw file 44 editors rather than camera manufacturers. Used in IFD 0 of DNG files. The CurrentICCProfile and CurrentPreProfileMatrix tags have the same purpose and usage as the AsShotICCProfile and DNG AsShotPreProfileMatrix tag pair, spec, p. except they are for use by raw file 44 editors rather than camera manufacturers. Used in IFD 0 of DNG files. 406 Appendix I - TIFF Tags 1Content for base and extended tags 407 used by permission of the author, Max Maischein. Index: -1 error code – -43 error code -22 error code 363 Index -23 error code 363 - -24 error code 363 -1 error code 362 -25 error code 363 -10 error code 362 -26 error code 363 -100 error code 365 -27 error code 363 -101 error code 365 -28 error code 363 -102 error code 365 -29 error code 363 -103 error code 366 -3 error code 362 -104 error code 366 -30 error code 363 -105 error code 366 -31 error code 363 -106 error code 366 -32 error code 363 -11 error code 362 -33 error code 363 -12 error code 363 -34 error code 364 -13 error code 363 -35 error code 364 -14 error code 363 -36 error code 364 -15 error code 363 -37 error code 364 -16 error code 363 -38 error code 364 -17 error codee 363 -39 error code 364 -18 error code 363 -4 error code 362 -19 error code 363 -40 error code 364 -2 error code 362 -41 error code 364 -20 error code 363 -42 error code 364 -21 error code 363 -43 error code 364 408 Index: -44 error code – Alias Name -44 error code 364 2 -45 error code 364 24-bit images 56 -46 error code 364 3 -47 error code 365 32-bit 343 -48 error code 365 32 bit 343 -5 error code 362 6 -52 error code 365 -53 error code 365 64-bit 344 -54 error code 365 64 bit 344 -55 error code 365 A -56 error code 365 ABIC 303 -57 error code 365 abicplug.dll 325 -6 error code 362 ACCESS_DENIED error code 364 -7 error code 362 additions 38 -8 error code 362 AFP 179, 226, 303, 372 -9 error code 362 file type 316 . AFP Font Mapping 178 AFP resource .NET 4.0 build x64 sample 344 .NET Framework 4.0 46 not displayed 370 AFP troubleshooting overlay 370 1 AFP/MO 219 1 error code 365 Alias Name 334 409 Index: Alias Quality – ASP Multiple Pages sample Alias Quality 138 ASCII Attribute Structure 240 Alpha sample 345 ASCII Standard Page Sizes 242 Alpha_csharp 42, 327 ASCIICHARSPERLINE 242 Alpha_VB 42, 327 ASCIIConversion_CSHARP 327 Animate sample 345 ASCIIConversion_VB 327 Animate_CSHARP 42, 327 ASCIII text format Animate_VB 42, 327 auto detection 240, 244 Annaction sample 346 ASCIIITALIC 242 annaction_csharp 42, 327 ASCIILINESPERPAGE 242 annaction_VB 42, 327 ASCIIMARGIN 242 annotation ASCIIPAGEHEIGHT 242 create 284 ASCIIPAGEWIDTH 242 create bitmap object 278 ASCIIPOINTSIZE 242 get object 284 ASCIITABSTOP 242 highlight bound box 285 ASCIITYPEFACE 242 read 285-287 ASCIIWEIGHT 242 Annotation Constants 274 ASCIIXDPI 242 Annotation sample 346 ASCIIYDPI 242 Annotation_CSHARP 42, 327 ASP 331 Annotation_VB 42, 327 ASP Conversion sample 348 ASCII 240, 302 ASP Image View sample 348 described 303 ASP Memory Copy sample 348 file type 315 ASP Multiple Pages sample 349 filter bit level support 302 410 Index: ASP.NET Samples – BRK ASP.NET Samples 331 Running 331 B BAD_DISPLAY_AREA error ASPConversion_CSHARP 42, 327 code 362 aspect ratio correction 55 BAD_HANDLE error code 363 ASPImageView_CSHARP 42, 327 BAD_LICENSE_PRIMARY error code 365 ASPImageView_VB 43, 328 ASPMemCopy_CSHARP 43, 328 BAD_LICENSE_SECONDARY error code 365 ASPMemCopy_VB 43, 328 BAD_RETURN error code 362 ASPMultiPage_CSHARP 43, 328 BAD_STRING error code 362 ASPMultiPage_VB 43, 328 Batch_XPS_Convert sample 349 Aspnet_regiis 332 BatchConvert sample 349 Running 331 bi-level images 56 Aspose 108 bit depth 60, 110, 212, 232 Aspose.Cells.dll 325 bitmap object Aspose.Slides.dll 325 create from Snowbound Aspose.Total.Product.Family.lic 325 Aspose.Words.dll 325 Assembly.LoadFrom 341 auto detection ASCII text format 240, 244 object 277-278 BMP_COMPRESSED 303 file type 314 BMP_UNCOMPRESSED 303 file type 314 AUTOFEED_FAILED error code 364 BOM 105 automatically detecting 59 bool_repaintBackground 120 BRK defined 303 411 Index: BROOK_TROUT – CIMG_create_handle_keep BROOK_TROUT CIFF 304 file type 314 file type 316 build CIMG_animate 132 32-bit 343 CIMG_antique_effect 196 65-bit 344 CIMG_apply_profile 196 byte order mark 105 C CIMG_auto_orient 197 CIMG_auto_orient Function 187 CIMG_autocrop_bitmap 197 CALS described 303 file type 314 CANT_CREATE_FILE error code 362 CANT_FIND_TWAIN_DLL error code 363 CIMG_bayer_color 235 CIMG_bayer_mono 235 CIMG_bitmap_info 143 CIMG_bitmap_palette 132 CIMG_cmyk_to_rgb 228, 230 CASCIITEXTATTR 299 CIMG_color_combine 228 CCITT_G3 303 CIMG_color_gray 232 file type 315 CCITT_G3_FO 303 file type 315 CCITT_G4 303 file type 315 CIMG_color_separate 229 CIMG_create_bitmap_class 96 CIMG_create_bitmapsource_ annotation 278 CIMG_create_bitmapsource_ class 277 CCITT_G4_FO 303 CIMG_create_handle 96 file type 315 CIMG_create_handle_ddb 97 CFF 303 CIMG_create_handle_keep 97 file type 316 412 Index: CIMG_create_thumbnail – CIMG_ifl_version CIMG_create_thumbnail 198 CIMG_dib_to_runs 201 CIMG_decompress_bitmap 80 CIMG_diffusion_mono 236 CIMG_decompress_bitmap_ CIMG_display_bitmap 120 display 82 CIMG_decompress_bitmap_fd 83 CIMG_decompress_bitmap_ CIMG_display_bitmap_aspect 122 CIMG_display_bitmap_transp 123 CIMG_display_ddb 123 FlexSnap 83 CIMG_display_ddb_effect 133 CIMG_decompress_bitmap_mem 84 CIMG_display_fit_to_height 124 CIMG_decompress_bitmap_page 85 CIMG_display_fit_to_width 125 CIMG_decompress_bitmap_url 86 CIMG_erase_rect 201 CIMG_decompress_bitmap_xps 86, 289 CIMG_decompress_bitmap_xps_ mem 289 CIMG_flip_bitmapx 201 CIMG_flip_bitmapy 202 CIMG_get_bitmap_palette 144 CIMG_decompress_fax 87 CIMG_get_croprect 145 CIMG_decompress_fax_mem 88 CIMG_get_deskew_angle 202 CIMG_decompress_tiled_bitmap 88 CIMG_get_display_rect 145 CIMG_delete_bitmap 184 CIMG_get_pages_WPF 280 CIMG_delete_bitmap_keep 185 CIMG_get_pages_xps 287 CIMG_deskew_bitmap 199 CIMG_get_pages_xps_mem 288 CIMG_deskew_bitmap Function 187 CIMG_get_profile 203 CIMG_despeckle_bitmap 199 CIMG_get_version 146 CIMG_despeckle_bitmap CIMG_halftone_mono 237 Function 188 CIMG_histogram_equalize 203 CIMG_dib_to_ddb 200 CIMG_ifl_version 147 413 Index: CIMG_invert_bitmap – CIMG_SEARCH_RESULT CIMG_invert_bitmap 204 CIMG_save_mem 171 CIMG_mediancut_color 234 CIMG_save_mem_page 171 CIMG_merge_bitmap 205 CIMG_scan_acquire 70 CIMG_merge_bitmap_alpha 208 CIMG_scan_acquire_feeder 71 CIMG_octree_color 234 CIMG_scan_acquire_feeder_fast 72 CIMG_popularity_color 233 CIMG_scan_acquire_feeder_fast_ CIMG_print_bitmap 52 CIMG_print_bitmap_fast 52 WPF 279 CIMG_scan_acquire_feeder_ WPF 279 CIMG_process_bitmap 209 CIMG_scan_acquire_WPF 278 CIMG_promote_24 227 CIMG_scan_feeder_close 72 CIMG_promote_32 227 CIMG_scan_get_cap 73 CIMG_promote_8 226 CIMG_scan_get_cap_WPF 282 CIMG_remove_red_eye 210 CIMG_scan_open_source 73 CIMG_resize_bitmap 211 CIMG_scan_open_source_WPF 280 CIMG_resize_bitmap_interp 212 CIMG_scan_pages 74 CIMG_resize_to_gray 232 CIMG_scan_pages_fast 75 CIMG_rgb_to_cmyk 227 CIMG_scan_pages_WPF 281 CIMG_rotate_bitmap 213 CIMG_scan_set_cap 76 CIMG_runs_to_dib 214 CIMG_scan_set_cap_WPF 282 CIMG_save_bitmap 110 CIMG_scan_set_caps 76 CIMG_save_bitmap_fd 111 CIMG_scan_setup 77 CIMG_save_bitmap_mem 112 CIMG_scan_setup_WPF 283 CIMG_save_document 222 CIMG_SEARCH_RESULT 298 CIMG_save_document_mem 224 414 Index: CIMG_set_croprect – CIMGLOW_get_tiff_tag_page CIMG_set_croprect 125 CIMGLOW_get_anim_delay 148 CIMG_set_croprect_scroll 126 CIMGLOW_get_ascii 244 CIMG_set_display_angle 214 CIMGLOW_get_ascii_page 245 CIMG_set_encrypt 114 CIMGLOW_get_auto_detect 148 CIMG_set_gamma 134 CIMGLOW_get_bitmap_header 149 CIMG_set_lut 135 CIMGLOW_get_bitmap_name 149 CIMG_sharpen_bitmap 215 CIMGLOW_get_custstring 150 CIMG_thresh_mono 236 CIMGLOW_get_fileinfo 150 CIMG_unload_plugins 185 CIMGLOW_get_fileinfo_fd 151-152 CIMG_window_level 135 CIMGLOW_get_fileinfo_page 152 CIMG_zoom_bitmap 127 CIMGLOW_get_filetype 153 CIMG_zoom_bitmap_1_to_1 127 CIMGLOW_get_filetype_fd 153 CIMG_zoom_bitmap_rect 128 CIMGLOW_get_filetype_mem 154 CIMGLOW_append_page 172 CIMGLOW_get_filetype_url 154 CIMGLOW_auto_invert Function 189 CIMGLOW_get_image_orientation_ CIMGLOW_autocolor 136 CIMGLOW_detect_blank_page Function 190 CIMGLOW_get_pages 155 CIMGLOW_get_pages_fd 156 CIMGLOW_extract_page 175 CIMGLOW_get_pages_mem 157 CIMGLOW_extract_page_mem 175 CIMGLOW_get_pages_url 157 CIMGLOW_extract_text 172, 219 CIMGLOW_get_palette 215 CIMGLOW_extract_text_mem 221 CIMGLOW_get_raster 216 CIMGLOW_extract_text_mem_ CIMGLOW_get_tiff_tag 158 pointer 174 415 page 155 CIMGLOW_get_tiff_tag_page 159 Index: CIMGLOW_get_tiff_tag_page_fd() – CIMGLOW_set_html_input CIMGLOW_get_tiff_tag_page_fd() 160 CIMGLOW_get_tiff_tag_page_mem() CIMGLOW_set_alias_quality 137 CIMGLOW_set_ascii 245 CIMGLOW_set_auto_detect 90 160 CIMGLOW_set_bitmap_header 163 CIMGLOW_get_tile_info 161 CIMGLOW_set_bitmap_name 185 CIMGLOW_get_transp_color 162 CIMGLOW_set_comp_quality 114 CIMGLOW_image_dilation Function 191 CIMGLOW_image_erosion Function 192 CIMGLOW_is_tiled_image 162 CIMGLOW_set_decomp 91 CIMGLOW_set_decomp_rect 90 CIMGLOW_set_decomp_ reduction 91 CIMGLOW_map_image_to_wnd 128 CIMGLOW_set_decompsize 92 CIMGLOW_map_wnd_to_image 129 CIMGLOW_set_dithermode 138 CIMGLOW_ooxml_license_enable() CIMGLOW_set_document 164 108 CIMGLOW_put_palette 216 CIMGLOW_put_raster 217 CIMGLOW_set_document_input 165166, 177 CIMGLOW_set_document_page_size (int, int, int) 167 CIMGLOW_read_pixel 163 CIMGLOW_set_fontmap 178 CIMGLOW_remove_halftone Function 192 CIMGLOW_remove_holepunch Function 193 CIMGLOW_remove_lines Function 193 CIMGLOW_search_text 176 CIMGLOW_set_fontmap_path 178 CIMGLOW_set_html_capabilities 100 CIMGLOW_set_html_home_dir 101 CIMGLOW_set_html_image_ capability 102 CIMGLOW_set_html_input 99 CIMGLOW_set_alias 137 416 Index: CIMGLOW_set_html_javascript_capability – COMPRESSION_NOT_SUPPORTED error CIMGLOW_set_html_javascript_ capability 102 CIMGLOW_set_html_page_size 99 CIMGLOW_set_html_page_size_ CIMGLOW_set_tiff_indexing 186 CIMGLOW_set_tiff_save_strips 117 CIMGLOW_set_tiff_tag 118 CIMGLOW_set_transp_color 141 ratio 103 CIMGLOW_set_wipedelay 141 CIMGLOW_set_html_page_size_ ratio_capability 103 CIMGLOW_unset_auto_detect 95 CIMGLOW_set_html_screen_dpi 104 CIMGLOW_write_tiff_stream 113 CIMGLOW_set_html_use_page_ CIMS breaks_exclusively 104 CIMGLOW_set_image_ file type 316 CIMS (ABIC) orientation 115 described 304 CIMGLOW_set_imnet_page_size 139 clearImage 65 CIMGLOW_set_jpeg_ decompression 92 CIMGLOW_set_jpeg2000_comp_ ratio 116 file type 304, 314 COD CIMGLOW_set_jpg_interleave 116 file type 304, 315 CIMGLOW_set_ooxml_license 108 color 60, 110, 212, 232 CIMGLOW_set_overlay_path 93 color page input 179, 226, 372 CIMGLOW_set_pdf_flags 181 color page ouput 179, 226, 372 CIMGLOW_set_pdf_fontpath 181 color reduction 61 CIMGLOW_set_pdf_output 117 compatible CIMGLOW_set_pdf_password 94 input and output 60 CIMGLOW_set_pdfa_fontpath 182 COMPRESSION_NOT_ CIMGLOW_set_rop 139 417 CLIP SUPPORTED error code 363 Index: Contrast sample – CSANN_mouse Contrast sample 350 CSANN_create_ann_WPF 284 Contrast_CSHARP 43, 328 CSANN_deactivate_all 255 Contrast_VB 43, 328 CSANN_deactivate_object 256 conversion CSANN_delete_all_objects 256 error 61 output too large 61 takes too long 61 Conversion sample 351 Conversion_CSHARP 43, 328 Conversion_VB 43, 328 Convert_doc sample 351 converting file formats 59 CORRUPTED_FILE error code 362 CSANN_delete_non_text_ objects 256 CSANN_delete_object 257 CSANN_delete_text_objects 257 CSANN_display_annotations 257 CSANN_draw_object 258 CSANN_FlipX 259 CSANN_FlipY 259 CSANN_get_croprect 259 CSANN_get_disprect 259 create bitmap object from Snowbound object 277-278 CSANN_get_object_bounds 260 CSANN_get_object_data 260 CSANN_activate_all 251 CSANN_get_object_info 261 CSANN_activate_object 252 CSANN_get_object_num 261 CSANN_add_object 252 CSANN_get_object_num_WPF 284 CSANN_choose_color 253 CSANN_highlight_object 262 CSANN_choose_font 253 CSANN_highlight_object_WPF 285 CSANN_choose_line_style 254 CSANN_map_image_to_wnd 262 CSANN_choose_line_width 254 CSANN_map_wnd_to_image 263 CSANN_create_ann 255 CSANN_mouse 263 418 Index: CSANN_move_object – DIB CSANN_move_object 264 CSANN_write_ann_mem 273 CSANN_print_annotations 264 CSANN_write_ann_mem_page 273 CSANN_read_ann 265 CSANN_write_ann_page 274 CSANN_read_ann_FlexSnap 265 CSV 304 CSANN_read_ann_mem 266 CustomPaint 67 CSANN_read_ann_mem_page 266 CUT CSANN_read_ann_mem_page_ file type 304, 315 WPF 286 D CSANN_read_ann_mem_WPF 287 DCS CSANN_read_ann_page 267 file type 304, 315 CSANN_read_ann_page_WPF 286 DCX CSANN_read_ann_WPF 285 defined 304 CSANN_resize_object 267 file type 314 CSANN_rotate 267 ddbeffect_CSHARP 43, 328 CSANN_set_bcolor 268 ddbeffect_VB 43, 328 CSANN_set_croprect 268 decompress CSANN_set_disprect 269 XPS file 289 CSANN_set_fcolor 269 decompressing mult-pages 49 CSANN_set_font 270 DELETE_ERROR error code 366 CSANN_set_line_style 270 Device Independent Bitmap 247 CSANN_set_line_width 271 DIB CSANN_set_size 271 described 304 CSANN_write_ann 272 file type 315 CSANN_write_ann_FlexSnap 273 419 Index: DICOM – erro code DICOM described 304 DXF file type 305, 316 file type 315 dilation 191 DISK_FULL error code 362 DISK_READ_ERROR error code 363 display quality 56 DISPLAY_ERRORerror code 366 DLL_NOT_LOADED error code 363 DOC described 304 file type 316 DocAddress 339 docplug.dll 325 Document Conversion 219 DOCX described 304 file type 316 double_calcAspectZoom 129 DPI 56, 60 changing 164 DWG file type 305, 316 E EMAIL 305 Encrypt_csharp 43, 328 Encrypt_VB 43, 328 Encryption sample 353 EOF 173, 221 EOI 174, 221 EOT 174, 221 EOTU 174, 221 EPS described 305 file type 314 EPS_BITMAP file type 305, 315 EPS_BITMAP_G4 file type 305, 315 EPS_BITMAP_LZW file type 305, 315 erosion 192 erro code -6 362 dwgplug.dll 325 420 Index: error code – error code 421 error code -24 363 -1 362 -25 363 -10 362 -26 363 -100 365 -27 363 -101 365 -28 363 -102 365 -29 363 -103 366 -3 362 -104 366 -30 363 -105 366 -31 363 -106 366 -32 363 -11 362 -33 363 -12 363 -34 364 -13 363 -35 364 -14 363 -36 364 -15 363 -37 364 -16 363 -38 364 -17 363 -39 364 -18 363 -4 362 -19 363 -40 364 -2 362 -41 364 -20 363 -42 364 -21 363 -43 364 -22 363 -44 364 -23 363 -45 364 Index: error codeZ – error code -46 364 SUPPORTED 363 -47 365 CORRUPTED_FILE 362 -48 365 DELETE_ERROR 366 -5 362 DISK_FULL 362 -52 365 DISK_READ_ERROR 363 -55 365 DISPLAY_ERROR 366 -56 365 DLL_NOT_LOADED 363 -57 365 ERROR_OPENING_ -7 362 -8 362 -9 362 SCANNER 363 EVAL_TIMEOUT 363 EXCEPTION_ERROR 364 FEEDER_NOT_READY 363 1 365 ACCESS_DENIED 364 AUTOFEED_FAILED 364 FILE_NOT_FOUND 362 FONT_FONT_PATH_FOLDER_ IS_EMPTY 365 BAD_DISPLAY_AREA 362 FONT_PATH_FOLDER_ BAD_HANDLE 363 BAD_LICENSE_PRIMARY 365 BAD_LICENSE_ SECONDARY 365 MISSING_FONTS 365 FONT_PATH_FOLDER_NOT_ FOUND 365 FONT_PATH_FOLDER_TOO_ BAD_RETURN 362 FEW_FONTS 365 BAD_STRING 362 FORMAT_NOT_ALLOWED 362 CAN_CREATE_FILE 362 FORMAT_WILL_NOT_ OTFLY 363 CANT_FIND_TWAIN_DLL 363 GENERAL_ COMPRESSION_NOT_ STATUS.DEFAULT 365 422 Index: error codeZ – error code GENERAL_STATUS.DELETE_ ERROR 365 GENERAL_STATUS.DISPLAY_ NO_PDF_VERSION 364 NO_SCANNER_FOUND 363 NO_TCOLOR_FOUND 363 ERROR 366 NO_VECTOR_CAPABILITY 364 GENERAL_STATUS.IMAGE_ NOT_AVAILABLE 366 GENERAL_STATUS.NET_ VALID 366 GENERAL_ STATUS.SNOWBND_API_ NO_WORD_VERSION 364 NOT_A_TILED_IMAGE 363 NOT_SUPPORTED_IN_THIS_ VERSION 363 NOT_VALID 366 NOT_AVAILABLE 366 OOXML_LICENSE_ GENERAL_ EXPIRED 365 STATUS.SNOWBND_ OK 365 OOXML_LICENSE_NOT_ FOUND 365 GENERAL_STATUS.SYSTEM_ CRASH 365 IMAGE_NOT_AVAILABLE 366 METHOD_NOT_FOUND 364 OUT_OF_MEMORY 362 PAGE_NOT_FOUND 362 PALETTE_IMAGE_NOT_ ALLOWED 363 NO_ABIC_VERSION 364 PASSWORD_PROTECTED_ NO_BITMAP_FOUND 362 NO_CLIPBOARD_IMAGE 363 NO_DELAY_TIME_FOUND 363 NO_FAST_TWAIN_ SUPPORTED 364 NO_JPEG2000_VERSION 364 FILE 365 PASSWORD_PROTECTED_ PDF 364 PIXEL_DEPTH_ UNSUPPORTE 363 SEARCH_STRING_NOT_ FOUND 364 NO_MORE_PAGES 363 SNOWBND_API_NOT 366 NO_PCL_VERSION 364 423 Index: error codeZ – file type SNOWBND_OK 366 file type SYSTEM_CRASH 366 AFP 316 TIFF_TAG_NOT_FOUND 363 ASCII 315 USER_CANCEL 363 BMP_COMPRESSED 314 USING_RUNTIME 363 BMP_UNCOMPRESSED 314 error codeZ BROOK_TROUT 314 NO_LZWZ_VERSION 363 CALS 314 error during conversion 61 CCITT_G3 315 ERROR_OPENING_SCANNER error CCITT_G3_FO 315 code 363 CCITT_G4 315 EVAL_TIMEOUT error code 363 evaluation version CCITT_G4_FO 315 CFF 316 installing 318 CIFF 316 Excel 179, 226, 372 EXCEL CIMS 316 CLIP 304, 314 file type 316 COD 304, 315 EXCEPTION_ERROR error code 364 F CUT 304, 315 DCS 304, 315 fast printing 51 DCX 314 FEEDER_NOT_READY error DIB 315 code 363 file formats automatically detecting 59 converting 59 DICOM 315 DOC 316 DOCX 316 DWG 305, 316 424 Index: file type constants – file formats 425 DXF 305, 316 LINE_DATA 307, 316 EPS 314 MACPAINT 307, 314 EPS_BITMAP 305, 315 MAG 307, 315 EPS_BITMAP_G4 305, 315 MSG 316 EPS_BITMAP_LZW 305, 315 MSP 307, 315 EXCEL 316 NCR 315 FILENET 316 ODF 316 FLASHPIX 305, 315 ODP 316 GIF 314 ODS 316 GIF_INTERLACED 315 ODT 316 GX2 305, 314 OOXML 316 HTML 316 PCL_1 315 ICONTYPE 306, 314 PCL_5 316 IFF_ILBM 306, 314 PCX 314 IMG 306, 314 PDF 315 IMNET 315 PDF_15 316 IOCA 314 PDF_16 316 JBIG 315 PDF_A 316 JBIG2 316 PDF_LZW 316 JEDMICS 315 PHOTOCD 310, 315 JPEG 314 PHOTOSHOP 310, 315 JPEG2000 315 PICT 310, 314 KOFAX 306, 314 PNG 315 LASER_DATA 307, 314 POWER_POINT 316 Index: file type constants – FONT_FONT_PATH_FOLDER_IS_EMPTY error code PPTX 316 WPG 313-314 RAST 311, 315 XBM 313-314 RTF 316 Xerox_EPS 313, 315 SCITEX 311, 315 XLS 313 SVG 316 XLSX 313, 316 TARGA 311, 314 XPM 314-315 TARGA16 311, 315 XWD 314-315 TIF_G4_FAX_STRIP 312, 315 file type constants TIF_HUFFMAN 312, 314 PDF_15 308 TIFF_2D 311, 314 PDF_16 309 TIFF_ABIC 312, 315 FILE_NOT_FOUND error code 362 TIFF_ABIC_BW 312, 315 FileMem sample 353 TIFF_G3_FAX 312, 314 FileMem_CSHARP 43 TIFF_G4_FAX 312, 314 filename extension 370 TIFF_G4_FAX_FO 312, 315 FileNet TIFF_JBIG 315 TIFF_JPEG 312, 315 TIFF_JPEG7 312, 315 TIFF_LZW 313-314 TIFF_PACK 313-314 TIFF_UNCOMPRESSED 314 WBMP 313, 315 WINFAX 313, 315 WMF 313-314 defined 305 FILENET file type 316 files redistributed 318 FLASHPIX file type 305, 315 FONT_FONT_PATH_FOLDER_IS_ EMPTY error code 365 426 Index: FONT_PATH_FOLDER_MISSING_FONTS error code – GIF FONT_PATH_FOLDER_MISSING_ GENERAL_STATUS.IMAGE_NOT_ FONTS error code 365 FONT_PATH_FOLDER_NOT_ AVAILABLE 296 GENERAL_STATUS.IMAGE_NOT_ FOUND error code 365 FONT_PATH_FOLDER_TOO_FEW_ AVAILABLE error code 366 GENERAL_STATUS.NOT_ FONTS error code 365 Format For Decompressed VALID 296 GENERAL_STATUS.NOT_VALID Images 247 FORMAT_NOT_ALLOWED error error code 366 GENERAL_STATUS.SNOWBND_ code 362 API_NOT_AVAILABLE 296 FORMAT_WILL_NOT_OTFLY error GENERAL_STATUS.SNOWBND_ code 363 API_NOT_AVAILABLE error code 366 G GENERAL_STATUS.SNOWBND_ General Error Define 296 General Status Error 366 ERROR 296, 366 GENERAL_STATUS.SNOWBND_ OK 296 GENERAL_STATUS.DEFAULT 296 GENERAL_STATUS.DEFAULT error GENERAL_STATUS.SNOWBND_ OK error code 365 code 365 GENERAL_STATUS.DELETE_ GENERAL_STATUS.SYSTEM_ CRASH 296 ERROR 296 GENERAL_STATUS.DELETE_ GENERAL_STATUS.SYSTEM_ CRASH error code 365 ERROR error code 365 GENERAL_STATUS.DISPLAY_ ERROR 296 GENERAL_STATUS.DISPLAY_ ERROR error code 366 427 GIF described 305 file type 314 Index: GIF_INTERLACED – IMG_decompress_bitmap(java.awt.Image, int) GIF_INTERLACED described 305 IIS 7.5 work with RasterMaster.Net 373 file type 315 image GlobalAlloc 112 dilation 191 GlobalLock 112 erosion 192 GX2 return orientation 187 file type 305, 314 H rotate 187 image compression 1-bit bi-level images 58 halftone 24-bit color images 58 remove 192 8-bit gray scale images 58 hole punch preferred formats 58 remove 193 Image File Directories (IFDs) 374 HPALETTE 144 Image Processing sample 353 HTML Image Saving Functions 110 described 306 file type 315-316 IMAGE_NOT_AVAILABLE error code 366 htmlplug.dll 325 ImageProcessing_CSHARP 44, 329 I ICONTYPE file type 306, 314 IFF_ILBM file type 306, 314 IIS 331 ImageProcessing_VB 44, 329 ImageWidth 223 IMG file type 306, 314 IMG_decompress_bitmap (java.awt.Image, int) 179, 226, 372 428 Index: IMGLOW_detect_color – LASER_DATA IMGLOW_detect_color 179, 226, 372 IMGLOW_get_tiff_tag 374 IMGLOW_set_document_input 166, 179, 226, 372 IMGLOW_set_pcl_input Function 192 IMGLOW_set_tiff_tag 374 IMNET file type 315 JBIG2 defined 306 file type 316 JEDMICS described 306 file type 315 described 306 jp2plug.dll 325 file type 315 JPEG input described 306 color page 179, 226, 372 input compatible with output 60 input document quality 60 input quality 61 file type 314 JPEG2000 defined 306 file type 315 invert K color 189 KOFAX IOCA file type 306, 314 described 306 L file type 314 large documents isValidImage 65 printing 53 J LASER_DATA jb2plug.dll 325 file type 307, 314 JBIG defined 306 429 Index: LINE_DATA – NCR LINE_DATA MIME file type 307, 316 lines file type 316 MO remove 193 DCA 179, 226, 372 loation MODCA OOXML license file 108 lossy compression 61 low output; adjusting quality 60-61 M MACPAINT file type 307, 314 defined 307 MODCA resource not displayed 370 MODCA troubleshooting overlay 370 MS Windows DIB Header 248 MS Windows DIB Image 249 MAG file type 307, 315 memcopy_csharp 44, 329 Memcopy_VB 44, 329 memory requirements 47 Memory Copy sample 354 memory requirements 47 MS Windows DIB Palette 248 MSG file type 316 MSP file type 307, 315 multi-page format 50 multi-page images 49 Merge Image sample 354 mergeimage_CSHARP 44, 329 METHOD_NOT_FOUND error code 364 N NCR defined 307 file type 315 430 Index: NO_ABIC_VERSION error code – OOXML NO_ABIC_VERSION error code 364 NOT_SUPPORTED_IN_THIS_ VERSION error code 363 NO_BITMAP_FOUND error code 362 NO_CLIPBOARD_IMAGE error code 363 NO_DELAY_TIME_FOUND error NOT_VALID error code 366 NOTSRCCOPY 140 NOTSRCERASE 140 code 363 O NO_FAST_TWAIN_SUPPORTED error code 364 NO_JPEG2000_VERSION error code 364 NO_LZW_VERSION error code 363 NO_MORE_PAGES error code 363 NO_PCL_VERSION error code 364 ODF defined 307 file type 316 ODP file type 316 ODS NO_PDF_VERSION error code 364 defined 307 NO_SCANNER_FOUND error file type 316 code 363 ODT NO_TCOLOR_FOUND error code 363 NO_VECTOR_CAPABILITY error code 364 NO_WORD_VERSION error code 364 noise removal 188 normal printing 51 NOT_A_TILED_IMAGE error code 363 defined 307 file type 316 Office 179, 226, 372 OnPaint 68 OnPaintBackground 68 OnSizeChanged 68 OOXML defined 307 file type 316 431 Index: OOXML license file – PCL_5 OOXML license file load 108 Page sample 355 page_csharp 44, 329 OOXML_LICENSE_EXPIRED error code 365 PAGE_NOT_FOUND error code 362 Page_VB 44, 329 OOXML_LICENSE_NOT_FOUND pages error code 365 XPS file format 287-288 ooxmlplug.dll 325 palette 59, 110, 212 operating system PALETTE_IMAGES_NOT_ 32-bit 343 ALLOWED error code 363 64-bit 344 Panning sample 355 orientation panning_csharp 44, 329 image 187 panning_VB 44, 329 OUT_OF_MEMORY error code 362 PASSWORD_PROTECTED_FILE output error code 365 color page 179, 226, 372 PASSWORD_PROTECTED_PDF error code 364 resolution 164 path overlay AFP troubleshooting 370 MODCA troubleshooting 370 save scanning 281 PCL defined 307 P PCL_1 307 page content file type 315 truncated xls 370 PCL_5 truncated xlsx 370 defined 307 page count 49 file type 316 432 Index: pclplug.dll – Print sample pclplug.dll 325 PCX 308 file type 314 PDF 99, 104, 139, 151-153, 164-165, 240, 291, 299-300 defined 308 file type 315 filter bit level support 302 PHOTOCD file type 310, 315 PHOTOSHOP file type 310, 315 PICT file type 310, 314 pixel depth 60 PIXEL_DEPTH_ raster 293 vector 293 UNSUPPORTED 60, 302 PIXEL_DEPTH_UNSUPPORTED error code 363 PDF output 110 PDF v1.4 308-310 PDF/A 308-310 PDF_15 file type 308, 316 PDF_16 file type 309, 316 PDF_A file type 316 PDF_LZW 310 file type 316 pdfplug.dll 325 performance 369-370 pixels percentage 190 PNG described 311 file type 315 POWER_POINT described 311 file type 316 PowerPoint 179, 226, 372 PPTX described 311 file type 316 Print sample 355 433 Index: Print_CSHARP – resolution Print_CSHARP 44, 329 Print_VB 44, 329 RasterMaster version printing 51 get 147 Printing RasterMaster .NET x32 large documents 53 production version work with IIS 7.5 373 RasterMaster 18.0 library 372 installing 318 Read/Write Capabilities 302 public_class 298 redactions 250 public_class_CANN 250 redistributables 373 public_class_CDIB_HEADER 300 Reference 336 public_class_CIMG_RECT 297 remove public_class_CIMG_SEARCH 297 halftone 192 public_class_CSEARCH_TEXT 300 hole punch 193 public_class_CTIFF_TAG 300 Q remove lines 193 removeScrollbars 130 requirements quality adjusting low output 60 memory 47 resize 198 R zoom 198, 211 RAST resolution 56, 60, 99, 104, 139, 151file type 311, 315 raster PDF 293 153, 164-165, 240, 291, 299-300 changing 164 output 164 434 Index: return – SimpleMultiPages_VB return scan fast memory transfer scanning 280 fast memory transfer 279 number of pages in XPS file 287 get cap 282 orientation of image 187 image on currently installed scanner 278 pointer to number of pages in XPS file 288 image on scanner with automatic document feeder 279 rotate saves the path/filename 281 image 187 set cap 282 RTF setup parameters 283 described 311 Scan sample 356 file type 316 Scan_CSHARP 44, 329 Running 331 ASP.NET Samples 331 aspnet_regiis 332 running a sample 343 Scan_VB 44, 329 SCITEX file type 311, 315 Screen_Display_Dither 138 S SEARCH_STRING_NOT_FOUND samples build x32 with .NET 2.0 344 build x64 with .NET 4.0 344 error code 364 Set Up 339 Web Image Viewer Component 339 saving multi-page file 49 sbdnet.dll 372 sbdNetAnn.dll 325 435 setup scan parameters 283 SbdNetAnn.dll 325, 372 SimpleMultiPages_CSHARP 44, 329 SbdNetLib.Snowbnd 341 SimpleMultiPages_VB 44, 329 Index: Snowbnd() – TIFF_G4_FAX_STRIP Snowbnd() 62 TARGA16 Snowbnd(int, int, int) 63 file type 311, 315 SNOWBND_API_NOT error code 366 Text Search sample 357 SNOWBND_OK error code 366 textsearch_CSHARP 44, 329 SnowbndCNet_HScrollBar 78 textsearch_VB 44, 329 SnowbndCNet_VScrollBar 78 third party viewers 371 Snowbound ASCII 240 TIFF Snowbound Error Codes 362 SnowPanel Class Specific Methods 67 SOF 173, 221 read tag 374 Tiff Tag sample 358 TIFF tags 374 TIFF_2D SOI 174, 221 file type 311, 314 SOT 174, 221 TIFF_ABIC SOTU 174, 221 file type 312, 315 Split to Multiple Pages sample 356 supported multi-page formats 49 SVG TIFF_ABIC_BW file type 312, 315 TIFF_G3_FAX file type 316 file type 312, 314 SYSTEM_CRASH error code 366 T tag specifications 374 TARGA file type 311, 314 TIFF_G4_FAX file type 312, 314 TIFF_G4_FAX_FO file type 312, 315 TIFF_G4_FAX_STRIP file type 312, 315 436 Index: TIFF_HUFFMAN – variables TIFF_HUFFMAN file type 312, 314 TIFF_JBIG file type 315 TIFF_JPEG 371 file type 312, 315 TIFF_JPEG7 file type 312, 315 TIFF_LZW file type 313-314 larger file size 367 lower quality 368 missing characters 369 output differs 367 third party viewers 371 TIFF_JPEG 371 unknown file format 370 truncated page content 370 Type Property Define 295 TIFF_PACK file type 313-314 TIFF_TAG_NOT_FOUND error U USER_CANCEL error code 363 USING_RUNTIME error code 363 code 363 UTF-16 313 TIFF_UNCOMPRESSED UTF-8 313 described 313 V file type 314 TIFFTag_CSHARP 45, 330 TIFFTag_VB 45, 330 variables CIMGLOW_get_ooxml_license_ location 108 ToErrorMessage 66 CIMGLOW_set_html_home_ troubleshooting 367 corrupted file 370-371 error code 367 improving performance 369 437 dir 101 CIMGLOW_set_html_image_ capability 102 CIMGLOW_set_html_input 99 Index: vector PDF – xls CIMGLOW_set_html_javascript_ WMF capability 103 CIMGLOW_set_html_page_ file type 313-314 Word 179, 226, 372 size 99 WPF 276-287 CIMGLOW_set_html_page_size_ ratio 103 CIMGLOW_set_html_page_size_ WPF Image sample 360 WPFAnnotation_CSHARP sample 359 ratio_capability 104-105 CIMGLOW_set_html_screen_ dpi 104 WPFConversion sample 359 WPFScanning sample 360 vector PDF 293 WPG VectorConvertMem_CSHARP file type 313-314 sample 361 X version x32 get 147 build sample with .NET 2.0 344 W x64 watermarks 250 build sample with .NET 4.0 344 WBMP x86 platform 373 file type 313, 315 XBM Web Image Viewer Component 339 file type 313-314 Set Up 339 Xerox_EPS Web Image Viewer Component file type 313, 315 sample 358 WINFAX file type 313, 315 xls truncated page content 370 438 Index: XLS – ZOOM_ASPECT.ASPECT_ZOOM XLS ZOOM_ASPECT.ASPECT_FIT_TO_ WIDTH 295 file type 313 ZOOM_ASPECT.ASPECT_ONE_ xlsx TO_ONE 295 truncated page content 370 ZOOM_ASPECT.ASPECT_ XLSX PRESERVE 295 file type 313, 316 ZOOM 295 XPM file type 314-315 XPS file return number of pages 287 return pointer to number of pages 288 XPS fle decompress 289 XPSMem sample 361 XWD file type 314-315 filter bit level support 302 Z zoom 127-129, 198, 211, 268, 345, 348, 355 ZOOM_ASPECT.ASPECT_ DEFAULT 295 ZOOM_ASPECT.ASPECT_FIT_TO_ HEIGHT 295 439 ZOOM_ASPECT.ASPECT_