Print Label To A Pdf Printer
Hi, I have the following coding which is able to print a label format to a physical printer but fail to a PDF printer.
Please kindly help to take a look what is the problem ?
PS. : I'm using the "Automation" edition.
Thank you ^^
------------------------------------------------------------------------------------------------------
Protected Sub print_label(ByVal pfilelist)
Dim btEngine As New Seagull.BarTender.Print.Engine
Dim btFormat As Seagull.BarTender.Print.LabelFormatDocument
' Initialize a new BarTender print engine.
btEngine = New Seagull.BarTender.Print.Engine()
' Start the BarTender print engine.
btEngine.Start()
btEngine.Window.VisibleWindows = Seagull.BarTender.Print.VisibleWindows.All
' Open format at same folder as executable
Dim plabel = "C:\inetpub\wwwroot\iwms_demo\Label\stock_in_label_pdf.btw"
Dim pprinter = "novaPDF 8"
btFormat = btEngine.Documents.Open(plabel, pprinter)
' Assign the text database to curtent format's primary database
Dim LabelTextFile As Seagull.BarTender.Print.Database.TextFile = New Seagull.BarTender.Print.Database.TextFile(btFormat.DatabaseConnections(0).Name)
Dim ptxtfile As String
For Each ptxtfile In pfilelist
LabelTextFile.FileName = ptxtfile
btFormat.DatabaseConnections.SetDatabaseConnection(LabelTextFile)
btFormat.PrintSetup.ReloadTextDatabaseFields = True
' Print
btFormat.Print()
'My.Computer.FileSystem.RenameFile(ptxtfile, replace(Path.GetFileName(ptxtfile), ".txt", ".printed"))
Next
' Stop the BarTender print engine.
btEngine.Stop(Seagull.BarTender.Print.SaveOptions.DoNotSaveChanges)
End Sub
-----------------------------------------------------------------------------------------------------------------------
0
-
Shotaro Ito
★ BarTender Hero ★
A little bird told me that by specifying user account to run windows service “novaPDF server”, to overcome printing problem on asp.net web server.
0
Please sign in to leave a comment.
Comments
1 comment