Print Page | Close Window

Python Example

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1265
Printed Date: 28 Apr 24 at 8:41AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Python Example
Posted By: swillis
Subject: Python Example
Date Posted: 04 Nov 09 at 8:50PM
This is a short Python example:

import win32com.client as w32c

LicenseKey = "YourLicenseKeyHere"
FileName = 'hello-world.pdf'

QP = w32c.Dispatch(r"QuickPDFAX0715.PDFLibrary")
Result = QP.UnlockKey(LicenseKey)
if Result == 1:
    print "Valid license key"
    QP.DrawText(100, 500, "Hello world from Python")
    if QP.SaveToFile(FileName) == 1:
        print "File " + FileName + " written successfully"



Replies:
Posted By: hbhntz
Date Posted: 13 Jun 12 at 4:34AM
SmileOk thank you for your demo.

import win32com.client as w32c

LicenseKey = "YourLicenseKeyHere"
FileName = '2.pdf'

QP = w32c.Dispatch(r"QuickPDFAX0815.PDFLibrary")
Result = QP.UnlockKey(LicenseKey)
if Result == 1:
print "Valid license key"
QP.DrawText(100, 500, "Hello world from Python")
if QP.SaveToFile(FileName) == 1:
print "File " + FileName + " written successfully"


I looked at my your code doesn't work, QP. UnlockKey (LicenseKey) returned results for 0, can you answer to it? Thank you



Posted By: Ingo
Date Posted: 13 Jun 12 at 10:17PM
Sorry for this question ... ;-)
I'm sure you didn't use the string "YourLicenseKeyHere"...
You replaced it by your real key i think??? ;-)
What did you got from this line:
w32c.Dispatch(r"QuickPDFAX0815.PDFLibrary")?

Cheers and welcome here,
Ingo


Posted By: hbhntz
Date Posted: 14 Jun 12 at 2:12AM
Smile Thank you for your reply.
 
 I want to ask  " YourLicenseKeyHere" is to point to what?

 The key products? Or PDF files key?

 Can you give a demo I?



 
 


  


Posted By: Wheeley
Date Posted: 14 Jun 12 at 3:03AM
Please go to www.quickpdflibrary.com and read the function reference. This is a user to user forum and we are here to help but you got to do some research also. Simply asking for a simple answer is wasting our time.

Wheeley


Posted By: Ingo
Date Posted: 14 Jun 12 at 6:52AM
You'll need a personal test-licence-key directly from product-page
and not from here.
On the original product-page you'll get many start-up-tutorials
for different languages, too.

Cheers, Ingo



Posted By: hbhntz
Date Posted: 14 Jun 12 at 7:26AM
ok  thank you 


Posted By: hbhntz
Date Posted: 14 Jun 12 at 7:27AM
Thank YOu, I try to do


Posted By: Ingo
Date Posted: 14 Jun 12 at 12:04PM
Don't try it ... do it ;-)

At least your code should look similar to this one:

LicenseKey = "123456789xyz123"
FileName = '2.pdf'

QP = w32c.Dispatch(r"QuickPDFAX0815.PDFLibrary")
Result = QP.UnlockKey(LicenseKey)
if Result == 1:
print "Valid license key"



Posted By: hbhntz
Date Posted: 15 Jun 12 at 1:29AM
ok  Thank YOu  Ingo  

  What you say is very right.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk