Beispielskripte (Plugins)
Plugin "PDF-Erzeugung" (i2dxPDF)
Mär 042015Durch Verwendung des image2data-Plugins "PDF-Erzeugung" (i2dxPDF) lassen sich PDF-Dateien aus dem Skript heraus erstellen. Hierbei kann es sich um reine Bildcontainer oder um durchsuchbare PDF-Dateien handeln.
Das folgende Skript erzeugt eine PDF-Datei im Langzeit-Archiformat "PDF/A-1b" aus einem einfachen Scan. Hierzu wird eine Texterkennung auf den Scan ausgeführt und das textuelle Ergebnis als unsichtbarer Layer hinter das Bild "geklebt". Damit kann die entstandene PDF-Datei später durchsucht werden. Durch die Auswahl, eine PDF-Datei im Format PDF/A-1b zu erstellen, genügt das entstandene Dokument den Anforderungen für Langzeit-Archive.
// ************************************************************** // * sample_i2dxpdf.i2dspt * // * * // * Sample script for the i2dxPDF (pdf handling) plugin * // * REQUIRES THE INSTALLED PLUGIN TO COMPILE AND RUN! * // * * // * Press F9 to execute the code or F7/F8 to debug it * // * * // * Be sure that the sample data was installed! * // * * // * Contact www.norpa.eu if the plugin is required but missing * // ************************************************************** {$I i2dxPDF} {$I i2dcOCRAndExtraction.i2dspt} var i, j, k: Integer; rOCRChars: Ti2dOCRChars; rProcessSettings: Ti2dProcessSettings; begin // Get the configured process settings. We must know the configured "in"-folder because that's // where the sample docs are located in! i2dGetProcessSettings(rProcessSettings); j := i2dGetImagePageCount(rProcessSettings.InPath + 'sample_all.tif'); for i := 1 to j do begin // Retrieve the chars on the page using ocr... rOCRChars := i2dcOAEPerformOCROnPageEx2F(rProcessSettings.InPath + 'sample_all.tif', i, 3, 0, False, '', k); // ...and combine them with the scan i2dxPDFAddPageF(rProcessSettings.InPath + 'sample_all.tif', i, k, 300, rOCRChars); end; // Finally, create a pdf/a-1b file i2dxPDFCombinePagesToPDFA1b('c:\sample_all.pdf', 'Author', 'Title ', 'Subject', 'Some Keywords...', True); end.