Name
  pdf.GetLastError -- get last error code (V1.1)
Synopsis

      error = pdf.GetLastError()

Function
  If pdf.OpenDocument() fails, `pdf.GetLastError()` can be used to get additional information why the document couldn't be opened. This is especially useful to find out if the document couldn't be opened because it is password-protected.

  `pdf.GetLastError()` will return one of the following error codes:

  `#PDFERR_SUCCESS:`
    No error occurred.

  `#PDFERR_UNKNOWN:`
    An unknown error occurred.

  `#PDFERR_FILE:`
    The file couldn't be found.

  `#PDFERR_FORMAT:`
    The file format couldn't be recognized.

  `#PDFERR_PASSWORD:`
    The PDF document is password-protected.

  `#PDFERR_SECURITY:`
    Security settings forbid opening of this document.

  `#PDFERR_PAGE:`
    The page table is corrupted.

  Note that you have to call `pdf.GetLastError()` immediately after pdf.OpenDocument() to get the correct result code.

Inputs
  none

Results
  error
    last error code

Show TOC