Zum Hauptinhalt gehen

Suche

Suche

Export To Image Using Database?

Kommentare

5 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    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 Sub
    
    0
  • Avatar
    Legacy Poster

    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,

    Stewart

    0
  • Avatar
    Ian Cummings
    Moderator

    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
  • Avatar
    Saurabh Dusane

    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
  • Avatar
    Ian Cummings
    Moderator

    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

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.