Beispiel #1
0
    public static void Example()
    {
        string strPath;
        int    pageCount;
        int    currentPage;

        strPath = System.AppDomain.CurrentDomain.BaseDirectory;

        // Instantiate Object
        NameSpace.Class objVAR = new NameSpace.Class();

        // Open PDF
        objVAR.OpenFile(strPath + "doc.pdf");

        // Get page count of open file
        pageCount = objVAR.NumPages();

        for (currentPage = 1; currentPage <= pageCount; currentPage++)
        {
            // Image Format
            objVAR.ImageFormat = NameSpace.ImageType.ImgJPEG;

            // Output Type
            objVAR.OutputFormat = NameSpace.OutputFormatType.OutFile;

            // Other settings
            objVAR.OutputFileName     = strPath + "doc" + currentPage + ".jpg";
            objVAR.JPEGQuality        = 72;
            objVAR.IncludeAnnotations = true;

            // Render the current page
            objVAR.RenderPage(currentPage);
        }

        // Finished rendering pages, close file
        objVAR.CloseFile();

        // Release Object
        objVAR.Dispose();

        // Process Complete
        WriteResults("Done!");
    }
Beispiel #2
0
    public static void Example()
    {
        string strPath;

        OCRDK.Results.OCRResult results;

        strPath = System.AppDomain.CurrentDomain.BaseDirectory;

        // Instantiate Object
        NameSpace.Class objVAR = new NameSpace.Class();

        // OCR Settings
        objVAR.Settings.OCR.Deskew              = DeskewOptions.Auto2D;
        objVAR.Settings.OCR.Despeckled          = true;
        objVAR.Settings.OCR.ExportBookmarks     = false;
        objVAR.Settings.OCR.OCRType             = OCRTypeOptions.SearchablePDF;
        objVAR.Settings.OCR.PictureHandling     = PictureHandlingOptions.Default;
        objVAR.Settings.OCR.RetainLineNumbering = false;
        objVAR.Settings.OCR.Rotation            = RotationOptions.Auto;
        objVAR.Settings.OCR.Languages.Add(LanguageOptions.English);

        // PDF Compression
        objVAR.Settings.PDF.Compression.TextAndLineArt     = false;
        objVAR.Settings.PDF.Compression.ContentStream      = ContentStreamOptions.Flate;
        objVAR.Settings.PDF.Compression.EmbeddedFonts      = false;
        objVAR.Settings.PDF.Compression.BWImages           = false;
        objVAR.Settings.PDF.Compression.ColorAndGrayImages = false;
        objVAR.Settings.PDF.Compression.MRC = MRCOptions.Disabled;

        // PDF Metadata
        objVAR.Settings.PDF.Metadata.Author   = "John Doe";
        objVAR.Settings.PDF.Metadata.Title    = "OCR Example";
        objVAR.Settings.PDF.Metadata.Subject  = "Example";
        objVAR.Settings.PDF.Metadata.Keywords = "OCR, example, metadata";

        // PDF Security
        objVAR.Settings.PDF.Security.UseSecurity          = false;
        objVAR.Settings.PDF.Security.Encryption           = EncryptionType.AES_256;
        objVAR.Settings.PDF.Security.OwnerPassword        = "******";
        objVAR.Settings.PDF.Security.UserPassword         = "******";
        objVAR.Settings.PDF.Security.CanAnnotate          = false;
        objVAR.Settings.PDF.Security.CanAssemble          = false;
        objVAR.Settings.PDF.Security.CanCopy              = false;
        objVAR.Settings.PDF.Security.CanEdit              = false;
        objVAR.Settings.PDF.Security.CanFillInFormFields  = false;
        objVAR.Settings.PDF.Security.CanMakeAccessible    = false;
        objVAR.Settings.PDF.Security.CanPrint             = false;
        objVAR.Settings.PDF.Security.CanPrintHiResolution = false;

        // PDF version
        objVAR.Settings.PDF.Version        = PDFVersion.PDF1_5;
        objVAR.Settings.PDF.Format         = PDFOutputFormat.PDF;
        objVAR.Settings.PDF.PDFACompliance = PDFAComplianceLevel.NotSet;

        // Basic Settings
        objVAR.Settings.Debug               = true;
        objVAR.Settings.Timeout             = 30;
        objVAR.Settings.PDF.Linearize       = false;
        objVAR.Settings.PDF.OverwriteMethod = OverwriteMethod.Always;

        // Start OCR conversion
        results = objVAR.Convert(strPath + "multipage.tif", strPath + "new.pdf");
        if (results.OCRStatus != OCRDK.Results.OCRStatus.Success)
        {
            ErrorHandler("Convert", results, results.OCRStatus.ToString());
        }

        // Release Object
        objVAR = null;

        // Process Complete
        WriteResults("Done!");
    }
Beispiel #3
0
    public static void Example()
    {
        int    intDoPrint;
        string strPath;
        int    intOpenInputFile;
        string strFieldInfo;

        strPath = System.AppDomain.CurrentDomain.BaseDirectory;

        // Instantiate Object
        NameSpace.Class objVAR = new NameSpace.Class();


        // Release Object
        objVAR = null;

        // Instantiate Object
        APDocConv.APDocConverter oDC = new APDocConv.APDocConverter();


        // Release Object
        oDC = null;

        // Instantiate Object
        activePDF.API.DocConverterWBE.DocConverter oDCw = new activePDF.API.DocConverterWBE.DocConverter();


        // Release Object
        oDCw = null;

        // Instantiate Object
        APMeridian.Meridian oMER = new APMeridian.Meridian();


        // Release Object
        oMER = null;

        // Instantiate Object
        APServer.Server oSVR = new APServer.Server();


        // Release Object
        oSVR = null;

        // Instantiate Object
        APToolkitNET.Toolkit oTK = new APToolkitNET.Toolkit();


        // Release Object
        oTK = null;

        // Instantiate Object
        APWebGrbNET.APWebGrabber oWG = new APWebGrbNET.APWebGrabber();


        // Release Object
        oWG = null;

        // Instantiate Object
        APXtractor.Xtractor oXT = new APXtractor.Xtractor();


        // Release Object
        oXT = null;
Beispiel #4
0
    public static void Example()
    {
        Array arrayAvailableDPIs;
        Array arrayBinSources;
        bool  isCollate;

        APSpoolerNET.ColorMode valColorMode;
        int valDPI;

        APSpoolerNET.DuplexMode valDuplex;
        Array arrayFormNames;

        APSpoolerNET.Orientation valOrientation;
        Array  arrayPaperSizes;
        string valPrinterName;

        APSpoolerNET.TrueTypeOptions valTrueType;
        string strPath;

        SpoolerDK.Results.SpoolerResult results;

        strPath = System.AppDomain.CurrentDomain.BaseDirectory;

        // Instantiate Object
        NameSpace.Class objVAR = new NameSpace.Class();

        // Use the PrinterInfo object to retrieve current settings
        // and available options for the specified printer.
        APSpoolerNET.PrinterInfo oPI = objVAR.PrinterInfo("Microsoft Print to PDF");

        arrayAvailableDPIs = oPI.AvailableDPI;
        arrayBinSources    = oPI.BinSources;
        isCollate          = oPI.Collate;
        valColorMode       = oPI.ColorMode;
        valDPI             = oPI.DPI;
        valDuplex          = oPI.Duplex;
        arrayFormNames     = oPI.FormNames;
        valOrientation     = oPI.Orientation;
        arrayPaperSizes    = oPI.PaperSizes;
        valPrinterName     = oPI.PrinterName;
        valTrueType        = oPI.TrueTypeOption;

        // Use the PrintJobProfile object to set specific printer settings
        // for the print job if the default options are not what is needed.
        APSpoolerNET.PrinterProfile oPJP = objVAR.PrintJobProfile("SettingsOne");

        oPJP.BinSource       = 15;
        oPJP.Collate         = false;
        oPJP.ColorMode       = NameSpace.ColorMode.Color;
        oPJP.DPI             = 300;
        oPJP.Duplex          = NameSpace.DuplexMode.Simplex;
        oPJP.FormName        = "SampleForm";
        oPJP.Nup             = 0;
        oPJP.Orientation     = NameSpace.Orientation.Portrait;
        oPJP.PaperSize       = NameSpace.PaperSize.Letter;
        oPJP.PrinterName     = "Microsoft Print to PDF";
        oPJP.PrintOddEvenAll = NameSpace.PrintPages.AllPages;
        oPJP.ProfileName     = "SettingsOne";
        oPJP.Scaling         = NameSpace.PrintScaling.Custom;
        oPJP.CustomScaling   = 95.0f;
        oPJP.TrueTypeOption  = NameSpace.TrueTypeOptions.Substitute;

        // File specific settings
        objVAR.Copies           = 1;
        objVAR.PageRange        = "1-2,4";
        objVAR.PrintAnnotations = true;

        // Print a PDF
        results = objVAR.PrintFile(oPJP, strPath + "5pageLI.pdf");
        if (results.SpoolerStatus != SpoolerDK.Results.SpoolerStatus.Success)
        {
            ErrorHandler("PrintFile", results, results.SpoolerStatus.ToString());
        }

        // Release Object
        objVAR = null;

        // Process Complete
        WriteResults("Done!");
    }