Whats wrong -> PrintDocument ?
Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=209
Printed Date: 22 Nov 24 at 8:00PM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Whats wrong -> PrintDocument ?
Posted By: Devil
Subject: Whats wrong -> PrintDocument ?
Date Posted: 15 Dec 05 at 10:33AM
Hi,
two things, ... first of all, if its possible to communicate in any language ? (i.e. German )
I have a little problem to print out a document with the following sytanx: (i.e. VB6)
'...
I = QP.GetDefaultPrinterName
Call QP.PrintDocument(I, 1, 1, 0)
'...
Document was printed but all Images and all FormFields are empty. The Document has no premission. When I save first the Document and openend a second time with a other call, the Documnet was right. But I need the function to print on the fly, ...
Have anyone any Ideas ?
Thanks
Devil
|
Replies:
Posted By: Ingo
Date Posted: 16 Dec 05 at 2:03AM
Hi "Devil" ;-)
It's my experience that (to avoid compatibility problems with newest pdf-versions) it's often a solution to save and reload the pdf-file for better results.
If you wanna do it "on the fly" you can use this idea, too. ...In this case don't use SaveToFile and LoadFromFile. There're functions (for delphi only) like SaveToStream / SaveToString and LoadFromStream / LoadFromString.
You should prefer to read and write in english here if you want any help. The QuickPDF-users are all over the world - only less in germany (i fear) ;-)
------------- Cheers, Ingo
|
Posted By: Devil
Date Posted: 16 Dec 05 at 2:05AM
@Admin
It seems that I post in the wrong thread,
could you please move to "I need help - I can help" thread.
Thanks
Devil
>>> MOVED AS REQUESTED.
|
Posted By: Devil
Date Posted: 16 Dec 05 at 2:47AM
Hi Ingo,
thx for answering, ...
I use the iSED.dll with VB6 and Adobe V.5, ....
The methode I write is by the way not the best, but it runs !
Makes it sense to use the iSED.dll or better use another dll.
I read some threads about the confusion with iSED/ Sedtech.
There no way to become some better support for this dll ?
Devil
|
Posted By: Ingo
Date Posted: 16 Dec 05 at 3:14AM
Hi!
I'm only using the dcu-components (delphi). Support or not - the wide range of functions and the price is the best you can get.
Anyway it's always the same: This dll or another one? It depends on what you wanna do and which functions you need.
A problem could be in the near future the further developing on the library... but perhaps this will be one of our tasks here in this forum.
------------- Cheers, Ingo
|
Posted By: szelkye
Date Posted: 16 Dec 05 at 9:05AM
I tried following the advice of this thread but I'm still having a problem. The Content of the FormFields are empty for my document. Here is some VB code
iSed.UnlockKey ISED_QUICKPDFKEY lOutDoc = iSed.NewDocument() iSed.LoadFromFile (sSourcePDFFile) lFormDoc = iSed.SelectedDocument For Each sFieldName In mcolFieldVals.Keys On Error Resume Next iSed.SetFormFieldValueByTitle sFieldName, mcolFieldVals(sFieldName) On Error GoTo 0 Next iSed.SelectDocument lOutDoc iSed.MergeDocument lFormDoc iSed.DeletePages 1, 1 iSed.CompressContent iSed.SetNeedAppearances 1 sFileName = getTempPDFFile() iSed.SaveToFile sFileName iSed.LoadFromFile (sFileName) 'iSed.PrintDocument iSed.GetDefaultPrinterName, 1, iSed.PageCount, 0 iSed.PrintDocument iSed.GetDefaultPrinterName, 2, 2, 0 'this is just for debugging so only 1 page prints...
If I load the file (sFileName) in Acrobat right after its saved here, the form fields are there so I don't know.
Please any help would be greatly appreciated.
|
Posted By: Devil
Date Posted: 16 Dec 05 at 9:27AM
Hi Ingo,
thus you mean it are worthwhile yourself this DLL nevertheless to use/buy.
Which I need of these DLL am actually not very much...
A function who open an existing pdf knows their text fields fills out and send the whole on a printer ...
I can realize so far everything with these DLL, up to the deficiency with that expressions.
Unfortunately it seems so for it that no has a correct solution to the hand to solve this problem in VB6 ...
Devil
|
Posted By: Devil
Date Posted: 16 Dec 05 at 9:42AM
Hi Szelkye,
my first Idea was:
' PDF-Bestellformular öffnen
' und Daten aus den Stammdaten entnehmen
Dim QP As iSED.QuickPDF
Set QP = CreateObject("iSED.QuickPDF")
Call QP.UnlockKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") 'secret
Call QP.LoadFromFile(App.Path & "\Bestellformular.pdf")
If QP.Encrypted = 1 Then
QP.SetPassword ("XXXXXXX") 'secret
QP.Unencrypt
End If
Call QP.SetNeedAppearances(1)
Call QP.SetFormFieldValueByTitle("Datum", date)
Call QP.SetFormFieldValueByTitle("Firma", GetIniString("Stammdaten", "Firma", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Name", GetIniString("Stammdaten", "Zusatz", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Strasse", GetIniString("Stammdaten", "Strasse", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Ort", GetIniString("Stammdaten", "PLZ", ja, (App.Path & "\" & App.EXEName & ".ini")) & " " & GetIniString("Stammdaten", "Ort", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Tel", GetIniString("Stammdaten", "Phone", ja, (App.Path & "\" & App.EXEName & ".ini")) & " " & GetIniString("Stammdaten", "Fax", ja, (App.Path & "\" & App.EXEName & ".ini")))
I = QP.GetDefaultPrinterName
Call QP.PrintDocument(I, 1, 1, 0)
Set QP = Nothing
End Sub
All text fields are empty and the Image are missing also on the expressions.I think which I simply a mistake in reasoning in the code have or simply only something forgot...
Devil
|
Posted By: szelkye
Date Posted: 16 Dec 05 at 10:49AM
Devil: You did mostly the same thing I did. You said in your first post that when you saved the document and opened again that it was okay. I don't see that in your code. I tried to do the same thing but I had no success.
|
Posted By: Devil
Date Posted: 16 Dec 05 at 12:49PM
Sorry,
the Code is the one I tried to use for it, but work not right.
The Code I used is the following one:
Dim QP As iSED.QuickPDF
Set QP = CreateObject("iSED.QuickPDF")
Call QP.UnlockKey(XXXXXXXXXXXXXXXXX)
Call QP.LoadFromFile(App.Path & "\Bestellformular.pdf")
If QP.Encrypted = 1 Then
QP.SetPassword ("XXXXXXX")
QP.Unencrypt
End If
Call QP.SetNeedAppearances(1)
Call QP.SetFormFieldValueByTitle("Datum", date)
Call QP.SetFormFieldValueByTitle("Firma", GetIniString("Stammdaten", "Firma", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Name", GetIniString("Stammdaten", "Zusatz", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Strasse", GetIniString("Stammdaten", "Strasse", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Ort", GetIniString("Stammdaten", "PLZ", ja, (App.Path & "\" & App.EXEName & ".ini")) & " " & GetIniString("Stammdaten", "Ort", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SetFormFieldValueByTitle("Tel", GetIniString("Stammdaten", "Phone", ja, (App.Path & "\" & App.EXEName & ".ini")) & " " & GetIniString("Stammdaten", "Fax", ja, (App.Path & "\" & App.EXEName & ".ini")))
Call QP.SaveToFile(App.Path & "\export\" & "0815-20051215.pdf")
Set QP = Nothing
Call ShellExecute(hWnd, "Print", App.Path & "\export\" & "0815-20051215.pdf", "", "", 0)
Devil
|
Posted By: Devil
Date Posted: 30 Dec 05 at 12:50PM
Hi,
here you can find the solution / a sample for the problem,
http://www.quickpdf.org/forum/forum_posts.asp?TID=232&PN=1 - VB6 - Print on the fly, ...
best regrads
Devil
|
|