Page 1 of 1

vb6- sometimes white pdf when printing jpg

PostPosted: Fri Jul 26, 2013 1:33 pm
by CarlosCB
I have this example:

dim Util as Object, Settings as Object
Dim ImpreAntes As String
Dim sPrinterName As String
Dim prtidx As Integer

ImpreAntes = Printer.DeviceName

Set Util = CreateObject(Bullzip.PDFUtil)
sPrinterName = Util.defaultprintername

Rem -- Configure the PDF print job
Set Settings = CreateObject(Bullzip.PDFSettings)
Settings.Printername = sPrinterName
Settings.SetValue "Output", "C:\SALIDA.PDF"
Settings.SetValue "ConfirmOverwrite", "no"
Settings.SetValue "ShowSaveAS", "never"
Settings.SetValue "ShowSettings", "never"
Settings.SetValue "ShowPDF", "no"
Settings.SetValue "RememberLastFileName", "no"
Settings.SetValue "RememberLastFolderName", "no"
Settings.WriteSettings True

prtidx = PrinterIndex(sPrinterName)
Set Printer = Printers(prtidx)
Printer.PaintPicture Picture1.Picture, 0, 0, Printer.Width, Printer.Height
Printer.NewPage
Printer.EndDoc

Dim runonce As String
runonce = Settings.GetSettingsFilePath(True)
Util.WaitForFile runonce, 500
prtidx = PrinterIndex(ImpreAntes)



It's fine, but in other PC this code sometimes only output a pdf with one black page and no error in log file.

Can you help me, please :wink: