Page 1 of 1

PurePDF

Posted: Tue Dec 13, 2011 3:09 am
by shire
Hello,

I'm using PurePDF to create a PDF file. Is there anyone know how to use this functions?

Code: Select all

pdf_IncludeJS()
and

Code: Select all

pdf_IncludeFileJS()
Thank you.

Re: PurePDF

Posted: Thu Dec 15, 2011 4:49 pm
by lazarusoft
http://www.verydoc.com/documents/acrojs ... g_0080.htm
EX:

Code: Select all

pdf_IncludeJS("var pp = this.getPrintParams();pp.pageSubset = pp.constants.subsets.all;pp.interactive = pp.constants.interactionLevel.full;this.print(pp);")

Re: PurePDF

Posted: Fri Dec 16, 2011 2:34 am
by IdeasVacuum
Hmm, seems you have to jump through a few hoops to get Javascript to work the way Adobe expects. They have published a PDF about it:
http://partners.adobe.com/public/develo ... SGuide.pdf


So, the password script would be like this (but note, could only stop access by the casual User):

Code: Select all

sPdfName.s = "C:\MyPdf.pdf"

pdf_Create("P","mm",#PDF_PAGE_FORMAT_A4)

pdf_IncludeJS("var PassOK = 'Click OK to Enter'; var Title = 'Enter Password';var defAnswer = '';var pass = app.response('Enter Password',Title, defAnswer);if(pass!='secret'){this.closeDoc(true)}")

pdf_AddPage()
pdf_Save(sPdfName)

Delay(200)

RunProgram(sPdfName)

Re: PurePDF

Posted: Mon Dec 19, 2011 4:36 am
by shire
@IdeasVacuum:

Thanks for that.

But this code seems to only work when you have a pdf adobe reader; what if you have a different reader?

Re: PurePDF

Posted: Mon Dec 19, 2011 7:07 am
by IdeasVacuum
....Depends entirely on what the alternative PDF Readers support, which tends not to be everything that Adobe support.

You could of course define your own document format and distribute that as either a self-displaying exe or offer a separate viewer for download.
I think sRod's lib 'qDoc' might deliver something like that: http://www.purebasic.fr/english/viewtop ... 14&t=48492