Here's one test:
Code: Select all
@REQUIRE "polybios"
f$="pdfpwtest.pdf"
If Not Exists(f$)
; Download a test file from http://www.novapdf.com/kb/pdf-example-files-created-with-novapdf-138.html
; The password should be "test"
DownloadFile("http://www.novapdf.com/uploads/novapdf_en/media_items/pdf-example-password.original.pdf", {File=f$})
EndIf
If Exists(f$)
pdf.OpenDocument(1, f$, {Password = "test"}) ; <- Fails here always
PDF_DOCUMENT=pdf.GetObjectType()
pdfpages=GetAttribute(PDF_DOCUMENT, 1, #PDFATTRPAGES)
DebugPrint(pdfpages)
EndIf