Page 1 of 1

.NET issue

Posted: Fri Feb 20, 2015 12:33 pm
by russgreen
I'm trying to use Bullzip and control the settings from my app.

Its an addin at that automates print jobs from some software. The printing aspect is fine. What I do is loop through selectred of sheets to print and send them 1 at a time to various outputs. One of which is PDF using Bullzip.

For Each sheet As ViewSheet In sheets
ExportPDF(sbFile & ".pdf", thisdoc, sheet)
End For

Private Sub ExportPDF(ByVal ExportFileName As String, ByRef thisdoc As Document, ByRef sheet As ViewSheet)
Dim pdfSettings As PdfSettings = New PdfSettings()
pdfSettings.PrinterName = PDFPRINTERNAME
pdfSettings.SetValue("Output", sFullPath)
pdfSettings.SetValue("ShowPDF", "yes")
pdfSettings.SetValue("ShowSettings", "never")
pdfSettings.SetValue("ShowSaveAS", "never")
pdfSettings.SetValue("ShowProgress", "no")
pdfSettings.SetValue("ShowProgressFinished", "no")
pdfSettings.SetValue("ConfirmOverwrite", "no")
pdfSettings.WriteSettings(PdfSettingsFileType.RunOnce)

'DO MY PRINT
End Sub

This works 100% of the time on the first sheet. After that its very random but sometimes its OK others the Bullzip save as dialog pops up which defeats the purpose of automation.

Help!

Re: .NET issue

Posted: Fri Feb 20, 2015 2:39 pm
by jr
Hi,

You may be in a situation where you overwrite an existing runonce.ini before it is picked up by the printer.

Take a look at this:
http://www.biopdf.com/guide/examples/batch_printing/

Regards,
Jacob

Re: .NET issue

Posted: Fri Feb 20, 2015 8:39 pm
by russgreen
Thanks.


Added this after my print method and a quick test seems to have fixed it

Do While My.Computer.FileSystem.FileExists(pdfSettings.GetSettingsFilePath(True).ToString)
'check the runonce file has been removed before progressing.
Threading.Thread.Sleep(1000)
Loop