Automated File Naming For Pdf Printing 追蹤

0
Avatar
Legacy Poster

Our warehouse management system(WMS) requires a process with which to send a PDF copy of a document as an e-mail to our principal. We are using enterprise automation version of BarTender 10.1 and we are doing our printing with btxml scripts, sent from WMS to a server that is running commander.

 

I have managed to implement the e-mailing part using BarTender document level VBscripting but the part that's causing me trouble is the automated naming of the PDFs. The way I have currently implemented it, is that I have set the PDF printer (PDF-Xchange 2012) to always give the files a same name, and then I change the name with document level VBscripting. The problem with this solution is that we need to run multiple instances of BarTender to meet the performance level that we require from this system. If we run multiple instances of BarTender, there can be a situation that another instance of BarTender tries to print PDF to the static file name, before previous PDF is renamed with the VBscript.

 

Any suggestions for a solution? PDF-Xchange doesn't provide any suitable automatic filenaming conventions, because simply using timestamp can also be broken due to simultaneous printing.

 

summary of the environment:

 

Operating system: Windows server 2012

BarTender version: Enterprise automation 10.1

Method of automation: btxml scripting

Printer involved: PDF-XChange 2012

8 意見

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

Hi antilat1,

 

You could use two or three digit sequence incremental number in the end of file name and sequence number can be reset at maximum number.

 

I am looking for printing PDF through BTXML. is it possible for you to share the BTXML and VB Script? Thank you

0
Avatar
Shotaro Ito
評論操作 永久連結

if your pdf software takes Print Job Name as filename, you can specify print job name from XML / Commander / SDK.

Job Name can be specified in <Print> tag's JobName attribute.

Default print job name is btw document.

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

Thanks Shotaro,

 

What you suggest should work, but because of some issues with PDF printing I haven't been able to test it yet. According to my co-worker, when opening the btxml with commander, using PDF-XChange's document name macro should give the file the name thats defined here: <Print JobName="">. What I can confirm is that if you open the btxml with BarTenders File->Run btxml script this does not work! The file always gets the template's name.

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

I'm experiencing weird issue with this file naming thing. It seems that for most of my templates file naming with <Print JobName=""> is working but for one template it's still just getting the templates name. No idea how to proceed with this issue.

0
Avatar
Shotaro Ito
評論操作 永久連結

Hmm.. Don't have a good idea - however is that because of template, or xml specified? any possibility that specified job name is not valid?

What if you change failed btw file name to successful btw file name and try again?

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

Tried to change name of the template to same name that I used for a working template. Also used the same JobName that worked with that other template, and still it gave the pdf the template name, not the JobName. I also tried to remake the template so that all printing and document options would get the default values again. I think the issue must be in the template because the XML is exactly in the same format (just different named substrings and different data table).

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

Wow.. After hours of debugging (building new copy of the template piece by piece) I found out what the problem was.

 

It turns out that for some crazy reason, file naming changes if you add a field that contains print job level datasource "total pages".

 

This might be something you guys want to investigate. The lack of logic in this issue was drove me half insane.

0
Avatar
Shotaro Ito
評論操作 永久連結

Thank you antilat1. Sure - I don't see a point of doing that, and thanks a lot for the effort to pointing that.

Reported to developer and hopefully fixed in future version.

登入寫評論。