pdf viewer ocx

VeryPDF WinForm PDF Viewer for .NET is a WinForm PDF Viewer Control for C# and VB.NET developers

As the world becomes increasingly digital, the use of PDF files is becoming more and more ubiquitous. For software developers, the need for a reliable PDF viewer is essential. Fortunately, VeryPDF has developed a powerful WinForm PDF Viewer control for .NET developers that is highly customizable and easy to embed in any .NET WinForm application.

VeryPDF PDF Viewer OCX Control,
https://www.verypdf.com/app/pdf-editor/pdf-viewer-ocx-control-activex.html

VeryPDF WinForm PDF Viewer for .NET is a lightweight, accurate, and efficient solution that allows developers to display and interact with PDF files without relying on an external viewer. With its transparent pricing and a free evaluation edition, it is an affordable and convenient option for developers who need to work with PDF documents.

image

One of the standout features of VeryPDF WinForm PDF Viewer is its ability to customize the viewing window, which allows developers to display the PDF file in any size or shape they need. In addition, it is possible to navigate to specific pages, control the page zoom and viewable area, and retrieve document permissions and page count.

VeryPDF WinForm PDF Viewer also allows for easy searching and highlighting of keywords within the PDF document. It can display form field content and flatten fields, making it a versatile tool for working with PDF forms. Furthermore, it is possible to retrieve document properties such as the title, author, and keywords, as well as the current view and retain it for later use.

The WinForm PDF Viewer control comes with its own toolbar and bookmarks/navigation panel control, which developers can easily modify or disable as needed. It also includes the ability to zoom to a selected area, change units of measurement, and print a selected area of a page. The Viewer status bar can be shown or hidden based on user preference.

One of the most significant advantages of VeryPDF WinForm PDF Viewer for .NET is its transparent pricing. There are no hidden costs or fees, and developers can take advantage of a free evaluation edition before making a purchase. This makes it an accessible option for developers of all sizes and budgets.

VeryPDF WinForm PDF Viewer for .NET Features:
* Display a PDF from File or Byte Array           
* Open a Password Protected/Encrypted PDF           
* Display Without Toolbars           
* Customize the Viewing Window           
* Display Form Field Content (Flattens Fields)           
* Navigate to specific Pages           
* Control Page Zoom and Viewable Area           
* Navigate Forward and Back           
* Retrieve Outlines (Bookmarks)           
* Search and Highlight Keywords           
* Print a PDF           
* Retrieve Document Permissions           
* Retrieve Page Count           
* Retrieve Document Properties (Title, Author, Keywords, etc.)           
* Retrieve the current View and retain it later           
* Able to track Pages and its position in display           
* Independent toolbar and bookmarks/navigation panel control.           
* Zoom to selected area (Marquee Zoom).           
* Change units of measurement.           
* Print selected area of a page.           
* Show/hide Viewer status bar.

VeryPDF WinForm PDF Viewer for .NET is a reliable, customizable, and embeddable WinForm PDF Viewer control that is perfect for developers working with PDF files. With its wide range of features and affordable pricing, it is an excellent option for anyone looking to improve their PDF viewing capabilities.

➤ Want to buy this product from VeryPDF?

Should you be interested in acquiring a license for our product or require assistance in developing a custom software solution based on it, please do not hesitate to reach out to us. Our team is always ready to assist you and provide you with the necessary support.

http://support.verypdf.com/

We look forward to the opportunity of working with you and providing developer assistance if required.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
hookprinter, verypdf sdk & com

Effortlessly capture and convert print jobs with VeryPDF HookPrinter SDK software

VeryPDF HookPrinter SDK software is a powerful tool that enables developers to capture print jobs and convert them into PDF, text, and image files. It also allows users to upload these files to a web server for future use. This software is particularly useful for those who need to capture and reuse print jobs in various formats.

image

If you are looking for a way to convert print jobs to PDF, text, or image files, VeryPDF HookPrinter SDK software is an excellent solution. With this software, you can easily capture print jobs and convert them into various file formats, such as PDF, text, and image files. This means that you can save the print job in a format that is more accessible and reusable.

VeryPDF HookPrinter SDK,
https://www.verypdf.com/app/hookprinter/index.html

VeryPDF HookPrinter Print Logger,
https://veryutils.com/hookprinter-print-logger

Moreover, if you integrate VeryPDF PDFPrint Command Line software and VeryPDF HookPrinter SDK software together, you can take print jobs to the next level. When you print a document to any printer in your system, VeryPDF HookPrinter SDK will capture this print job, convert it to a PDF file, and then re-print this PDF file to another Windows Printer continue. This integration provides an excellent solution for those who need to manipulate print jobs and print them in various formats.

VeryPDF HookPrinter SDK software is a royalty-free software for redistribution. This means that developers can use this software to create their own applications without any additional licensing costs. This feature is particularly useful for those who need to create applications that capture print jobs and convert them into various file formats.

One of the most significant advantages of using VeryPDF HookPrinter SDK software is its ease of use. The software comes with an easy-to-use interface that makes it easy for developers to capture and convert print jobs. The software is also easy to install and set up, making it an excellent solution for those who need to start capturing print jobs quickly.

Another advantage of using VeryPDF HookPrinter SDK software is its flexibility. The software supports various file formats, such as PDF, text, and image files. This means that developers can convert print jobs into the format that best suits their needs. The software also allows users to upload these files to a web server for future use.

In conclusion, VeryPDF HookPrinter SDK software is an excellent tool for developers who need to capture and convert print jobs. With its ease of use, flexibility, and royalty-free licensing, this software is an excellent solution for those who need to create applications that capture print jobs and convert them into various file formats. By integrating this software with VeryPDF PDFPrint Command Line software, developers can take print jobs to the next level and print them in various formats.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf linearization optimizer, pdf security, verypdf sdk & com

Secure and Linearize PDF files using VeryPDF PDF Security API

Introducing VeryPDF PDF Security API: The Ultimate Solution for Securing PDF Files.

In today's digital age, securing electronic documents is of utmost importance. PDF files are widely used for document exchange, and it's essential to secure them against unauthorized access, modification, or distribution. VeryPDF PDF Security API is a powerful tool that enables developers to add security features to PDF files programmatically. In this article, we'll introduce you to this tool and highlight its features and benefits.

image

What is VeryPDF PDF Security API?

VeryPDF PDF Security API is a software development kit (SDK) that allows developers to add security features to PDF files programmatically. This API provides a simple and easy-to-use interface that can be integrated into various programming languages such as C++, C#, VB.NET, and Java. It supports linearization and can add various security features to PDF files, including password protection, encryption, and access control.

Features and Benefits for VeryPDF PDF Security API:

1. Password Protection: VeryPDF PDF Security API allows developers to add password protection to PDF files. This feature prevents unauthorized access to the document and ensures its confidentiality. You can set a user password and a master password, which provides different levels of access control.

2. PDF Encryption: The API supports various encryption algorithms, including 128-bit and 256-bit AES encryption. This feature provides strong security for PDF files, making it impossible to read or modify the content without the correct password.

3. Access Control: VeryPDF PDF Security API allows developers to set access control parameters for PDF files. You can restrict access to printing, copying, or modifying the document. This feature ensures the integrity of the document and prevents unauthorized distribution.

4. PDF Linearization: VeryPDF PDF Security API can also linearize PDF files for fast web view. Linearization is a process that optimizes the PDF file for web viewing, making it faster to load and view on the internet.

5. Easy to Use: The API provides a simple and easy-to-use interface that can be integrated into various programming languages. You can customize the security settings and add security features to PDF files with just a few lines of code.

6. Secure: VeryPDF PDF Security API uses industry-standard encryption algorithms to ensure the security of PDF files. It provides options for password protection and access control to further enhance security.

How to Use VeryPDF PDF Security API?

Using VeryPDF PDF Security API is straightforward. Here are the basic steps:

1. Download and install the API on your computer.

2. Create a new project in your programming language and add the API to your project.

3. Load the PDF file that you want to secure.

4. Customize the security settings, including the password, encryption, and access control parameters.

5. Add the security features to the PDF file.

6. Save the modified PDF file to the desired location.

VeryPDF PDF Security API is a powerful and efficient tool that provides developers with an easy and reliable way to add security features to PDF files. Its features such as password protection, encryption, access control, and linearization make it the ultimate solution for securing PDF files. With VeryPDF PDF Security API, you can ensure the confidentiality and integrity of your PDF documents easily and securely.

➤ Want to buy this product from VeryPDF?

Should you be interested in acquiring a license for our product or require assistance in developing a custom software solution based on it, please do not hesitate to reach out to us. Our team is always ready to assist you and provide you with the necessary support.

http://support.verypdf.com/

We look forward to the opportunity of working with you and providing developer assistance if required.

C++ example to Secure PDF files using VeryPDF PDF Security API:

#include <stdio.h>          /* Use standard Input/Output Console API */
#include "VSLibA.h"         /* Use VeryPDF PDF Library */
#include "VSExcept.h"       /* Use Exceptions API */
#include "VSError.h"        /* Use Errors API */
#include "VSDocA.h"         /* Use PDF Document API */
#include "VSPageA.h"        /* Use PDF Page Document API */

int main( int argc, char* argv[] ) /* Get PDF filename as first parameter */
{
    PDFLibHandle    PDFLibrary; /* PDF Library Handle */
    PDFDocHandle    Doc = NULL; /* PDF Document Handle */
    ppInt32         ErrorCode;  /* Check Error Code */
    char            ErrBuff[256];
    ppInt32         AllPermission = ( prPrint | prModifyContent | prCopyInformation | prModifyAnnotation
        | prFillAcroForm | prExtractTextAndImage | prAssembleDocument | prPrintHiResolution );

    PDFLibrary = InitPDFLibrary( NULL, NULL );/* Initialize PDF Library */
    if(!PDFLibrary)
        return 0;
    Doc = PDFDocLoadFromFile( PDFLibrary, "../../data/In/PDF/island.pdf" );/* Load existing PDF file */
    if(!Doc)
        return 0;
    PDFDocSetLinearized( Doc, false ); /* Set non-linearize option for crypted PDF file */
#ifdef WINDOWS_PLATFORM
    PDFDocSetAutoLaunch( Doc, true );   /* Launch destination PDF file after work */
#endif    
    /* Set security on pdf-file with all permissions, 128-bits crypt key and passwords :
    user - "123", owner - "12345" */
    PDFDocSetSecurity( Doc, AllPermission, pt128BitProtection, "123", "12345" );
    PDFDocSaveToFile( Doc, "../../data/Out/PDF/SetPassword.pdf" ); /* Save destination PDF file as "set-password.pdf" in current path */
    if ( Doc )
        PDFDocClose ( Doc );/* Close PDF Document and free memory */
    ErrorCode = PDFLASTERROR( PDFLibrary );/* Check last error, if 0 then finished successfully */
    if ( ErrorCode ){
        VSGetErrorStr( ErrorCode, ErrBuff );
        printf("Error: %s\n", ErrBuff);
    }else {
        printf("Success...\n");
    }
    DonePDFLibrary( &PDFLibrary );/* Free PDF Library */
    PDFFINALLYEND( PDFLibrary );/* End of try...end block */
    return ErrorCode;/* Return Error Code as program result */
}
VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
verypdf sdk & com

Add Digital Signatures and Linearization to PDF files with VeryPDF PDF Digital Signature API

Introducing VeryPDF PDF Digital Signature API: The Ultimate Tool for PDF Digital Signatures.

Digital signatures are a secure and reliable way to authenticate electronic documents. They ensure the authenticity and integrity of the document and protect it from any unauthorized modifications. VeryPDF PDF Digital Signature API is a powerful tool that allows developers to add digital signatures to PDF files programmatically. In this article, we will introduce you to this tool and highlight its features and benefits.

image

What is VeryPDF PDF Digital Signature API?

VeryPDF PDF Digital Signature API is a software development kit (SDK) that allows developers to add digital signatures to PDF files programmatically. This API provides a simple and easy-to-use interface that can be integrated into various programming languages such as C++, C#, VB.NET, and Java. It supports PFX file and can linearize PDF files for fast web view.

Features and Benefits for VeryPDF PDF Digital Signature API:

1. Digital Signature: With VeryPDF PDF Digital Signature API, you can add digital signatures to PDF files easily and securely. You can customize the signature appearance, including the location, size, and color of the signature.

2. PFX File Support: The API supports PFX file, which is a secure and portable format for storing private keys and digital certificates. This feature makes it easy to manage and secure digital signatures.

3. PDF Linearization: VeryPDF PDF Digital Signature API can also linearize PDF files for fast web view. Linearization is a process that optimizes the PDF file for web viewing, making it faster to load and view on the internet.

4. Easy to Use: The API provides a simple and easy-to-use interface that can be integrated into various programming languages. You can customize the signature settings and add digital signatures to PDF files with just a few lines of code.

5. Secure: VeryPDF PDF Digital Signature API uses industry-standard encryption algorithms to ensure the security of digital signatures. It also provides options for password protection and certificate validation to further enhance security.

How to Use VeryPDF PDF Digital Signature API?

Using VeryPDF PDF Digital Signature API is straightforward. Here are the basic steps:

1. Download and install the API on your computer.

2. Create a new project in your programming language and add the API to your project.

3. Load the PDF file that you want to add a digital signature to.

4. Customize the signature settings, including the appearance and location of the signature.

5. Add the digital signature to the PDF file.

6. Save the modified PDF file to the desired location.

VeryPDF PDF Digital Signature API is a powerful and efficient tool that provides developers with an easy and reliable way to add digital signatures to PDF files. Its features such as PFX file support, linearization, and security make it the ultimate tool for PDF digital signatures. With VeryPDF PDF Digital Signature API, you can ensure the authenticity and integrity of your PDF documents easily and securely.

Want to buy this product from VeryPDF?

Should you be interested in acquiring a license for our product or require assistance in developing a custom software solution based on it, please do not hesitate to reach out to us. Our team is always ready to assist you and provide you with the necessary support.

http://support.verypdf.com/

We look forward to the opportunity of working with you and providing developer assistance if required.

C++ example to add Digital Signatures and Linearization to PDF files with VeryPDF PDF Digital Signature API:

#include <stdio.h>
#include <stdlib.h>
#include "VSLibA.h"         /* Use VeryPDF PDF Library */
#include "VSExcept.h"       /* Use Exceptions API */
#include "VSError.h"        /* Use Errors API */
#include "VSDocA.h"         /* Use PDF Document API */
#include "VSAcroFormA.h"    /* Use Acro Objects API */
#include "VSFontA.h"        /* Use Common VeryPDF PDF Routines */
#include "VSTypes.h"
#include "VSDocA.h"
#include "VSExcept.h"
#include "VSError.h" 
#include "VSLibA.h"
#include "VSPageA.h"
#include "VSCanvasA.h"
#include "VSImageA.h"
#include "VSGStateA.h"
#include "VSFontA.h"

int main2( int argc, char* argv[] ) 
{ 
   PDFLibHandle  Lib; 
   PDFDocHandle Doc; 
   ppUns32 ErrorCode; 
   char ErrBuff[200]; 
   ppUns32 Page, ImageIndex, i2; 
   PBXHandle PB; 
   ppUns32 i, Count, w, h, rw, rh; 
   ppReal pw; 
   TPDFRect R; 
   TPDFColor C; 
   PDFImageHandle IMG; 
   Lib = InitPDFLibrary("",""); 
   PDFTRY(Lib){ 
      //Doc = PDFDocCreate(Lib); 
      Doc = PDFDocLoadFromFile( Lib, "../../data/in/pdf/empty.pdf" );/* Load existing PDF file */
      PDFTRY( Lib ){ 
         PDFDocSetRemoveUnUsed( Doc, false); 
         PDFDocAppendPage2( Doc, psA4, poPagePortrait); 
         //PDFDocAppendSignatureFromFile ( Doc, "Data\In\dig-signature.pfx","Sign", "Test Only...",false, "123456");    
         PDFDocAppendSignatureFromFile( Doc, "../../data/in/other/dig-signature.pfx", "Document Signature", "Only for test...", false, "123456" );
         C.Device = cgGray; 
         C.Color.Gray = 0.5; 
         PDFFontTrueTypeAppend( Doc, "Tahoma", false, false ); 
         R.xl = 0; 
         R.yl = 0; 
         R.xr = 110; 
         R.yr = 110; 
         PB = PDFPagePlaceSignature(Doc, 0, R, 72); 
         PBXSetColor (PB, C); 
         PBXNewPath (PB); 
         PBXMoveTo (PB, 0,0); 
         PBXLineTo (PB, 100, 100); 
         PBXMoveTo (PB, 0, 100); 
         PBXLineTo ( PB, 100, 0 ); 
         PBXStroke (PB); 
         PBXSetActiveFont( PB, 0, 10, false, false); 
         PBXTextOut(PB, 0,0,0,"Test"); 
         PBXClose (PB, false); 
         PDFDocSetAutoLaunch ( Doc, true); 
         PDFDocSaveToFile (Doc, "C:\\TSign.pdf"); 
      } PDFFINALLY (Lib){ 
         PDFDocClose ( Doc); 
      } PDFFINALLYEND (Lib); 
   } PDFFINALLY (Lib){ 
      ErrorCode = PDFLASTERROR( Lib ); /* Check last error, if 0 then finished successfully */ 
      if ( ErrorCode ){ 
         VSGetErrorStr( ErrorCode, ErrBuff ); 
         printf("Error: %sn", ErrBuff); 

      }else { 
         printf("Success...n"); 
      } 
      DonePDFLibrary( &Lib ); 
   } PDFFINALLYEND (Lib); 
   return ErrorCode; 
} 

int main( int argc, char* argv[] )  /* Get PDF filename as first parameter */
{
   PDFLibHandle    PDFLibrary; /* PDF Library Handle */
   PDFDocHandle    Doc = NULL; /* PDF Document Handle */
   ppInt32         ErrorCode;/* Check Error Code */
   char            ErrBuff[256];
   PBXHandle PB; 
   ppUns32 i, Count, w, h, rw, rh; 
   ppReal pw; 
   TPDFRect R; 
   TPDFColor C; 
   int FontIndex;
   int GraphicState;  /* Graphic state index */
   int I;             /* Image index variable */

    PDFLibrary = InitPDFLibrary(NULL, NULL);/* Initialize PDF Library */
    PDFTRY ( PDFLibrary ){
		Doc = PDFDocLoadFromFile( PDFLibrary, "../../data/in/pdf/empty.pdf" );/* Load existing PDF file */
		PDFDocSetLinearized( Doc, false );/* Set non-linearize option for crypted PDF file */

		if ( PDFDocGetPageCount( Doc ) > 0 ) {/* If have one or more pages in source document */
#ifdef WINDOWS_PLATFORM
			PDFDocSetAutoLaunch( Doc, true );   /* Launch destination PDF file after work */
#endif          
			/* Append digital signature from file */
			PDFDocAppendSignatureFromFile( Doc, "../../data/in/other/dig-signature.pfx", "Document Signature", "Only for test...", false, "123456" );

            C.Device = cgGray; 
            C.Color.Gray = 0.5; 
            //PDFFontTrueTypeAppend( Doc, "Tahoma", false, false ); 
            R.xl = 0; 
            R.yl = 0; 
            R.xr = 110; 
            R.yr = 110; 
            PB = PDFPagePlaceSignature(Doc, 0, R, 72); 
            PBXSetColor (PB, C); 
            PBXNewPath (PB); 
            PBXMoveTo (PB, 0,0); 
            PBXLineTo (PB, 100, 100); 
            PBXMoveTo (PB, 0, 100); 
            PBXLineTo ( PB, 100, 0 ); 
            PBXStroke (PB); 
   
            //I = PDFImageAppendToDocFromFile ( Doc, "../../data/In/Images/water.png",  itcJPEG, 0 ); /* Load image and assign image index */
            I = PDFImageAppendToDocFromFile ( Doc, "../../data/In/Images/snow.jpg", itcJPEG, 0 ); /* Load image and assign image index */
            PBXShowImage ( PB, I, 0, 0.0, 110, 110, 0);     /* Insert image into document on the current page slopping 30grad*/
            
            PBXClose (PB, false); 
            PDFDocSetAutoLaunch ( Doc, true); 
   
            PDFDocSaveToFile( Doc, "C:/SignDocTest.pdf" );/* Save destination PDF file as "sign-doc-test.pdf" in current path */
        }
    } PDFFINALLY( PDFLibrary ){/* Do further if haven't PDF Library Exceptions */
        if ( Doc ) PDFDocClose ( Doc );/* Close PDF Document and free memory */
        ErrorCode = PDFLASTERROR( PDFLibrary );/* Check last error, if 0 then finished successfully */
        if ( ErrorCode ){
            VSGetErrorStr( ErrorCode, ErrBuff );
            printf("Error: %s\n", ErrBuff);
        }else {
            printf("Success...\n");
        }
        DonePDFLibrary( &PDFLibrary );/* Free PDF Library */
    } PDFFINALLYEND( PDFLibrary );/* End of try...end block */
    return ErrorCode;/* Return Error Code as program result */
}
VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf split-merge, verypdf sdk & com

Split, merge, clone, copy, delete, rotate, and resize PDF pages with VeryPDF PDF Page Manager API

Introducing VeryPDF Page Manager API: The Ultimate Tool for PDF Page Management.

Managing PDF pages can be a daunting task, especially when dealing with large PDF documents. Fortunately, VeryPDF Page Manager API offers a powerful solution to manage PDF pages easily and efficiently. With VeryPDF Page Manager API, you can split, merge, clone, copy, rotate, and resize PDF pages with just a few lines of code. In this article, we will introduce you to this powerful PDF page management tool and highlight its features and benefits.

image

What is VeryPDF Page Manager API?

VeryPDF Page Manager API is a software development kit (SDK) that allows developers to manage PDF pages programmatically. It provides a simple and easy-to-use API that can be integrated into various programming languages such as C++, C#, VB.NET, and Java. With this API, you can split, merge, clone, copy, rotate, and resize PDF pages programmatically, without the need for any third-party software.

Features and Benefits for VeryPDF Page Manager API:

1. Split PDF pages: VeryPDF Page Manager API allows you to split PDF pages into multiple pages, either by a fixed number of pages or by specifying page ranges. This feature is particularly useful when dealing with large PDF documents.

2. Merge PDF pages: The API also allows you to merge multiple PDF pages into a single page. This feature is useful when you want to combine several PDF pages into a single document.

3. Clone PDF pages: With VeryPDF Page Manager API, you can clone PDF pages and create multiple copies of a single page. This feature is useful when you want to repeat a specific page in your PDF document.

4. Copy PDF pages: The API also allows you to copy PDF pages from one document to another, making it easy to reuse pages from existing PDF documents.

5. Rotate PDF pages: VeryPDF Page Manager API enables you to rotate PDF pages by 90, 180, or 270 degrees. This feature is particularly useful when dealing with scanned PDF documents that need to be rotated for proper viewing.

6. Resize PDF pages: The API also allows you to resize PDF pages by specifying custom dimensions. This feature is useful when you want to adjust the page size of your PDF document to fit a specific output device.

How to Use VeryPDF Page Manager API?

Using VeryPDF Page Manager API is straightforward. Here are the basic steps:

1. Download and install the API on your computer.

2. Create a new project in your programming language and add the API to your project.

3. Use the API's functions to split, merge, clone, copy, rotate, or resize PDF pages. You can customize the settings to suit your needs.

4. Save the modified PDF document to the desired location.

VeryPDF Page Manager API is a powerful and efficient tool that provides developers with an easy and reliable way to manage PDF pages. Its features such as split, merge, clone, copy, rotate, and resize PDF pages make it the ultimate tool for PDF page management. With VeryPDF Page Manager API, you can manage your PDF documents easily and efficiently, saving you time and effort.

Want to buy this product from VeryPDF?

Should you be interested in acquiring a license for our product or require assistance in developing a custom software solution based on it, please do not hesitate to reach out to us. Our team is always ready to assist you and provide you with the necessary support.

http://support.verypdf.com/

We look forward to the opportunity of working with you and providing developer assistance if required.

C++ example source code to split, merge, clone, copy, delete, rotate, and resize PDF pages with VeryPDF Page Manager API:

#include <stdio.h>          /* Use standard Input/Output Console API */

#include "VSLibA.h"         /* Use VeryPDF PDF Library */
#include "VSExcept.h"       /* Use Exceptions API */
#include "VSError.h"        /* Use Errors API */
#include "VSDocA.h"         /* Use PDF Document API */

#include "VSPagesA.h"       /* Use Pages API */

int main( int argc, char* argv[] )              /* Get PDF filename as first parameter */
{
    PDFLibHandle    PDFLibrary = NULL;          /* PDF Library Handle */

    PDFDocHandle    SourceDocument      = NULL; /* Source PDF Document Handle */
    PDFDocHandle    DestinationDocument = NULL; /* Destination PDF Document Handle */

    PPDFDocumentConnection DocumentConnection;  /* Document Connection Structure */
    ppInt32         ErrorCode;                  /* Check Error Code */
    char            ErrBuff[256];
    ppInt32         i;                          /* Variable counter */

    PDFLibrary = InitPDFLibrary( NULL, NULL );/* Initialize PDF Library */
    PDFTRY( PDFLibrary ) {/* On error keep exception */

            SourceDocument = PDFDocLoadFromFile( PDFLibrary, "verypdf-test1.pdf" );/* Load existing source PDF file */
            DestinationDocument = PDFDocCreate( PDFLibrary );/* Create new destination PDF file */
#ifdef WINDOWS_PLATFORM
            PDFDocSetAutoLaunch( DestinationDocument, true );   /* Launch destination PDF file after work */
#endif    
            /* Initialize source and destination documents connection */
            DocumentConnection = PDFCreateDocumentConnection( SourceDocument, DestinationDocument );

            /* Take each page from source PDF document, by increase page number and select it for copy */
            for ( i = 0; i < PDFDocGetPageCount( SourceDocument ); i++ )
                PDFSelectPageFromSourceDocument( DocumentConnection, i );

            /* Copy all selected in connection pages from source to destination PDF Document */
            PDFCopyPagesToDestinationDocument( DocumentConnection );

            /* Take each page from source PDF document, by decrease page number and select it for copy */
            for ( i = PDFDocGetPageCount( SourceDocument ); i > 0; i-- )
                PDFSelectPageFromSourceDocument( DocumentConnection, i - 1 );

            /* Copy all selected in connection pages from source to destination PDF Document */
            PDFCopyPagesToDestinationDocument( DocumentConnection );

            /* Disconnect PDF documents, free memory and load destination document pages */
            PDFFreeDocumentConnection( DocumentConnection );
            PDFDocClose ( SourceDocument );
            SourceDocument = PDFDocLoadFromFile( PDFLibrary, "verypdf-test2.pdf" );/* Load existing source PDF file */
            /* Initialize source and destination documents connection */
            DocumentConnection = PDFCreateDocumentConnection( SourceDocument, DestinationDocument );

            /* Take each page from source PDF document, by increase page number and select it for copy */
            for ( i = 0; i < PDFDocGetPageCount( SourceDocument ); i++ )
                PDFSelectPageFromSourceDocument( DocumentConnection, i );

            /* Copy all selected in connection pages from source to destination PDF Document */
            PDFCopyPagesToDestinationDocument( DocumentConnection );

            /* Take each page from source PDF document, by decrease page number and select it for copy */
            for ( i = PDFDocGetPageCount( SourceDocument ); i > 0; i-- )
                PDFSelectPageFromSourceDocument( DocumentConnection, i - 1 );

            /* Copy all selected in connection pages from source to destination PDF Document */
            PDFCopyPagesToDestinationDocument( DocumentConnection );

            /* Disconnect PDF documents, free memory and load destination document pages */
            PDFFreeDocumentConnection( DocumentConnection );

            /* Save destination PDF file as "verypdf-out" in current path */
            PDFDocSaveToFile( DestinationDocument, "verypdf-out.pdf" );

    } PDFFINALLY( PDFLibrary ) { /* Do further if haven't PDF Library Exceptions */
        /* Close source PDF Document and free memory */
        if ( SourceDocument ) PDFDocClose ( SourceDocument );
        /* Close destination PDF Document and free memory */
        if ( DestinationDocument ) PDFDocClose ( DestinationDocument );
        ErrorCode = PDFLASTERROR( PDFLibrary );/* Check last error, if 0 then finished successfully */
        if ( ErrorCode ){
            VSGetErrorStr( ErrorCode, ErrBuff );
            printf("Error: %s\n", ErrBuff);

        }else {
            printf("Success...\n");
        }
        DonePDFLibrary( &PDFLibrary );/* Free PDF Library */
    }
    PDFFINALLYEND( PDFLibrary );/* End of try...end block */
    return ErrorCode; /* Return Error Code as program result */
}
VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)