Accusoft.PdfXpress7.Net
Load PDF from File

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.
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
            {
                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

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback