Obtain a label format with a specific revision Follow

Florian Trudelle

Hello, I'm currently trying to upgrade my software which use .NET SDK

and one of the change I want to do is have the choice of the revision of label.

And the LibrarianRevisionClass doesn't have any "GetFile()" with a revision number in parameter.

Have you idea to do that ? Or maybe I don't read at a good place ?

I use BarTender 2019 R3 free (just for upgrade time)

Thank you in advance.


Jasper Wen
Comment actions Permalink

I have included some sample code using our BarTender .net SDK and information on how you can do this.

using (Engine engine = new Engine())
LabelFormatDocument doc = engine.Documents.Open(@"lib://Test/MyDoc.btw?r3", "Zebra LP2844");

Notice the "?r3" at the end of the librarian file path. This is an example on how to open a specific revision.

Here are the general rules for specifying librarian path options delimited by the "?" character.

Example Meaning
lib://Test/MyDoc.btw Get latest published revision or latest revision if no workflows.
lib://Test/MyDoc.btw?l Get latest/head revision (it is an lower case "L" not a 1.)
lib://Test/MyDoc.btw?4 Get revision 4
lib://Test/MyDoc.btw?r4 Get revision 4
lib://Test/MyDoc.btw?9-16-07 4:25 PM Get a revision based on a date time

*Note that these rules apply to the .NET SDK, BTXML, and the Integration platform.

Florian Trudelle
Comment actions Permalink

Thank you for your help, it help a lot. Have a nice day !

Please sign in to leave a comment.