Preview only show first 10 pages with watermark. For full document please download

Perceptive Document Filters Implementation Guide

   EMBED


Share

Transcript

Perceptive Document Filters Implementation Guide Version: 11.2 (Build 1962) Written by: Product Knowledge, R&D Date: June 2017 © 2015 Lexmark International Technology, S.A. All rights reserved. Lexmark is a trademark of Lexmark International Technology, S.A., or its subsidiaries, registered in the U.S. and/or other countries. All other trademarks are the property of their respective owners. No part of this publication may be reproduced, stored, or transmitted in any form without the prior written permission of Lexmark. Perceptive Document Filters Implementation Guide Table of Contents Getting started with Perceptive Document Filters ................................................................................ 10 Language-specific integration examples ................................................................................................. 10 Download Perceptive Document Filters files ........................................................................................... 11 Create a C API (native library functions) application ............................................................................... 11 Create a C++ API (class wrapper around native library functions) application ....................................... 11 Create a Java API application ................................................................................................................. 11 Create a COM API application ................................................................................................................ 12 Create a .NET API (C# and VB.net) application ..................................................................................... 12 Create a Python API application ............................................................................................................. 12 About multithreading ................................................................................................................................ 13 About font mapping ................................................................................................................................. 13 Adding fonts ......................................................................................................................................... 13 Font aliases .......................................................................................................................................... 14 Character mapping .............................................................................................................................. 14 Diagnostics .......................................................................................................................................... 14 About multi-part archives ......................................................................................................................... 15 Multi-part archives and extended streams ........................................................................................... 15 About custom streams and extended streams ........................................................................................ 15 About custom streams in C and C++ ................................................................................................... 15 About custom streams in C#, Java, and Python .................................................................................. 15 About Optical Character Recognition (OCR)........................................................................................... 16 Supported platforms ................................................................................................................................. 18 Common use cases .................................................................................................................................. 18 How do I open a document from disk? .................................................................................................... 18 How do I open a document from memory? ............................................................................................. 18 How do I extract metadata from a document? ........................................................................................ 19 How do I extract text and metadata from a document? .......................................................................... 19 How do I extract sub-documents from documents and archives? .......................................................... 19 How do I convert a document to Classic HTML? .................................................................................... 20 How do I convert a document to paginated HiDef HTML? ...................................................................... 20 How do I convert a document to PNG images? ...................................................................................... 21 How do I convert a document to a PDF file? ........................................................................................... 21 How do I convert a document to Structured XML? ................................................................................. 22 C reference ................................................................................................................................................ 23 Init_Instance ............................................................................................................................................ 23 3 Perceptive Document Filters Implementation Guide IGR_Open_File ........................................................................................................................................ 24 IGR_Open_File_Ex ................................................................................................................................. 25 IGR_Open_Stream .................................................................................................................................. 27 IGR_Open_Stream_Ex............................................................................................................................ 28 IGR_Make_Stream_From_File................................................................................................................ 30 IGR_Make_Stream_From_Memory ........................................................................................................ 31 IGR_Extend_Stream ............................................................................................................................... 33 IGR_Get_File_Type ................................................................................................................................. 35 IGR_Get_Stream_Type ........................................................................................................................... 36 IGR_Get_Text ......................................................................................................................................... 37 IGR_Get_Subfile_Entry ........................................................................................................................... 39 IGR_Get_Image_Entry ............................................................................................................................ 40 IGR_Extract_Subfile ................................................................................................................................ 42 IGR_Extract_Subfile_Stream .................................................................................................................. 44 IGR_Extract_Image ................................................................................................................................. 45 IGR_Extract_Image_Stream ................................................................................................................... 47 IGR_Convert_File .................................................................................................................................... 48 IGR_Calculate_MD5 ................................................................................................................................ 49 IGR_Calculate_SHA1 .............................................................................................................................. 50 IGR_Close_File ....................................................................................................................................... 51 IGR_Get_Format_Attribute...................................................................................................................... 52 Close_Instance ........................................................................................................................................ 53 IGR_Get_Page_Count ............................................................................................................................ 53 IGR_Open_Page ..................................................................................................................................... 55 IGR_Redact_Page_Text ......................................................................................................................... 57 IGR_Close_Page ..................................................................................................................................... 58 IGR_Get_Page_Word_Count .................................................................................................................. 59 IGR_Get_Page_Words............................................................................................................................ 61 IGR_Get_Page_Dimensions ................................................................................................................... 63 IGR_Get_Page_Text ............................................................................................................................... 64 IGR_Get_Page_Attribute......................................................................................................................... 65 IGR_Make_Output_Canvas .................................................................................................................... 67 IGR_Make_Output_Canvas_On ............................................................................................................. 69 IGR_Close_Canvas ................................................................................................................................. 70 IGR_Render_Page .................................................................................................................................. 71 IGR_Canvas_Arc ..................................................................................................................................... 73 IGR_Canvas_Chord ................................................................................................................................ 74 4 Perceptive Document Filters Implementation Guide IGR_Canvas_Ellipse ............................................................................................................................... 75 IGR_Canvas_Rect ................................................................................................................................... 76 IGR_Canvas_LineTo ............................................................................................................................... 78 IGR_Canvas_MoveTo ............................................................................................................................. 79 IGR_Canvas_Pie ..................................................................................................................................... 80 IGR_Canvas_RoundRect ........................................................................................................................ 81 Return value ......................................................................................................................................... 82 IGR_Canvas_TextOut ............................................................................................................................. 82 IGR_Canvas_TextRect............................................................................................................................ 83 IGR_Canvas_MeasureText ..................................................................................................................... 84 IGR_Canvas_SetPen .............................................................................................................................. 85 Additional information .......................................................................................................................... 86 IGR_Canvas_SetBrush ........................................................................................................................... 86 Additional information .......................................................................................................................... 87 IGR_Canvas_SetFont ............................................................................................................................. 87 IGR_Canvas_SetOpacity ........................................................................................................................ 88 IGR_Canvas_DrawImage........................................................................................................................ 89 Return value ......................................................................................................................................... 90 IGR_Canvas_DrawScaleImage .............................................................................................................. 90 IGR_Canvas_Rotation............................................................................................................................. 91 IGR_Canvas_Reset ................................................................................................................................. 92 IGR_Multiplex .......................................................................................................................................... 92 Object reference ........................................................................................................................................ 93 Getting started with COM ........................................................................................................................ 93 Getting started with .NET ........................................................................................................................ 93 Getting started with Java ......................................................................................................................... 94 Getting started with Python ..................................................................................................................... 94 Getting started with C++ .......................................................................................................................... 94 DocumentFilters interface........................................................................................................................ 95 DocumentFilters::Initialize method .......................................................................................................... 95 DocumentFilters::GetExtractor method ............................................................................................... 96 DocumentFilters::MakeOutputCanvas method .................................................................................... 98 Extractor interface ................................................................................................................................... 99 Extractor::Open method ....................................................................................................................... 99 Extractor::FileType property .............................................................................................................. 100 Extractor::SupportsText property ....................................................................................................... 102 Extractor::GetText method ................................................................................................................. 102 5 Perceptive Document Filters Implementation Guide Extractor::EOF property ..................................................................................................................... 104 Extractor::SupportsSubFiles property ................................................................................................ 105 Extractor::GetFirstSubFile Extractor::GetFirstImage methods .......................................................... 106 Extractor::GetNextSubFile Extractor::GetNextImage methods ......................................................... 107 Extractor::GetSubFile method ........................................................................................................... 108 Extractor::SaveTo method ................................................................................................................. 109 Extractor::CopyTo method ................................................................................................................. 110 Extractor::GetHashMD5 method Extractor::GetHashSHA1 methods ............................................... 111 Extractor::Close method .................................................................................................................... 112 Extractor::GetFirstPage & Extractor::GetNextPage methods ............................................................ 113 Extractor::GetPageCount method ...................................................................................................... 114 Extractor::GetPage method ............................................................................................................... 114 SubFile interface .................................................................................................................................... 115 SubFile::ID property ........................................................................................................................... 115 SubFile::Name property ..................................................................................................................... 116 SubFile::FileDate property ................................................................................................................. 117 SubFile::FileSize property .................................................................................................................. 118 Page interface ....................................................................................................................................... 118 Page::Close method .......................................................................................................................... 119 Page::WordCount property ................................................................................................................ 120 Page::Width/Height properties ........................................................................................................... 121 Page::Text property ........................................................................................................................... 122 Page::FirstWord/NextWord properties ............................................................................................... 123 Page::FirstImage/NextImage property ............................................................................................... 124 Page::GetAttribute method ................................................................................................................ 125 Page::Redact ..................................................................................................................................... 126 Word interface ....................................................................................................................................... 126 Word::Text property ........................................................................................................................... 127 Word::X/Y properties.......................................................................................................................... 128 Word::Width/Height properties ........................................................................................................... 129 Word::CharacterOffset property ......................................................................................................... 130 Word::WordIndex property ................................................................................................................. 131 Canvas interface .................................................................................................................................... 131 Canvas::Close method....................................................................................................................... 131 Canvas::RenderPage method ........................................................................................................... 132 Canvas::Arc method .......................................................................................................................... 133 Canvas::Chord method ...................................................................................................................... 134 6 Perceptive Document Filters Implementation Guide Return value ....................................................................................................................................... 135 Canvas::Ellipse method ..................................................................................................................... 135 Canvas::DrawImage method ............................................................................................................. 136 Canvas::DrawScaleImage method .................................................................................................... 137 Canvas::Rect method ........................................................................................................................ 138 Canvas::LineTo method ..................................................................................................................... 139 Canvas::MoveTo method ................................................................................................................... 139 Canvas::Pie method........................................................................................................................... 140 Canvas::RoundRect method .............................................................................................................. 141 Canvas::TextOut method ................................................................................................................... 142 Canvas::TextRect method ................................................................................................................. 142 Canvas::TextWidth/TextHeight method ............................................................................................. 143 Canvas::SetPen method .................................................................................................................... 144 Canvas::SetBrush method ................................................................................................................. 145 Canvas::SetFont method ................................................................................................................... 145 Canvas::SetOpacity method .............................................................................................................. 146 Structured XML ....................................................................................................................................... 147 Overview ................................................................................................................................................ 147 element ....................................................................................................................................... 148 element ..................................................................................................................................... 149 element ..................................................................................................................................... 150 element ..................................................................................................................................... 151
/