How to open a specific Librarian document revision using automation? Follow

Avatar
Jasper Wen

Question

Is there a way through automation to open a Librarian document revision number such as using BarTender XML or BarTender .net SDK?

 

Answer

Here is a some simple Print API code:

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

 

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.

 

Do you have feedback or questions on this article? We encourage you to post them on our Community Forums