Export To Image Using Database?
Hi Everyone
I was just wondering if it was possible to export to an image using the template label I have created, which pulls in various fields via an excel spreadsheet. So for example I would open up my template label, select a couple of labels from the database list then export them both to something usable like .PDF. .JPG rather than printing out a hard copy. I already know how to do this when the label has been created without a database I was just wondering if it could be done without :)
Thanks in advance.
Stewart
-
You can print a print job to PDF through the use of a PDF printer driver. PDF Creator or CutePDF are both capable and usable in this respect.
If controlling BarTender via the automation interface then you could call the ExportPrintPreviewToFile or ExportPrintPreviewRangeToFile method. See the BarTender Help system for a full reference.
Public Sub Demo() ' Initialize a new BarTender print engine. using btEngine As New Engine() ' Start the BarTender print engine. btEngine.Start() ' Open a format document. Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("C:\Format1.btw") ' Export the print preview to an image file. Dim sPath As String = "C:\PrintPreview" Dim sFileName As String = "Preview%PageNumber%.jpg" Dim btMessages As Messages = Nothing btFormat.ExportPrintPreviewToFile(sPath, sFileName, ImageType.JPEG, ColorDepth.ColorDepth256, New Resolution(300), Color.Green, OverwriteOptions.DoNotOverwrite, True, True, btMessages) ' Close the current format without saving. btFormat.Close(SaveOptions.DoNotSaveChanges) ' Stop the BarTender print engine. btEngine.Stop() End Using End Sub0 -
Hi
Thanks very much this does work but I now have another slight issue.
The labels are being exported to a default blank A4 page problem is my labels are only 120mm x 60mm and I would like them cropped to fit if possible. I entered a custom size exactly to the size of the label and then another one with an extra 20mm all the way around but Bartender is giving me an error message saying "Printer area too small, would you like to automatically adjust to the nearest paper size" I have no option to ignore like in most software, if I click adjust to nearest paper size it is a 120mm x 60mm label on a blank A4 page.
Do you know if there is a way around this?
Kind Regards,
Stewart0 -
Are you using the PDF driver method?
If yes then I would suppose you need to create a custom stock size in the PDF driver itself and then select that in the BarTender "Page Setup" dialog.
0 -
Hello Ian,
I am trying to print PDF file by using ExportPrintPreviewToFile Bartender function which you mentioned above. The PDF files are generating but the quality of file is very low, not in readable format.
I also tried with ExportPrintPreviewRangeToFile Bartender function to generate the PDF file but the output is as same. Then i have tried to make image (JPG) file but it is also same not able to read. Kindly help on this how can we overcome this problem and improve the quality of PDF files.
Thanks in advance.
Best Regard,
Saurabh Dusane.
0 -
I suggest that you use the native PDF driver of BarTender that was introduced in the BarTender 2019 version. rather than calling it via Export to print preview, you would simply be performing a regular print job to the "PDF" printer, though you will need to set the file save name and location properties to something other than default.
Otherwise, I'd choose PNG as the data file format and specify a higher resolution, if the one you're using isn't giving good enough results.
0
Please sign in to leave a comment.
Comments
5 comments