Print Page | Close Window

VB6 - Print PDF ’on the fly ....

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


Topic: VB6 - Print PDF ’on the fly ....
Posted By: Devil
Subject: VB6 - Print PDF ’on the fly ....
Date Posted: 30 Dec 05 at 12:46PM
Hi,

for all they search for a sample to print any PDF Files on the fly, ....

Sample written for Visual Basic 6:
______________________________________________________
Private Sub Print_on_the_fly_Click()

' Sub to prints PDF Files on the fly without saving

Dim QP As iSed.QuickPDF

Set QP = CreateObject("iSED.QuickPDF")

' GDIPlus.dll needed that the images are printable 'on the fly
Call QP.SetGDIPlusFileName(App.Path & "\GDIPLUS.DLL")

Call QP.UnlockKey("secret")
Call QP.LoadFromFile(App.Path & "\Formular.pdf")


If QP.Encrypted = 1 Then
QP.SetPassword ("secret")
QP.Unencrypt
End If
Call QP.SetNeedAppearances(1)

Call QP.SetFormFieldValueByTitle("Datum", date)
Call QP.SetFormFieldValueByTitle("Firma", Firma.value)
Call QP.SetFormFieldValueByTitle("Name", Name.value)
Call QP.SetFormFieldValueByTitle("Strasse", Strasse.value)
Call QP.SetFormFieldValueByTitle("Ort",PLZ.value & " " & Ort.value)
Call QP.SetFormFieldValueByTitle("Tel", Telfon.value)

' UpdateApperanceStream needed for printable 'on the fly
For pdfFields = 1 To QP.FormFieldCount
Call QP.UpdateAppearanceStream(pdfFields)
Next pdfFields

Call QP.PrintDocument(QP.GetDefaultPrinterName, 1, 1, QP.PrintOptions(0, 0, "Formular"))

Set QP = Nothing
End Sub
_______________________________________________________

best regards
Devil



Replies:
Posted By: sams177
Date Posted: 21 Jul 06 at 5:29AM

Hi !!

  Nice coding.. 

  But I want to diaplay the page before it prints. And ask the user, whether he want to print the page or not.

  Plz post reply to this.

 

 



-------------
Regards,
Sam


Posted By: Devil
Date Posted: 24 Oct 06 at 12:05PM
Originally posted by sams177 sams177 wrote:

Hi !!


Nice coding..


But I want to diaplay the page before it prints. And ask the user, whether he want to print the page or not.


Plz post reply to this.





All you you need for a "printPreview"
....
Call QP.NeedImagePreview(1)
Call QP.RenderDocumentToFile(72, 1, 1, 1, App.Path & "\Vorschau.jpg")
....

regards
Devil





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