Bar Code printing on XPS

Bar Code for WPF Forum

Posted 12 years ago by Sandeep K P
Avatar
i have added following code for creating an XPS file with bar code. After this when i try to open the XPS created. its giving above exception. "The tag 'BarCode' does not exist in XML namespace 'http://schemas.actiprosoftware.com/winfx/xaml/barcode'".Could you please help me to solve this ?.. i have added both shared library and Barcode dlls as refference

IXpsFixedPageWriter fixedPageWriter =
fixedDocumentWriter.AddFixedPage();


fixedPageWriter.XmlWriter.WriteStartElement("FixedPage");
fixedPageWriter.XmlWriter.WriteAttributeString("Width", "310");
fixedPageWriter.XmlWriter.WriteAttributeString("Height", "1056");
fixedPageWriter.XmlWriter.WriteAttributeString("xmlns",
"http://schemas.microsoft.com/xps/2005/06");
fixedPageWriter.XmlWriter.WriteAttributeString("xmlns:shared",
"http://schemas.actiprosoftware.com/winfx/xaml/shared");

fixedPageWriter.XmlWriter.WriteAttributeString("xmlns:barCode","http://schemas.actiprosoftware.com/winfx/xaml/barcode");

fixedPageWriter.XmlWriter.WriteAttributeString("xml:lang", "en-US");

fixedPageWriter.XmlWriter.WriteStartElement("barCode:BarCode");
// xmlWriter.WriteAttributeString("FontUri", xpsFonts[2].Uri.ToString());
fixedPageWriter.XmlWriter.WriteAttributeString("FixedPage.Left", "30");
fixedPageWriter.XmlWriter.WriteAttributeString("FixedPage.Top", "320");
fixedPageWriter.XmlWriter.WriteAttributeString("BorderThickness", "1");
fixedPageWriter.XmlWriter.WriteStartElement("barCode:Code39Symbology");
fixedPageWriter.XmlWriter.WriteAttributeString("Value", "GAC0003");
fixedPageWriter.XmlWriter.WriteAttributeString("TextElement.FontWeight", "Normal");
fixedPageWriter.XmlWriter.WriteEndElement();
fixedPageWriter.XmlWriter.WriteEndElement();
fixedPageWriter.XmlWriter.WriteEndElement();
fixedPageWriter.Commit();


Could you please help me out ?

[Modified at 03/19/2008 07:32 PM]

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Sandeep,

Can you put together a tiny sample project that shows this happening and email it over so we can have a look? Thanks!


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.