Ejemplo n.º 1
0
    public static void Example()
    {
        // Instantiate Object
        APDocConverter.DocConverter oDC = new APDocConverter.DocConverter();

        // Release object: .NET = Yes, COM = Yes
        APDocConverter.FromPDFOptions oOne = new APDocConverter.FromPDFOptions();
        oOne.ToWordHeadersAndFootersMode = APDocConverter.ToWordHeadersAndFootersOptions.Detect;
        oDC.SetFromPDFOptions(oOne);

        // Release Object
        oOne = null;

        // Release object: .NET = No, COM = Yes
        APDocConverter.FromPDFOptions oTwo = new APDocConverter.FromPDFOptions();
        oTwo.ToWordHeadersAndFootersMode = APDocConverter.ToWordHeadersAndFootersOptions.Detect;
        oDC.SetFromPDFOptions(oTwo);

        // Release object: .NET = Yes, COM = Yes
        APDocConverter.FromPDFOptions oThree = new APDocConverter.FromPDFOptions();
        oThree.ToWordHeadersAndFootersMode = APDocConverter.ToWordHeadersAndFootersOptions.Detect;
        oDC.SetFromPDFOptions(oThree);

        // Release Object
        oThree = null;

        // Release Object
        oDC = null;

        // Process Complete
        WriteResults("Done!");
    }
Ejemplo n.º 2
0
        static void Process()
        {
            string strPath;

            DCDK.Results.DocConverterResult results;

            //strPath = System.AppDomain.CurrentDomain.BaseDirectory;
            strPath = "c:\\data\\";

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

            // Set the amount of time before a request will time out
            oDC.TimeoutSpan = new TimeSpan(0, 0, 40);

            // Enable extra logging (logging should only be used while troubleshooting)
            // C:\ProgramData\activePDF\Logs\

            oDC.Debug = true;

            // Settings specific to other formats created with from PDF conversions
            // via Solid Documents SDK are set using the FromPDFOptions object
            APDocConverter.FromPDFOptions fPDF = new APDocConverter.FromPDFOptions();

            // To Word options
            fPDF.ToWordHeadersAndFootersMode = APDocConverter.ToWordHeadersAndFootersOptions.Detect;

            // To Excel options
            fPDF.ToExcelAutoDetectSeparators = true;
            fPDF.ToExcelTablesFromContent    = APDocConverter.ToExcelTablesFromContentOptions.Default;

            // To Image options
            fPDF.ToImagePageDPI = 300;

            // Confirm the from PDF settings for conversion via Solid Documents SDK
            oDC.SetFromPDFOptions(fPDF);
            fPDF = null;

            // Convert the document from PDF to another format using Solid Documents SDK
            // The second parameter determines the output file format
            results = oDC.ConvertFromPDF(strPath + "{ZHC4_Final_4c791b2e-25ab-4666-af0f-55f838f02554}.pdf", APDocConverter.FromPDFFunction.ToImageMultiPageTIFF, strPath + "ZHealth_ConvertedToTiff.tif");
            if (results.DocConverterStatus != DCDK.Results.DocConverterStatus.Success)
            {
                ErrorHandler("ConvertFromPDF", results, results.DocConverterStatus.ToString());
            }

            // Release Object
            oDC = null;

            // Process Complete
            WriteResults("Done!");
        }
Ejemplo n.º 3
0
    public static void Example()
    {
        string strPath;

        DCDK.Results.DocConverterResult results;

        strPath = System.AppDomain.CurrentDomain.BaseDirectory;

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

        // Settings specific to other formats created with from PDF conversions
        // are set using the FromPDFOptions object
        APDocConverter.FromPDFOptions fPDF = new APDocConverter.FromPDFOptions();

        // To Word options
        fPDF.ToWordHeadersAndFootersMode = APDocConverter.ToWordHeadersAndFootersOptions.Detect;

        // To Excel options
        fPDF.ToExcelAutoDetectSeparators = true;
        fPDF.ToExcelTablesFromContent    = APDocConverter.ToExcelTablesFromContentOptions.Default;

        // To Image options
        fPDF.ToImagePageDPI = 300;

        // Send the from PDF settings to DocConverter
        oDC.SetFromPDFOptions(fPDF);

        // Release Object
        fPDF = null;

        // Convert the document from PDF to another format
        // The second parameter determines the output file format
        results = oDC.ConvertFromPDF(strPath + "PDF.pdf", APDocConverter.FromPDFFunction.ToWordDocX, strPath + "PDF.docx");
        if (results.DocConverterStatus != DCDK.Results.DocConverterStatus.Success)
        {
            ErrorHandler("ConvertFromPDF", results, results.DocConverterStatus.ToString());
        }

        // Release Object
        oDC = null;

        // Process Complete
        WriteResults("Done!");
    }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string strPath = System.AppDomain.CurrentDomain.BaseDirectory;

            // Instantiate Object
            APDocConverter.DocConverter docConverter =
                new APDocConverter.DocConverter();

            // Enable extra logging (logging should only be used while
            // troubleshooting) C:\ProgramData\activePDF\Logs\
            docConverter.Debug = true;

            // Settings specific to other formats created with from PDF
            // conversions via Solid Documents SDK are set using the
            // FromPDFOptions object
            APDocConverter.FromPDFOptions fromPDFOptions =
                new APDocConverter.FromPDFOptions();

            // To Word options
            fromPDFOptions.ToWordHeadersAndFootersMode =
                APDocConverter.ToWordHeadersAndFootersOptions.Detect;

            // Confirm the from PDF settings for conversion via Solid Documents
            // SDK
            docConverter.SetFromPDFOptions(fromPDFOptions);

            // Convert the Word document from PDF to another format using Solid
            // Documents SDK. The second parameter determines the output file
            // format
            DCDK.Results.DocConverterResult result =
                docConverter.ConvertFromPDF(
                    $"{strPath}DocConverter.PDF.Input.pdf",
                    APDocConverter.FromPDFFunction.ToWordDocX,
                    $"{strPath}DocConverter.ConvertPDFToWord.Output.docx");
            WriteResult(result);
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            string strPath = System.AppDomain.CurrentDomain.BaseDirectory;

            // Instantiate Object
            APDocConverter.DocConverter docConverter =
                new APDocConverter.DocConverter();

            // Enable extra logging (logging should only be used while
            // troubleshooting) C:\ProgramData\activePDF\Logs\
            docConverter.Debug = true;

            // Settings specific to other formats created with from PDF
            // conversions via Solid Documents SDK are set using the
            // FromPDFOptions object
            APDocConverter.FromPDFOptions fromPDFOptions =
                new APDocConverter.FromPDFOptions();

            // To Image options
            fromPDFOptions.ToImagePageDPI = 300;

            // Confirm the from PDF settings for conversion via Solid Documents
            // SDK
            docConverter.SetFromPDFOptions(fromPDFOptions);

            // Convert the file to PDF
            // If the output parameter is not used the created PDF will use
            // the input string substituting the filename extension to 'pdf'
            DCDK.Results.DocConverterResult results =
                docConverter.ConvertFromPDF(
                    $"{strPath}DocConverter.PDF.Input.pdf",
                    APDocConverter.FromPDFFunction.ToImageJPEG,
                    $"{strPath}DocConverter.ToImageJPEG.Output.jpg");
            WriteResult(result);
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }