Btformat.exportimagetofile As Pdf? 追蹤

0
Avatar
Legacy Poster

Bartender Version 10.1

 

The User interface in Bartender allows a user to Export a label as PDF. The API does not. There is an enum required when exporting to an image file where you select one of the following:

 

namespace Seagull.BarTender.Print
{
    public enum ImageType
    {
        JPEG = 0,
        TIFF = 1,
        GIF = 2,
        PNG = 3,
        PSD = 4,
        CLP = 5,
        CUT = 6,
        ECW = 7,
        EMF = 8,
        EPS = 9,
        EXF = 10,
        FLC = 11,
        FPX = 12,
        IMG = 13,
        IFF = 14,
        CMP = 15,
        CIN = 16,
        AWD = 17,
        MSP = 18,
        PCX = 19,
        PSP = 20,
        PBM = 21,
        PGM = 22,
        PPM = 23,
        SCT = 24,
        SGI = 25,
        SFF = 26,
        RAS = 27,
        TGA = 28,
        BMP = 29,
        WFX = 30,
        WMF = 31,
        WPG = 32,
        XWD = 33,
        XBM = 34,
    }
}
 
Is it possible to print to a PDF without having to use a PDF Print Driver?
 
btFormat.ExportImageToFile("c:\temp\test.pdf", ImageType.TIFF, ColorDepth.ColorDepth24bit, new Resolution(300), OverwriteOptions.Overwrite); should be
btFormat.ExportImageToFile("c:\temp\test.pdf", ImageType.PDF, ColorDepth.ColorDepth24bit, new Resolution(300), OverwriteOptions.Overwrite);

6 意見

0
Avatar
Ian Cummings
版主
評論操作 永久連結

Unfortunately this is not supported at this time.  Not sure why that is.  It is already in our feature request system with a few hits so the chances are this will be implemented at some point.  Sorry for now.

0
Avatar
Legacy Poster
評論操作 永久連結

Has the "export image to file as PDF" been moved to "supported feature, yet?

 

I'm trying to find a way to use BTXML to print a group of X# of (named-substring-defined label images) to a single PDF file.... without having to mess with a print-to-pdf printer driver.

 

I just called technical support, and they said that it is supported...but I cannot find any example documentation to assist with doing so.  And I find threads on here indicating that you can't do it that way...

 

Seeking assistance,

 

Thank you!

 

0
Avatar
Ian Cummings
版主
評論操作 永久連結

For BTXML this is possible with a workaround.
 
Here is the workaround.  The prohibition on using it in BTXML script is artificial.  Open "C:\Program Files (x86)\Seagull\BarTender Suite\btxmlscript_base_2.0.xsd" and find the section that says "<!-- ImageFormatExportType enumeration type -->".  Add a line that says "<xs:pattern value="[Pp][Dd][Ff]" />".  It will be obvious when you see the file.  I'd expect that to work with any version of v10.0 or later. Try it!
 
I've asked development to make this a standard change for our next release.
 
I don't think there is an such easy workaround for the .NET component.  I'm in touch with development about this to see if the limitation here too is artificial (due to legacy reasons) and that we might enable it for the next release.
0
Avatar
Ian Cummings
版主
評論操作 永久連結

Note that in your application you can make a call on the btEngine.XMLScript(String, XMLSourceType, Messages) method to do this once the workaround has been enabled.  Just assemble the necessary BTXML into a string variable and you're good to go.  Not the cleanest of solutions, but it should give you the end result you want.

0
Avatar
Legacy Poster
評論操作 永久連結

I've made the changes as requested... but I'm getting syntax errors of a elemental nature as I make my attempts. Can you please give me assistance with the syntax on this one?

 

My first approach, using PDFCreator, works with the attached BTXML in the text file. I'm having problem converting it to an ExportPrintPreviewToImage command set...

 

is there no support for NamedSubstrings within this element?

 

Thank you,

 

Peter Zalinski,

Data Specialists, Inc.

0
Avatar
Ian Cummings
版主
評論操作 永久連結

It might not matter, but specify the file extension in the <format> to set the document to use.

 

I note however that the <command> tag isn't encapsulating each of the <print> tags as you have one for all of the prints.  It should in fact go like this example:

<?xml version="1.0" encoding="utf-8"?> 
<XMLScript Version="2.0">
<Command Name="Job1">
<Print> 
<Format CloseAtEndOfJob="true">Document1.btw</Format>
<PrintSetup> 
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup> 
</Print> 
</Command> 
<Command Name="Job2">
<Print> 
<Format CloseAtEndOfJob="true">Document2.btw</Format>
<PrintSetup> 
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup> 
</Print> 
</Command> 
<Command Name="Job3">
<Print> 
<Format CloseAtEndOfJob="true">Document3.btw</Format>
<PrintSetup> 
<IdenticalCopiesOfLabel>5</IdenticalCopiesOfLabel>
</PrintSetup> 
</Print> 
</Command> 
</XMLScript> 

登入寫評論。