Accusoft.PdfXpress5.Net
Load PDF from File
See Also Send Feedback
PDF Xpress 5 for .NET - User Guide > How To > Load PDF from File

Glossary Item Box

PDF Xpress™ supports opening a PDF file from the local file system. To load an existing PDF file, create a new Document object, specifying OpenOptions if desired.  

PDF Xpress does not directly support remote file communication protocols, such as HTTP and FTP, to load PDF files.             
PDF Xpress can load any well-formed PDF up to PDF version 1.7. PDF Xpress saves all documents in PDF version 1.6.                                                                     
C# Example Copy Code
// This code demonstrates loading a PDF document from file  
public void LoadFromFile( PdfXpress pdfxpress , String filename , String password )
    {
      Document document = null ;
      try
      {  
         pdfxpress.Licensing.LicenseEdition  = LicenseChoice.ReaderEdition ;
         OpenOptions options                 = new OpenOptions( ) ;
         options.Filename                    = filename ;
         options.Password                    = password ;
         options.Repair                      = false ;
         document                            = new Document( pdfxpress , options ) ;
      }
      catch (PdfXpressNotIntializedException) { } // Initialize PDF Xpress before using this feature
      catch ( PdfXpressLicensingException )   { } // PDF Xpress is not licensed for this feature            
      catch ( DamagedFileException )          { } // PDF is damaged; try enabling OpenOptions.Repair
      catch ( InvalidPasswordException )      { } // The supplied password does not open the PDF document
      catch ( PdfXpressLibraryException )     { } // A problem was encountered attempting to open the PDF document
      catch ( PdfXpressException )            { } // A problem was encountered
      finally
        {
         if ( null != document )
          {
             document.Dispose( ) ;           // Close the PDF document
          }        
        }
    }

 

See Also

©2012. Accusoft Corporation. All Rights Reserved.