.NET issue

About the programming interface for the virtual PDF printer driver.

Moderator: jr

russgreen
Posts: 4
Joined: Fri Feb 20, 2015 12:17 pm

.NET issue

Post 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!
jr
Site Admin
Posts: 500
Joined: Sun Mar 26, 2006 12:28 pm

Re: .NET issue

Post 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
russgreen
Posts: 4
Joined: Fri Feb 20, 2015 12:17 pm

Re: .NET issue

Post 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
Post Reply