Skip to content

Rework usage of FPDF_GetLastError() and PdfiumLibraryBindings::get_pdfium_last_error(). #78

@ajrcarey

Description

@ajrcarey

Indirect follow-on from #60. As pointed out by https://github.com/mara004, FPDF_GetLastError() only applies to nominated functions related to document loading, not to the Pdfium library generally. As a result, it is actually potentially harmful to use this function to check if other API calls returned an error, as it may return a false positive by re-raising an error previously already caught during document loading (since a call to FPDF_GetLastError() does not clear the error flag).

A recent update to the inline documentation clarifies that FPDF_GetLastError() should only be checked after specific functions: https://pdfium.googlesource.com/pdfium/+/e116d6ebc253640da997d10b533dd9aed6aa1c23

In light of this, rework all usage of FPDF_GetLastError() and PdfiumLibraryBindings::get_pdfium_last_error(). Consider removing get_pdfium_last_error() entirely.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions