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!
![]() |
Create PDF as Printer |
Post Reply ![]() |
Author | |
almiceli ![]() Beginner ![]() Joined: 25 May 13 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 25 May 13 at 8:48PM |
I would like to know if I can genrate a pdf document using the printer functionality in VB6.
I have a program that makes drawings and I would like to generate a pdf just like I was sending it to a printer (except use the PDF ActiveX) without worrying about installing a PDF writer. Can anyone help me? Thanks in advance
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
You should try using
to get a handle to a Device Context. Use this DC and draw your document to it just like you would draw to a Printer based DC and then call to create the PDF file in memory and then simply call QP.SaveToFile("output.pdf"); Andrew.
|
|
![]() |
|
almiceli ![]() Beginner ![]() Joined: 25 May 13 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
I tried, but can not get it to work.
This is my code. Can you tell me what I'm doing
wrong? (VB6- Arrays refer to shape objects)
Dim ClassName
Dim LicenseKey Dim FileName ClassName =
"DebenuPDFLibraryAX0914.PDFLibrary"
LicenseKey = "the license key you gave me" Dim QP
Dim Result Set QP = CreateObject(ClassName)
Result = QP.UnlockKey(LicenseKey) 'If Result = 1 Then
MsgBox "Library version: " +
QP.LibraryVersion
MsgBox (QP.LicenseInfo) Call QP.GetCanvasDC(800, 1100) 'Call QP.LoadFromCanvasDC(0, 300, 300) Dim I As Integer
Dim PLeft As Single Dim PTop As Single Dim PWidth As Double Dim LongBoard As Double QP.ScaleMode = 1
QP.ScaleTop = 0 QP.FillColor = &H0& QP.FillStyle = 0 LongBoard = 0
'get longest board For I = 0 To 30 Step 1 If LongBoard < CTD(I).Width Then LongBoard = CTD(I).Width End If If TD(0).Width > LongBoard Then LongBoard = TD(0).Width End If Next I 'CENTER PICTURE
PWidth = QP.Width - (TD(0).Width + 1500 + SVTD(0).Width + SVSTR.Width + SVBED(0).Width) PWidth = QP.Width - (LongBoard + 1500 + SVTD(0).Width + SVSTR.Width + SVBED(0).Width) PLeft = (PWidth / 2) - 1500 PTop = 1200
' LEFT TOP WIDTH HEIGHT QP.CurrentX = 100 QP.CurrentY = 50 'QP.Print "PREPARED BY : " & Form1.PrepBy & " USING: Pallet-Track(R), Click-Draw(TM) SYSTEM." QP.Print QP.FontSize = 14 QP.FontBold = True QP.Print "DESCRIPTION : " & Combo1.Text; QP.CurrentX = QP.Width - QP.TextWidth("DRAWING #: " & Combo3.Text) - 1000 QP.Print "DRAWING # : " & Combo3.Text QP.CurrentX = QP.TextWidth("DESCRIPTION : ") QP.FontBold = False QP.FontSize = 10 QP.Print Combo2.Text; If Check2.Value = 1 Then QP.Print " - PARTIAL 4 WAY ENTRY"; End If If IsNumeric(Text4.Text) Then If CDbl(Text4.Text) > 0 Then If Check7.Value Then QP.Print " - " & Text4.Text & " MM WING" Else QP.Print " - " & Text4.Text & " IN WING" End If Else QP.Print " " End If Else QP.Print " " etc, etc. |
|
![]() |
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