Supressing the Print Dialog

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
BrianDev
Posts: 3
Joined: Thu Apr 08 2004

Supressing the Print Dialog

Post by BrianDev »

Hello all, Currently I've developed a custom dll in VB that utilizes the cdintf210.dll for HTML to PDF creation. The only thing I can't get past is supressing the Print dialog. :? Does anyone know how to keep the Print dialog from coming up? My dll will be called from an ASP page. thanks in advance for any help.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

If you are mentioning the Print dialog box that appears for a couple of seconds when printing and show a text similar to ' now document aaaa is being printed' and a cancel buttong, than this dialog box is generated by the application from which you are printing and not from the PDF Converter itself.

Please specify which application you are printing from.

Thanks.
BrianDev
Posts: 3
Joined: Thu Apr 08 2004

Post by BrianDev »

I'm not printing from any specific application. I calling the CDIntf dll and doing a batch print from my custom server side dll(written in VB). Below is the function I'm calling. In a nutshell, I'm passing in the HTML that I want to appear on the PDF. The HTML string passed in is written to disk on the server, then the resulting html file is pulled into the CDIntfEx dll provided by Amyuni then a BatchPrint method is called passing in the location of the html file. This is when the print dialog comes up. Thanks for any help you can give :) .

Public Function getPDF(htmlToPrint As String) As Boolean
On Error GoTo pdf_err
Dim htmlFileCreated As Boolean
Dim PrinterName As String
Dim Licensee As String
Dim LicCode As String

htmlFileCreated = writeHTMLFile(htmlToPrint) 'function using fso to build physical html file on disk. This writes tempfile.htm to the disk.
If htmlFileCreated Then
Dim pdfName As String
Set pdfWriter = New CDIntfEx.CDIntfEx
PrinterName = "Amyuni PDF Converter"
Licensee = "Evaluation Version Developer"
LicCode = "..." 'I deleted this since I'm posting this in the forum

pdfName = "outputPDF.pdf"
With pdfWriter
.DriverInit PrinterName
.EnablePrinter Licensee, LicCode
.SetDefaultPrinter
.PaperSize = 5
.Orientation = 1
.DefaultFileName = "C:\PDF\PDFDrop\" & pdfName
.FileNameOptions = 1 + 2
.SetDefaultConfig
.BatchConvert "C:\PDF\HTMLDrop\tempfile.htm" '<----This line is where the print dialog comes up
.FileNameOptions = 0
.RestoreDefaultPrinter
End With
End If
getPDF = True
Exit Function
pdf_err:
getPDF = False
End Function
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Brian,

All what BatchConvert() does is opening the document to be converted in the corresponding application and printing it to the PDF Printer.

So BatchConvert will print using the application on your system that is used to view Html files.

Try to open the HTML file on your system and print it to any physical printer, will you get the Print dialog box that you are mentioning?

If you do than what you are getting when calling BatchConvert() is normal, if you don't than please send us an e-mail to support@amyuni.com to check this issue more closely.

Thanks.
kiransurfs2
Posts: 2
Joined: Fri May 21 2004

Suppressing the Print Dialog box

Post by kiransurfs2 »

Same problem here. I know THE DIALOG BOX is a windows printer settings...but somehow when Code used with MS Word to print to PDF..it does it automatically ..without invoking the print dialog box. The batch converter would be meaningful if it can be automated without manual intervention for doing away with the Print dialog box.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

If you are mentioning the small dialog box that appears when printing and disappears alone after a couple of seconds, than as you said this is a Windows issue and not really related to our driver.

This dialog box would appear wether you are printing directly from Word or using BatchConverter and it will disappear alone without any user intervention.

If you are mentioning the SaveAs dialog box that allows you to choose the file name and location of the pdf document that will be generated, than this can be removed by adding NoPrompt (=1) and UseFileName (=2) to your call of FileNameOptions.

You may find technical notes and samples on using the PDF Converter from inside your application at: http://www.amyuni.com/en/support/technotes.html please feel free to download any of them. TN01 is about using the PDF Converter in a server environment and from ASP.

Hope this helps.
Post Reply