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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Create PDF as Printer
  FAQ FAQ  Forum Search   Register Register  Login Login

Create PDF as Printer

 Post Reply Post Reply
Author
Message
almiceli View Drop Down
Beginner
Beginner


Joined: 25 May 13
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote almiceli Quote  Post ReplyReply Direct Link To This Post Topic: Create PDF as Printer
    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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 13 at 2:22PM
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.
Back to Top
almiceli View Drop Down
Beginner
Beginner


Joined: 25 May 13
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote almiceli Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jun 13 at 9:05PM
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store