Page 2

June Developer Newsletter

(Encryption from page 1)

protected PDF file without specifying a password, the LoadPDFFile method returns with false and the GetLastError method will return with PDFERR_PASSWORD_AUTHENTICATION_ERROR constant.

 

If one tries to read a non-protected PDF file while specifying a password, the LoadPDFFile method will simply

ignore it._

We  have seen some common problems reading 1D Barcodes in our Barcode toolkit in the case where the barcode is not standard. The inability to read these barcodes is not a fault in the toolkit, but with the barcode itself. Figure 2 below is an example of a non-standard Code3of9 barcode.

 

To understand why the barcode is not standard, you need to know that a Code3of9 barcode always starts with a START codeword and always ends with an END codeword. This is not the case with the example below, as this barcode contains 1 extra

Common Problems with 1D Barcodes in the 1D Barcode Read/Write Toolkit

// PDF object

CPDF pdf;

 

// Try to load the PDF file

if (!pdf.LoadPDFFile(lpstrFileName))

{

       // Check if the file is protected

       if (pdf.GetLastError() ==

              PDFERR_PASSWORD_AUTHENTICATION_ERROR)

       {

              // Try to load the PDF file with password

              if (!pdf.LoadPDFFile(lpstrFileName,

                     lpstrPassword))

              {

                     // Cannot open PDF file

}

       }

       else

       {

              // Other error occurred during load PDF file

       }

}

Figure 1

Figure 2