Home

3-Heights™ PDF Analysis & Repair API, User Manual

image

Contents

1. The Add Reference dialog will appear In the tab Browse browse for the NET assemblies ibpdfNET dll and PdfRepairNET dll add them to the project as shown below NET com Projects Browse Recent Look in FT e e Fe PdfRepairAPT dll ER File name libpdfME T dll PdfRiepairNet dll Files of type 3 Import namespaces Note This step is optional but useful 4 Write Code Steps 3 and 4 are shown separately for C and Visual Basic Visual Basic 3 Double click My Project to view its properties On the left hand side select the menu References The NET assemblies you added before should show up in the upper window In the lower window import the two namespaces Pdftools Pdf and Pdftools PdfRepair PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 22 of 30 July 8 2015 You should now have settings similar as in the screenshot below Application Configuration N A v Platform N A Y Compile Debug References Unused References Reference Paths Reference Name Type version Copy Local Path References libpdfNET NET 1 7 0 13 True C Program Files pdf tools bin libpdf NET dll PdfRepairNet NET 1 7 0 0 True C Program Files pdf tools bin PdfRepairNet dll Resources System NET 2 0 0 0 False CHWINNT Microsoft NET Framework v2 0 50727 5ystem dil System Data NET 2 0 0 0 False C
2. TOOLS COM Premium PDF Technology 3 Heights PDF Analysis Repair API Version 4 5 User Manual Contact pdfsupport pdf tools com Owner PDF Tools AG Kasernenstrasse 1 8184 Bachenb lach Switzerland http www pdf tools com Copyright 2001 2015 3 Heights PDF Analysis amp Repair API Version 4 5 Page 2 of 30 July 8 2015 Table of Contents 1 Introduction uuuuunnunnunnunnnunnunnunnunnunnannunnunnunnunnunnunnunnunnnunnunnunnunnannunnunnn 4 l l Descriptio ass rer ER BERN 4 1 2 Funen S a AH 4 gj 4 ERR 5 A a PEN Dex RE P PLN pe X RUE GU DEEN Ded OUR QUE RUE Pe X RUE GU DEEN Melee ne 5 COMPIL ANCE ilatina 5 A A II 6 1 4 lt OPEFratingG SYStEMS iii cal vadeb ewe sate RN Ra aE cients 6 2 Installation PRRERPECFFOPFPPERFEPTFTFEUTTTTSFFRTTERLITEEPELLLEELTETLETEEFERTFFORSTTSTTRTTETTTTLEITFLITOE 7 2 2 Windows as 7 Generali ein rn rn nn er 7 COM Ad RR RE a ees 7 Java Interface t 8 NET Interface neh IRRE 8 Native C Interfaces chic EEE IR 8 Uninstall Install a New Version uunernennennennennnnennenn en nun nun nun nun mnn 8 2D AA a ida 9 3 License Management auunsanannanannanannanannanannanannnnannanannnnannanannanannanannunn 10 3 1 Graphical License Manager Tool ur srur nsnHan eee ann Hann nn meme 10 List all installed license keys u4u4 u4Hnannnnnnnnnnn en nun eee nena HH 10 Add and delete license keys 2ss sssnennnnennnnnn eee eee eee nena nenn
3. There are three possibilities to pass the license key to the application 1 The license key is installed using the GUI tool Graphical user interface This is the easiest way if the licenses are managed manually It is only available on Windows 2 The license key is installed using the shell tool This is the preferred solution for all non Windows systems and for automated license management 3 The license key is passed to the application at runtime via the LicenseKey property This is the preferred solution for OEM scenarios Graphical License Manager Tool The GUI tool LicenseManager exe is located in the bin directory of the product kit n Qj PDF Tools License Ma File Edit Help x 5 Add Key Delete Refresh List All Users Current User License Properties 3 Heights TM Document Converter Name Value v f 0 10A0M T AF FREE nun DR aA Key 0 J0A94 SU LT Y 0 BCASN S DI ET MULT FLACH FER Product 3 Heights TM Image 3 Heights TM Image to PDF Converter API af Intended Use Productive V 40 0494 um Solara nd Bai Y Platform Windows 3 Heights TM Image to PDF Converter Service Volume Page s eu V 0 1CA0 TEA Y Expiration Does not expire EZ TES JM tada A E Y Maintainance Expiration 2033 12 31 2 Lininht TRM TAA ANE Faminrtar Chall List all installed license keys The license manager always shows a list of all installed license keys
4. What Is the 3 Heights PDF Analysis 8 Repair API About The API provides two main functionalities as its name indicates 1 Analysis of PDF documents detect and report corruptions 2 Repair or recover the detected corruptions and save the result in a new PDF document How Does the API Work The API requires a PDF document as input In this manual this document is referred to as input document In the graphic below that s the PDF on the left hand side PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 13 of 30 July 8 2015 PDF Customer Application File is Clean gt L 3 Heights PDF Analysis amp Repair Tool Repair Corrupt File i HU a Lam E Recover Images if Irreparable Set Options and Parameters In a first step the input document is opened for reading This is done using the function Open In the next step analysis options are set using the property AnalysisOptions The more analysis options are set the deeper the analysis goes and the longer it takes In case the document is going to be repaired later on the recovery options can be set at this point using the property RecoveryOptions Recovery options can also be set after the analysis and before the repair step However as we will see these two steps can be combined therefore it make sense to set them previously The document is being analyzed using ei
5. between Repair corrects the errors in the document and Restore recreates the document based on the remaining legible information Formats Input Formats e PDF 1 x e g PDF 1 4 PDF 1 5 etc PDF A Target Formats e PDF 1 x e g PDF 1 4 PDF 1 5 etc Compliance Standards ISO 32000 PDF 1 7 PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 6 of 30 July 8 2015 1 3 Interfaces The following interfaces are available C Java NET COM 1 4 Operating Systems Windows XP Vista 7 8 8 1 32 and 64 bit Windows Server 2003 2008 2008 R2 2012 2012 R2 32 and 64 bit HP UX 11 and later PA RISC2 0 32 bit or HP UX 11i and later a64 Itanium 64 bit IBM AIX 5 1 and later 64 bit Linux 32 and 64 bit Mac OS X 10 4 and later 32 and 64 bit Sun Solaris 2 8 and later SPARC and Intel FreeBSD 4 7 and later 32 bit or FreeBSD 9 3 and later 64 bit on request PDF Tools AG Premium PDF Technology 2 1 3 Heights PDF Analysis amp Repair API Version 4 5 Page 7 of 30 July 8 2015 Installation Windows The retail version of the 3 Heights PDF Analysis amp Repair API comes as a ZIP archive containing various files including runtime binary executable code documentation and license terms 1 Download the ZIP archive of the product from your download account at www pdf tools com Open the ZIP archive Check the appropriate
6. of accessing files the PDF documents can be read and written to in memory The corresponding functions are OpenMem and SaveInMemory 3 Heights PDF Analysis Repair API emory Once the output document is saved to memory using SaveInMemory that memory block can be accessed using the function GetPDF A call sequence to create a first PDFRepair object that opens a PDF from file and stores its output in memory and then a second object which reads that in memory document and saves it back to a file looks like this PDFRepairl Open InputFile PDFRepairl SaveInMemory PDFRepairl Close PDFRepair2 OpenMem PDFRepairl GetPDF PDFRepair2 SaveAs OutputFile PDFRepair2 Close This call sequence of course does not make much sense it s merely used to illustrate how to use of the in memory functions In a real application the in memory document is read from another application or a database PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 20 of 30 July 8 2015 5 Programming Interfaces 5 1 Visual Basic 6 After installing the 3 Heights PDF Analysis Repair API and registering the COM interface see chapter COM Interface you find a Visual Basic example repair vbp in the directory samples VB You can either use this sample as a base for an application or you can start from scratch The 3 Heights PDF Analysis amp Repair Tool API is very easy to
7. or the owner password of the encrypted PDF document If this parameter is left out an empty string is used as a default e Return value True The file could successfully be opened False The file does not exist is corrupt or the password is not valid OpenMem Method Boolean OpenMem Variant MemBlock String Password This method opens a PDF memory block i e makes the objects contained in the PDF document accessible If the document is already open it is closed first e Parameters MemBlock The memory block containing the PDF file given as a one dimensional byte array Password optional The user or the owner password of the encrypted PDF document If this parameter is left out an empty string is used by default e Return value True The document could successfully be opened False The document does not exist is corrupt or the password is invalid RebuildOptions Property TPDFRebuildOption RebuildOptions Accessors Get Set Default 0 This property can be used to get or set the rebuild options e eRebuildStreams Recompress all streams This setting is recommended for files with corrupt streams e eRebuildFonts PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 26 of 30 July 8 2015 Rebuild fonts e eRebuildFontsAsTypel Convert Compact Font Format CFF simple fonts to Typel This property can be used together with eRebuildFonts only Recove
8. use A Visual Basic 6 sample looks as simple as this Private Sub repair Click Dim repair As New PDFREPAIRAPILib PDFRepair repair repair C input pdf C output pdf C log txt End Sub If a PDF document cannot be repaired and contains images it is possible to recover the images by setting the property repair RecoveryOptions repair RecoveryOptions or eRecoverImages 5 2 ASP VBScript The class name to be used is PDFREPAIRAPI PDFRepair Simplified example lt Language VBScript gt lt option explicit dim repair set repair Server CreateObject PDFREPAIRAPI PDFRepair repair Open path file to be repaired pdf repair AnalyzeAndRepair repair SaveAs path output_file pdf repair Close gt PDF Tools AG Premium PDF Technology 5 3 3 Heights PDF Analysis amp Repair API Version 4 5 Page 21 of 30 July 8 2015 NET As opposed to previous versions the Windows build numbers 1 7 1 and later provide a NET interface There should be at least one NET sample for MS Visual Studio 2005 available in the ZIP archive of the Windows Version of the 3 Heights PDF Security API Easiest for a quick start is to refer to this sample In order to create a new project from scratch do the following steps 1 Start Visual Studio and create a new C or VB project 2 Add a reference to the NET assemblies To do so in the Solution Explorer right click your project and select Add Reference
9. version does not require to uninstall the previously installed old version The files of the old version can directly be overwritten with the new version If you use the COM interface you must register the new DLL un registering the old version is not required PDF Tools AG Premium PDF Technology 2 2 3 Heights PDF Analysis amp Repair API Version 4 5 Page 9 of 30 July 8 2015 Unix Here is an overview of the shared libraries and other files that come with the 3 Heights PDF Repair API A This is the shared library that contains the main functionality jar REPA jar Java API archive j ICINDE C API include file e Unpack the archive in an installation directory e g usr pdftools com Copy or link the shared object into one of the standard library directories e g In s usr pdftools com bin libPdfRepairAPI so usr lib e In case you have not yet installed the GNU shared libraries get a copy of these from http www pdf tools com extract the shared images and copy or link them into usr lib or usr local lib On Mac OS X platforms the shared library must have the extension jnilib for use with Java We suggest that you create a file link for this purpose by using the following command ln libPdfRepairAPI dylib libPdfRepairAPI jnilib PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 10 of 30 July 8 2015 License Management 3 1
10. 3 Heights PDF Analysis amp Repair API Version 4 5 July 8 2015 Page 29 of 30 TPDFAnalysisOption eAnalyzeObjects eAnalyzePageTree eAnalyzeContentStreams TPDFDiagnosis eDiagnosisOpen eDiagnosisObjects eDiagnosisPages TPDFErrorCode Analyze objects Analyze page tree Analyze content streams Diagnose opening Diagnose objects Diagnose pages All TPDFErrorCode enumerations start with PDF_ followed by a single letter which is one of S E W or I an underscore and a descriptive text The single letter gives in an indication of the type of error These are Success Error Warning Information With respect to corrupt PDF files An error indicates a corruption in the PDF the file may or may not be readable A warning indicates the file is readable but not valid A full list of all PDF Tools error codes is available in the header file pdferror h The error codes that are listed to file access are listed here PDF S SUCCESS LIC E NOTINIT LIC E LEVEL PDF E FILEOPEN PDF E FILECREATE PDF E PASSWORD TPDFPermission ePermPrint ePermModify ePermCopy ePermAnnotate ePermFillForms ePermSupportDisabilities ePermAssemble ePermbDigitalPrint TPDFRebuildOption eRebuildStreams The operation was completed successfully Various license management related errors The file couldn t be opened The file couldn t be created The authentication failed due to a wrong password Low resolution printin
11. HWINNT Microsoft NET Framework v2 0 50727 5ystem Data dll Settings System Deployment NET 2 0 0 0 False CHWINNT Microsoft NET Framework v2 0 50727 5ystem Deployment dil System Drawing NET 2 0 0 0 False C WINNT Microsoft NET Framework v2 0 50727 System Drawing dll Signing System Windows Forms NET 2 0 0 0 False C WINNT Microsoft NET Frameworkiv2 0 50727 System Windows Forms dll System xml NET 2 0 0 0 False C WINNT Microsoft NET Frameworkiv2 0 50727 System xml dll Security Publish n Add l J Remove Update Web Reference Imported namespaces Paftools PdfRepair Add User Import Pdftools Pdftools Pdf lt System CodeDom System CodeDom Compiler System Collections ObjectModel System Collections Specialized System ComponentModel System ComponentModel Design System ComponentModel Design Serialization xl Update User Import 4 The class Pdftools PdfRepair Repair can now be used as shown in the code CH snippet below Dim doc As New Pdftools PdfRepair Repair Or if the namespace Pdftools PdfRepair is imported Dim doc As New Repair doc Open Add the following namespaces using Pdftools Pdf using Pdftools PdfRepair The class Pdftools PdfRepair Repair can now be used as shown in the code snippet below doc new O doc Open PDF Tools AG Premium PDF Technology 3 H
12. ace eerte e tend ec v en i Pn e Ra E ce eae 28 Sov 28 Err r oden se rr e eta ere ba en Eee EANA NA EDU NE Kr we ECU UE REV Bea MERE 28 MESS AGC ics eet en iu 28 Olsy sedi oe 28 exc En 28 5 3 En meratlorns ie ee A c de wale e e AR ce e Pn on 28 TPDFANalySISODLION sioe inea ein eren intei ne nern 29 TPDFDiagnhosls eret er d etx n a e i em ERR I EAR ET EA E M ERR 29 TPDFEErfFOrCOdG irc verres vet inkl 29 TPDEPErMISSIONM ee 29 TPDFRebuildOption itte vet eere ek ERR RM ERR AH XC E YR E 29 TPDFRecOVeryODptloti erem here e ee ner eee e ene P ek E 30 PDF Tools AG Premium PDF Technology 1 1 3 Heights PDF Analysis amp Repair API Version 4 5 Page 4 of 30 July 8 2015 Introduction Description The 3 Heights PDF Analysis amp Repair tool is used to analyze repair and restore the content of corrupt PDF documents Unfortunately the number of corrupt PDF documents is incredibly huge The cause is usually down to defective generating tools converters and other influences such as attempts at manual editing copying via FTP without correct settings system crashes during PDF creation network interruptions defective copying on optical media etc The result leads to an enormous loss of important information and to production downtimes caused by corrupt PDF documents The 3 Heights PDF Analysis Repair analyzes PDF documents with regard to PDF specif
13. as no direct impact to viewing the document is often ignored If documents are being archived or must be of good quality for other reasons they can be analyzed using a PDF analysis tool The 3 Heights PDF Analysis amp Repair API analyzes documents and detects whether they are valid or not according to the PDF specification A simpler test to see whether a document is valid or not is to open it in Adobe Acrobat Professional and close it again If one is prompted to save the document it can be an indication that the document was corrupt and was repaired and the repaired document is now displayed to the user This test however does not provide any information about what was corrupt e what was repaired The save prompt could also be unrelated to corruptions but be of another nature such as a Java script PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 15 of 30 July 8 2015 What Is the Difference between Repair and Recover The 3 Heights PDF Analysis amp Repair API can repair virtually everything it can detect It can however not recover lost information E g if a PDF document was sent via E Mail attachment and only have of the attachment was sent before the connection was cut information is lost If information is lost a document cannot be transformed back to its original state In this case the document can only be recovered meaning all the remaining information c
14. de Add and delete license keys Install new license key licmgr store X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX Delete old license key licmgr delete X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX Both commands have the optional argument s that defines the scope of the action e y For all users e u Current user Select between different license keys for a single product licmgr select X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX 3 3 License Key Storage Depending on the platform the license management system uses different stores for the license keys PDF Tools AG Premium PDF Technology 4 1 3 Heights PDF Analysis amp Repair API Version 4 5 Page 12 of 30 July 8 2015 Windows The license keys are stored in the registry e HKLM Software PDF Tools AG for all users e HKCU Software PDF Tools AG for the current user Mac OS X The license keys are stored in the file system e Library Application Support PDF Tools AG for all users e Library Application Support PDF Tools AG for the current user Unix Linux The license keys are stored in the file system e etc opt pdf tools for all users e pdf tools for the current user Note The user group and permissions of those directories are set explicitly by the license manager tool It may be necessary to change permissions to make the licenses readable for all users Example chmod R go rx etc opt pdf tools Getting Started and User s Guide Overview of the API
15. e nena nennen 10 Display the properties of a license 0 eceee cece e eee e eect eee teeta n mm 11 Select between different license keys for a single product 11 3 2 Command Line License Manager Tool c ccceceeeee eee ee teens teens nn nennen 11 List all installed license KeYS cceceeeee cece eee eee reese eee tenet He 11 Add and delete license keys 2ss ssnnennnnennn eee ee nenne nenne nenne nenne nenne nennen 11 Select between different license keys for a single product 11 3 3 License KEY Bar EHER AE ERU RENE 11 WINDOWS 5s dere ee dade rh ere ee a dir e nexa 12 MaG OS qn 12 UI TEIN ist la lo DURER US 12 4 Getting Started and User s Guide uunsanannanannanannanannanannanannanannanannanen 12 4 1 Overview of the API usesssnnnnnnnonnnnnnnnnnn nun nun nun nun nun nun nun sea sea sea sua sea na na nnn 12 What Is the 3 Heights PDF Analysis amp Repair API About 12 How Does the API Work uzeuasnannnnnnnnnonnen nenne nun nun nun nun nun nr nun nenne nnn 12 4 2 Corrupt PDF Documents sersserenenenenennnennn nennen enen nennen enen nennen nnn 14 How Do PDF Documents Get Corrupted uz u4srannnnanennnn en neta eee en anen 14 How to Detect Corruptions zeusseennennnennnnnnnnn nenn nenn nenn nenn nenn nenn nnns 14 What Is the Difference between Repair and Recover zeunennennennennennennnnnn 15 AS A ip 16 Analysis Only e A
16. ee REA M DA LEER 16 Analysis amp RepalFz tiet derer ee red rra ern 17 Analysis amp Conditional Repair sssssssssssssseee emen 18 How to Use the in Memory Functions 0 ocoooccocnccononcnnnncnnnncnnnncnnnncnannnnnnnes 19 5 Programming Interfaces uunranannananunnannanannnnannanannnnannnnannanannanannnnannunn 20 551 Visual Basi 6 nn an testet toties tees todo Edere rete eodera een 20 PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 3 of 30 July 8 2015 SP AMEN iA Isidis 20 A E E 21 MiSUaliBASIC seire esei te N ie 21 Cl a bee A aaa een DEE Ra ae en le 22 6 Programmer s Reference nuunranannananunnannanannnnannanannnnannanannanannanannanannunn 23 6 1 The PDFRepair Interface zeusensennennennonnnn nennen en nn nun nennen nennen nennen nennen 23 AnalysisOptions nr ee a renden 23 ANALY Zi Reel 23 Analyze ndRepalr 4 2 2 A ox 23 EIOSE EE 23 DIAGNOSIS il ne Bea baled Guay EEE Rn 24 Err rCOd ELE 24 Errorkevel EE 24 GEERIFSEEFFOT anne e 24 GEENEXTEFFO e EE 24 GetPDFE e 24 OPEN od DLE BEER ER UE DR ee Lx GE Bund 25 OPEN Me Mito it Mande EA x ERE DRE Biene 25 RebuildOptions san c ee cl e ce a ote V a a 25 Recovery OPUONS ct 26 ire eU EE 26 Reportingbevel e de re e e va e epe ER Re Y CE e vea e 27 SAVCAS we ER 27 SavelnMermoty iere diee a Pau I E YR A TRA IE ERREUR 27 6 2 The PdfError Interf
17. eights PDF Analysis amp Repair API Version 4 5 Page 23 of 30 July 8 2015 6 Programmer s Reference Note this manual describes the COM interface only Other interfaces C Java NET however work similarly i e they have calls with similar names and the call sequence to be used is the same as with COM 6 1 The PDFRepair Interface AnalysisOptions Property TPDFAnalysisOption AnalysisOptions Accessors Get Set Default eAnalyzeObjects eAnalyzePageTr eAnalyzeContentStreams This property sets the analysis options Options can be turned off to increase the speed of the analysis See enumeration TPDFAnalysisOption Analyze Method Boolean Analyze This method analyzes the input document for errors e Return value True The Analysis was successful False otherwise AnalyzeAndRepair Method Boolean AnalyzeAndRepair This method analyzes the input document and creates a repaired output document e Return value True The Analysis was successful And a repaired document could be created False otherwise Close Method Boolean Close Close the input file e Return value True The input file could be closed False otherwise PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 24 of 30 July 8 2015 Diagnosis Property TPDFDiagnosis Diagnosis Accessors Get This property returns the diagnosis flags See also enumeration TPDFDiagn
18. en larger than the PDF specification itself There are uncountable different PDF products available and virtually none of them is capable to support everything PDF offers And only few of them create actually valid PDF Most freeware or home made PDF creators have flaws These flaws are often not detected initially simply because the widely used PDF viewer applications detect and repair these errors on the fly The creator of the PDF doesnt even notice his PDF is corrupt because the PDF viewer application fixes or ignores the problem silently A creator often does not have the goal to create a PDF but just a PDF which can be viewed Reason 1 Incorrect PDF creators PDF is a binary format Most of its content is compressed Editing a PDF file with a text editor or transmitting a PDF in text mode instead of binary mode e g FTP corrupts the PDF Partially transmitting a PDF file cuts off part of the document this loss of information is not recoverable Reason 2 Binary file is damaged There are further reasons but the two reasons mentioned are certainly the most common How to Detect Corruptions The most obvious way to detect a problem with a PDF document is if it doesn t open a PDF viewer application or there is an error message when opening the document or part of the document cannot be displayed correctly For most user this is the only situation where they actually are aware the document is corrupt Any other corruption that h
19. g Changing the document Content copying or extraction Annotations Filling of form fields Support for disabilities Document Assembly High resolution printing Rebuild recompress streams PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 30 of 30 July 8 2015 eRebuildFonts Rebuild fonts eRebuildFontsAsTypel Rebuild and convert CFF simple fonts to Typel TPDFRecoveryOption eRecoverXREF Do not recover X REF table eRecoverPages Recover pages eRecoverlmages Recover images PDF Tools AG Premium PDF Technology
20. ications Defective files are automatically repaired as far as possible and unreadable data is restored PDF Analysis amp Repair Tool PDF PDF Clean PDF PDF Repaired PDF PDF Recovered Y Parameters 1 2 Functions PDF Analysis amp Repair is used to check and where indicated repair PDF documents Users can determine customized profiles from a broad range of analysis and repair options An exact and detailed description is issued for each reported error The tool is also capable of reading and processing encrypted PDF files without any problems PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 5 of 30 July 8 2015 Features Analyze and or repair one or more PDF documents Set analysis options including e Objects e Page tree e Content stream Set repair options including e Restore data streams e Restore fonts e Restore XRef table e Restore pages e Restore images if pages cannot be restored Display error description for every message including e Type errors warnings information e Error code e Text based description e Page number e Number of events Write error messages to log file Read encrypted PDF files Encrypt restored file and set user authorizations Set error level to identify whether errors warnings or merely information occur Set reporting level to determine which messages should be issued errors warnings information Differentiate
21. igh quality printing flags ePermPrint and ePermDigitalPrint need to be set e Return value True The file could successfully be created False otherwise SaveInMemory Method Boolean SaveInMemory This method saves the output PDF in memory After the Close call it can be accessed using the method GetPDF PDF Tools AG Premium PDF Technology 6 2 3 Heights PDF Analysis amp Repair API Version 4 5 Page 28 of 30 July 8 2015 The PdfError Interface 6 3 Count Property Long Count Accessors Get This property returns how many times the error occurs on the page ErrorCode Property TPDFErrorCode ErrorCode Accessors Get This property returns the error code See enumeration TPDFErrorCode Message Property String Message Accessors Get This property returns an explaining error message ObjectNo Property Long ObjectNo DNeeessorse eie This property is not yet supported This property returns the object number at which the error occurs If the error is not related to a particular object O is returned PageNo Property Long PageNo Accessors Get This property returns the page number on which the error occurs If the error is not related to a particular page number 0 is returned Enumerations Note Depending on the interface enumerations may have TPDF as prefix COM C or PDF as prefix NET or no prefix at all Java PDF Tools AG Premium PDF Technology
22. in the left pane of the window This includes licenses of other PDF Tools products The user can choose between e Licenses available for all users Administrator rights are needed for modifications e Licenses available for the current user only Add and delete license keys License keys can be added or deleted with the Add Key and Delete buttons in the toolbar e The Add key button installs the license key into the currently selected list e The Delete button deletes the currently selected license keys PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 11 of 30 July 8 2015 Display the properties of a license If a license is selected in the license list its properties are displayed in the right pane of the window Select between different license keys for a single product More than one license key can be installed for a specific product The checkbox on the left side in the license list marks the currently active license key 3 2 Command Line License Manager Tool The command line license manager tool icmgr is available in the bin directory for all platforms except Windows A complete description of all commands and options can be obtained by running the program without parameters licmgr List all installed license keys licmgr list The currently active license for a specific product ist marked with a star on the left si
23. ir is Log File Repaired PDF e Open e Set AnalysisOptions and RecoveryOptions Optional e AnalysisAndRepair e Report Errors Optional e SaveAs e Close PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 18 of 30 July 8 2015 Analysis amp Conditional Repair In the Analysis amp Repair process using AnalysisAndRepair every document is repaired not matter the analysis A more sophisticated approach is to separate these two step to first analyze the document and only repair it if corruptions are actually detected Options A Yes AnalysisOptions 5 Open gt recovery Options Analysis gt Report Errors gt Repair gt SaveAs gt Close 3 Heights PDF Analysis amp Repair API Keep original PDF Log File Repaired PDF The call sequence for analysis and conditional repair is e Create Object e Open e Set AnalysisOptions and RecoveryOptions Optional e Analysis e If Errors Report Errors Optional Repair SaveAs e Close PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 19 of 30 July 8 2015 How to Use the in Memory Functions The 3 Heights PDF Analysis amp Repair API always requires a PDF input document from which it reads and optionally a PDF output document to where the result is saved to To open and save to from files the functions Open and SaveAs are used Instead
24. nt to register the 32 bit version of the 3 Heights PDF Analysis amp Repair API it is required to use the regsvr32 from the WOWE64 directory instead of System32 If the registration process succeeds the following box is displayed x ru UL DilRegisterServer in PDFRepairAPI dll succeeded The installation process is now complete Java Interface When using the Java interface the Java wrapper jar REPA jar needs to be on the CLASSPATH bin PdfRepairAPI dll needs to be on the PATH NET Interface The path where the PDFRepairAPI dll resides must be known to the project e g should be added to the environment variable PATH The NET assemblies NET d are to be added as references See also chapter Programming Interfaces gt NET Native C Interface The header file pdfrepairapi_c h needs to be included in the C program The library lib PdfRepairAPI lib needs to be linked to the project The dynamic link library bin PdfRepairAPI dll needs to be in path of executables e g on the environment variable PATH Uninstall Install a New Version In order to uninstall the product undo all the steps done during installation e g un register using regsvr32 u delete all files etc Note that an expired evaluation DLL cannot be unregistered If you would like to un register an expired evaluation DLL download a new non expired evaluation version overwrite the old version and un register it Installing a new
25. ontained in the PDF document is recovered and used to create a new valid PDF however the new PDF is different from the original If a document contains syntactic or semantic faults which can be detected and fixed the document can be repaired An trivial example for such a case is image which contains image data with a length of 100 bits the Length attribute of the image object however states a different incorrect value then this value can be corrected and the document can be repaired PDF Tools AG Premium PDF Technology 4 3 3 Heights PDF Analysis amp Repair API Version 4 5 Page 16 of 30 July 8 2015 Concepts Analysis Only The process for analysis only is the most simply process that can be implemented by the API The steps in this process are shown in the graphic below Options Open 4AnalysisOptions Analysis Report Errors gt Close 3 Heights PDF Analysis amp Repair API Log File A new PDFRepair object is created A PDF input document is opened using the function Open Analysis options are set using the property AnalysisOptions This step is optional The analysis of the input document is performed using the function Analysis A list of error objects can be retrieved using the functions GetFirstError and consecutive calls to the function GetNextError until no more errors are returned An error objects provides information about a corruption error such as an error code
26. option to preserve file paths folder names and unzip the archive to a local folder e g C program files pdf tools 4 The unzip process now creates the following subdirectories e Bin Contains the runtime executable binary code e Doc Contains documentation files e Include Contains files to include in your C C project e Samples Contains various samples General Here is an overview of the dynamic link libraries and other files that come with the 3 Heights PDF Analysis amp Repair API bin PdfRepairAPI dll bin NET dll Jar REPA jar Include h This is the DLL that contains the main functionality required NET assemblies required when using the NET interface Java API archive C API include file COM Interface Before you can use the PDF Analysis amp Repair Tool API component in your COM application program you have to register the component using the regsvr32 exe program that is provided with the Windows operating system in the directory System32 The following screenshot shows the registration of the PDF Analysis amp Repair API DLL e Command Prompt C Program Files pdf tools bin gt regsvr32 PDFRepairAPl dll On Windows Vista an later the command must be executed in an Command Prompt that runs as Administrator PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 8 of 30 July 8 2015 When using a Windows 64 bit platform and you wa
27. or an error message The input document is then closed again using the function Close The call sequence for analysis only is Create Object Open Set AnalysisOptions Optional Analysis Report Errors Optional Close A simplified Visual Basic 6 program with the above call sequence looks about as shown below Dim repair As New PDFREPAIRAPILib PDFRepair PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 17 of 30 July 8 2015 e repair Open e repair AnalysisOptions e repair Analysis Report Errors Dim Err As PDFREPAIRAPILib PdfError Set Err repair GetFirstError While Not Err Is Nothing Do something with the error e g output Err Message Set Err repair GetNextError Wend e repair Close A more detailed and executable Visual Basic 6 sample is provided with the release as well as with the evaluation version Analysis amp Repair Often corrupt documents not only need to be detected but also repaired or recovered As opposed to the analysis only process here the file is analyzed and repaired in one step using the function AnalysisAndRepair The repaired document is saved as a new document using the function SaveAs Options AnalysisOptions RecoveryOptions ysisAndRepair P Report Errors gt SaveAs gt Close Open 3 Heights PDF Analysis amp Repair API The call sequence for analysis and repa
28. osis ErrorCode Property TPDFErrorCode ErrorCode Accessors Get This property can be accessed to receive the latest error code See enumeration TPDFErrorCode ErrorLevel Property Integer ErrorLevel INGIGOSISOTS CST This property can be accessed to check whether no errors 0 warnings only 1 or errors 2 were found during the analysis This property should be get after Analyze GetFirstError Method TPDFErrorCode GetFirstError This method returns the first error it can also be a warning e Return value The first error if there are any Nothing otherwise GetNextError Method TPDFErrorCode GetNextError This method returns the next error it can also be a warning e Return value The next error if there are any Nothing otherwise GetPDF Method Variant GetPDF This method returns the PDF which was previously saved to memory using the method SavelnMemory This method must be used after Close e Return value PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 25 of 30 July 8 2015 A 1 dimensional byte array containing the PDF document Open Method Boolean Open String FileName String Password Opens the input file e Parameters String InputFile the file name and optionally the file path drive or server string according to the operating systems file name specification rules of the input file String Password optional the user
29. ot be repaired PDF Tools AG Premium PDF Technology 3 Heights PDF Analysis amp Repair API Version 4 5 Page 27 of 30 July 8 2015 ReportingLevel Property Integer ReportingLevel Accessors Get Set Deka With this property the reporting level can be set or get The supported levels are 0 none Nothing is reported 1 errors Errors are reported 2 warnings Errors and warnings are reported 3 information Error warnings and information are reported The property ReportingLevel must be set before the Open Method in order to be applied SaveAs Method Boolean SaveAs String FileName String UserPw String OwnerPw Long PermissionFlags This method saves the document to a file e Parameters String InputFile The file name and optionally the file path drive or server string according to the operating systems file name specification rules of the input file String UserPw optional Set the user password of the PDF document If this parameter is omitted the default password is used Use O to set no password String OwnerPw optional Set the owner password of the PDF document If this parameter is omitted the default password is used Use O to set no password Long PermissionFlags optional The permission flags The permissions that can be granted are listed in the enumeration TPDFPermission To not encrypt the output document set PermissionFlags to 1 user and owner password to 0 In order to allow h
30. ryOptions Property TPDFRecoveryOption RecoveryOptions Accessors Get Set Default eRecoverXREF eRecoverPages This property can be used to get or set the recovery options e eRecoverXREF Don t recover the XREF table This option is useful if processing a document takes too long since repairing the cross reference table is very time consuming e eRecoverPages If pages are not part of the page tree loose pages they will be recovered and added at the end of the document If they should not be recovered these pages will be removed from the document e eRecoverImages This property defines if the 3 Heights PDF Analysis amp Repair Tool should try to recover images of a PDF document if the document cannot be repaired Repair Method Boolean Repair String InputFile String OutputFile String LogFile This method opens a PDF file analyzes and repairs it The repaired file is saved with a new file name Optionally a log file can be generated e Parameters String InputFile the file name and optionally the file path drive or server string according to the operating systems file name specification rules of the input file String OutputFile the file name and optionally the file path drive or server string of the output file the repaired file String LogFile optional The path to the log file e Return value True The file could successfully be processed False The file could not be processed and therefore n
31. ther the function Analysis or AnalysisAndRepair As a result of the analysis the document is qualified valid or corrupt For corrupt documents all corrption can be listed in an error report In the case of an analysis only process the input document can now be closed and the process is done If the process is also to repair the document it is saved as a new PDF document using the SaveAs function If the user chooses to repair the PDF document a new PDF document is created This document is referred to as output document The output document is completely rebuilt from scratch using all readable information from the input document This means if a valid PDF document is repaired a new document is created as well If a PDF document is corrupt the PDF can either be repaired or recovered depending on the level of corruption The difference between repairing and recovering is described in a separate chapter The input document is closed using Close See also chapter Concepts PDF Tools AG Premium PDF Technology 4 2 3 Heights PDF Analysis amp Repair API Version 4 5 Page 14 of 30 July 8 2015 Corrupt PDF Documents How Do PDF Documents Get Corrupted One needs to be aware that PDF is a complex format its specification is more than 1000 pages Within PDF there are embedded objects such as different types of fonts images or compressions which again are complex on their own and have specifications that are ev

Download Pdf Manuals

image

Related Search

Related Contents

Dynamode CardBus -> USB 2.0 Controller Adapter  Anleitung Heimtrainer HTR 3000  Manual - Absolute Acoustics  Mode d`emploi pour déposer une proposition de communication  Watlow Electric EZ-ZONE PM Network Card User Manual  DCS User Manual EN  426 KB - Test Equipment Depot  スマートフォンのセキュリティについて  Avteq GMP-200L-TT1  NOBILIS® MA5 + CLONE 30  

Copyright © All rights reserved.
Failed to retrieve file