Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
VB6 - Print PDF on the fly .... |
Post Reply |
Author | |
Devil
Team Player Joined: 15 Dec 05 Location: Germany Status: Offline Points: 25 |
Post Options
Thanks(0)
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 |
|
sams177
Beginner Joined: 21 Jul 06 Location: India Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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 |
|
Devil
Team Player Joined: 15 Dec 05 Location: Germany Status: Offline Points: 25 |
Post Options
Thanks(0)
|
All you you need for a "printPreview" .... Call QP.NeedImagePreview(1) Call QP.RenderDocumentToFile(72, 1, 1, 1, App.Path & "\Vorschau.jpg") .... regards Devil |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store