PurePDF

Just starting out? Need help? Post your questions and find answers here.
shire
User
User
Posts: 46
Joined: Mon Jul 25, 2011 5:24 am

PurePDF

Post 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.
User avatar
lazarusoft
User
User
Posts: 23
Joined: Wed Jan 10, 2007 10:17 pm
Location: Brasil

Re: PurePDF

Post 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);")
JAVA é como uma Ferrari, mas a diferença é que a Ferrari está em um caminhão cegonha... JAVA is like a Ferrari, but the difference is that Ferrari is in a truck stork ...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF

Post 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)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
shire
User
User
Posts: 46
Joined: Mon Jul 25, 2011 5:24 am

Re: PurePDF

Post 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?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply