Print Page | Close Window

DLL Import file for Visual FoxPro

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=1188
Printed Date: 24 Nov 24 at 10:17PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DLL Import file for Visual FoxPro
Posted By: Rowan
Subject: DLL Import file for Visual FoxPro
Date Posted: 27 Aug 09 at 11:21AM
A kind Quick PDF Library user has contributed a DLL import file for Visual FoxPro for everyone to use.

The DLL import file can be download from http://www.quickpdflibrary.com/downloads/QUICKPDFDLL0715.prg - online here .

I haven't tested this, so use it at your own risk. But hopefully it can help a few people.



Replies:
Posted By: MTchary
Date Posted: 04 Sep 09 at 1:58PM
Here is the code you can use to create PDF file and render some text into it:
 
*-- Declare all functions we are going to use
DECLARE LONG QuickPDFUnlockKey IN QuickPDF.DLL STRING sRegKey
DECLARE LONG QuickPDFDocument IN QuickPDF.DLL
DECLARE LONG QuickPDFTextColor IN QuickPDF.DLL DOUBLE dRed, DOUBLE dGreen, DOUBLE dBlue
DECLARE LONG QuickPDFDrawText IN QuickPDF.DLL DOUBLE dXPos, DOUBLE dYPos, STRING sText
DECLARE LONG QuickPDFSaveToFile IN QuickPDF.DLL STRING sFileName
DECLARE LONG QuickPDFRemoveDocument IN QuickPDF.DLL LONG iDocumentID
 
LOCAL lnResult
LOCAL lnSelectedDocumentID
LOCAL lnRed
LOCAL lnGreen
LOCAL lnBlue
 
*-- First we have to unlock QuickPDF
lnResult = QuickPDFUnlockKey("...INSERT_LICENSE_KEY...")
*-- Create new document
lnSelectedDocumentID = QuickPDFNewDocument()
 
FOR lnCount = 1 TO 10
       lnRed = (lnCount/10)*100
       lnGreen = 0
       lnBlue = (1 - lnCount/10)*100
*-- Set the text color
       lnResult = QuickPDFSetTextColor(lnRed, lnGreen, lnBlue)
       lnResult = QuickPDFDrawText (100, 700 - lnCount * 10, "Hello world")
ENDFOR
 
*-- Save document into file
lnResult = QuickPDFSaveToFile("C:\Documents\TestQuickPDF.PDF")
*-- Remove document instance from memory
lnResult = QuickPDFRemoveDocument(lnSelectedDocumentID)


Posted By: mbabcock
Date Posted: 09 Mar 21 at 8:21PM
I downloaded the long list of DECLARES from the OP.  There's just 2 lines where you need to get rid of the trailing "AS LONG" for it to compile without errors.  FYI.



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