Activex Print Preview Follow

0
Avatar
Legacy Poster

I am in the process of developing a custom MS Access application using ActiveX to print Bartender templates. The client wants the application to first "print preview". I cannot find any samples of how to accomplish that task. Any help would be greatly appreciated.

2 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

In BarTender Enterprise Automation Edition, you can use Format.ExportPrintPreviewToImage method to export preview images, instead of print.

[code]'Export preview images to "tmpPrevew" folder in current accdb(mdb) files folder. PNG format, 150dpi, black and white.'
Call BtFormat.ExportPrintPreviewToImage(CurrentProject.path & "\tmpPreview", "IMG%PageNumber%.PNG", "PNG", btColorsMono, 150, &HFFFFFF, btSaveChanges)
[/code]

When current format setup results multiple pages (such as print 10 records, serialized with 10 copies for each record etc), it exports multiple image files such as
"IMG1.PNG"
"IMG2.PNG"
...
"IMG9.PNG"
"IMG10.PNG"

So after export all images to a folder(the folder must be created beforehand), somehow you need to store all exported image's path to a table, then set the table as record source of a form/subform - which has a image control linked to the path.
(I don't have a good sample code for that - hope you're good at VBA. BarTender .net SDK documentation's Print preview sample might give you some idea.)

For Automation Edition,
Format.ExportToFile image provides similar functionality - however it only exports single image of current design view. (cannot show serialized print result, multiple record's print result etc.)

Hope that helps!
0
Avatar
Legacy Poster
Comment actions Permalink

[quote name='Shotaro I -Seagull Support' timestamp='1335156406' post='2287']
In BarTender Enterprise Automation Edition, you can use Format.ExportPrintPreviewToImage method to export preview images, instead of print.

[code]'Export preview images to "tmpPrevew" folder in current accdb(mdb) files folder. PNG format, 150dpi, black and white.'
Call BtFormat.ExportPrintPreviewToImage(CurrentProject.path & "\tmpPreview", "IMG%PageNumber%.PNG", "PNG", btColorsMono, 150, &HFFFFFF, btSaveChanges)
[/code]

When current format setup results multiple pages (such as print 10 records, serialized with 10 copies for each record etc), it exports multiple image files such as
"IMG1.PNG"
"IMG2.PNG"
...
"IMG9.PNG"
"IMG10.PNG"

So after export all images to a folder(the folder must be created beforehand), somehow you need to store all exported image's path to a table, then set the table as record source of a form/subform - which has a image control linked to the path.
(I don't have a good sample code for that - hope you're good at VBA. BarTender .net SDK documentation's Print preview sample might give you some idea.)

For Automation Edition,
Format.ExportToFile image provides similar functionality - however it only exports single image of current design view. (cannot show serialized print result, multiple record's print result etc.)

Hope that helps!
[/quote]

That helps a LOT. Thank you for the quick reply! This is why Bartender is the only labeling software I sell.

Not a problem regarding the serialization. I only need to display an image of the 1st label.

Please sign in to leave a comment.