I am using the "C39P24DmTt" to create documents with barcodes on them. When the application is run on Windows 7 (32-bit) the document created has the barcode glyth on it. When the application is run on Windows 7 (64-bit) the document created only displays the escape character and not the glyths. I am build the application in Visual Studio 2010 targeting the "Any CPU" platform. The Apose.PDF version is 4.7.0.0.
Here is the code:
public class PdfReportBuilder: IDisposable {private Pdf _pdfDoc; private bool _writeDirectToFile;<SPAN style="COLOR: blue">private</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">TextInfo</SPAN> _textInfoDefault8; <SPAN style="COLOR: blue">private</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">TextInfo</SPAN> _textInfoDefault6; <SPAN style="COLOR: blue">private</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">TextInfo</SPAN> _textInfoBarcode24; <SPAN style="COLOR: blue">private</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">Color</SPAN> _borderColor;
private bool CreateBarcodeSheet()private static FileStream CreateReportStream(string headerName, out string reportName)public PdfReportBuilder(Pdf pdfDoc, bool writeDirectToFile)
{
_pdfDoc = pdfDoc;
_writeDirectToFile = writeDirectToFile;InitializeAsposeObjects(); }
// This region defines a standardized implementation of the IDisposableinternal static string CreateReport()
// interface, providing safe disposal of managed and unmanaged objects.
// The _disposed private field tracks whether the object has already
// been disposed. By default the object is not disposed.
private bool _disposed = false;<SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray"><summary></SPAN> <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> Implement IDisposable</SPAN> <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> Do not make this method virtual</SPAN> <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> A derived class should not be able to override this method</SPAN> <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray"></summary></SPAN> <SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">void</SPAN> Dispose() { <SPAN style="COLOR: green">// Since the code is directly calling the overloaded Dispose method,</SPAN> <SPAN style="COLOR: green">// it passes true as the value for the Boolean disposing parameter.</SPAN> Dispose(<SPAN style="COLOR: blue">true</SPAN>); <SPAN style="COLOR: green">// Now that the object has been queued for disposal, take it off </SPAN> <SPAN style="COLOR: green">// the Garbage Collector's (GC's) finalization queue.</SPAN> System.<SPAN style="COLOR: #2b91af">GC</SPAN>.SuppressFinalize(<SPAN style="COLOR: blue">this</SPAN>); <SPAN style="COLOR: green">// Note that at this point we are never guaranteed that the object</SPAN> <SPAN style="COLOR: green">// has already been disposed. Whenever the GC gets around to it,</SPAN> <SPAN style="COLOR: green">// that will be the case. Until then, the private field _disposed</SPAN> <SPAN style="COLOR: green">// must be honored -- i.e. checked prior to accessing any fields or</SPAN> <SPAN style="COLOR: green">// calling any methods of this class in order to guarantee safe</SPAN> <SPAN style="COLOR: green">// code execution.</SPAN> } <SPAN style="COLOR: green">// Dispose(bool disposing) executes in two distinct scenarios.</SPAN> <SPAN style="COLOR: green">// If disposing equals true, the method has been called directly</SPAN> <SPAN style="COLOR: green">// or indirectly by a user's code. Managed and unmanaged resources</SPAN> <SPAN style="COLOR: green">// can be disposed. If disposing equals false, the method has been</SPAN> <SPAN style="COLOR: green">// called by the runtime from inside the finalizer and you should</SPAN> <SPAN style="COLOR: green">// not reference other objects. Only unmanaged resources can be</SPAN> <SPAN style="COLOR: green">// disposed in that case.</SPAN> <SPAN style="COLOR: blue">private</SPAN> <SPAN style="COLOR: blue">void</SPAN> Dispose(<SPAN style="COLOR: blue">bool</SPAN> disposing) { <SPAN style="COLOR: green">// Check to see if Dispose has already been called.</SPAN> <SPAN style="COLOR: blue">if</SPAN> (!_disposed) { <SPAN style="COLOR: green">// If disposing equals true then the call has been made by user code.</SPAN> <SPAN style="COLOR: green">// It is safe to reference other objects.</SPAN> <SPAN style="COLOR: green">// Proceed to dispose all managed and unmanaged resources.</SPAN> <SPAN style="COLOR: blue">if</SPAN> (disposing) { <SPAN style="COLOR: green">// Dispose all managed resources</SPAN> _textInfoDefault8 = <SPAN style="COLOR: blue">null</SPAN>; _textInfoDefault6 = <SPAN style="COLOR: blue">null</SPAN>; _textInfoBarcode24 = <SPAN style="COLOR: blue">null</SPAN>; _borderColor = <SPAN style="COLOR: blue">null</SPAN>; _pdfDoc = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: blue">if</SPAN> (_newDataTable != <SPAN style="COLOR: blue">null</SPAN>) { _newDataTable.Dispose(); _newDataTable = <SPAN style="COLOR: blue">null</SPAN>; } } <SPAN style="COLOR: green">// Now that all managed resources have been disposed, proceed to dispose</SPAN> <SPAN style="COLOR: green">// of all unmanaged resources.</SPAN> } <SPAN style="COLOR: green">// Flag the object as disposed (even though it will not be so until the GC</SPAN> <SPAN style="COLOR: green">// decides it is time to do so).</SPAN> _disposed = <SPAN style="COLOR: blue">true</SPAN>; }
{
bool writeDirectToFile = true;<SPAN style="COLOR: blue">bool</SPAN> isCreated = <SPAN style="COLOR: blue">false</SPAN>;</PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"> <SPAN style="COLOR: green">// Special handling for reports</SPAN> <SPAN style="COLOR: blue">string</SPAN> reportName = <SPAN style="COLOR: blue">string</SPAN>.Empty; <SPAN style="COLOR: #2b91af">FileStream</SPAN> stream = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: blue">try</SPAN> { stream = CreateReportStream(@"Barcode Sheet", <SPAN style="COLOR: blue">out</SPAN> reportName); <SPAN style="COLOR: blue">if</SPAN> (stream == <SPAN style="COLOR: blue">null</SPAN>) { <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">string</SPAN>.Empty; } <SPAN style="COLOR: #2b91af">Pdf</SPAN> pdfDoc; <SPAN style="COLOR: blue">if</SPAN> (writeDirectToFile) { pdfDoc = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Pdf</SPAN>(stream); } <SPAN style="COLOR: blue">else</SPAN> { pdfDoc = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Pdf</SPAN>(); } Aspose.Pdf.<SPAN style="COLOR: #2b91af">License</SPAN> pdfLicense = <SPAN style="COLOR: blue">new</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">License</SPAN>(); pdfLicense.SetLicense(System.Windows.Forms.<SPAN style="COLOR: #2b91af">Application</SPAN>.StartupPath + <SPAN style="COLOR: #a31515">@"\aspose.total.lic"</SPAN>); <SPAN style="COLOR: blue">using</SPAN> (<SPAN style="COLOR: #2b91af">PdfReportBuilder</SPAN> reportBuilder = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">PdfReportBuilder</SPAN>(pdfDoc, writeDirectToFile)) { <SPAN style="COLOR: blue">try</SPAN> { isCreated = reportBuilder.CreateBarcodeSheet(); } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">OutOfMemoryException</SPAN> ex) { MessageBox.Show(ex.Message, @"Report Generation Failure", <SPAN style="COLOR: #2b91af">MessageBoxButtons</SPAN>.OK, <SPAN style="COLOR: #2b91af">MessageBoxIcon</SPAN>.Error); isCreated = <SPAN style="COLOR: blue">true</SPAN>; } <SPAN style="COLOR: blue">if</SPAN> (writeDirectToFile) { pdfDoc.Close(); } <SPAN style="COLOR: blue">else</SPAN> { pdfDoc.Save(stream); } } } <SPAN style="COLOR: blue">finally</SPAN> { <SPAN style="COLOR: blue">if</SPAN> (stream != <SPAN style="COLOR: blue">null</SPAN>) { stream.Close(); } } <SPAN style="COLOR: blue">return</SPAN> isCreated ? reportName : <SPAN style="COLOR: blue">string</SPAN>.Empty; }
{
FileStream stream = null;<SPAN style="COLOR: blue">int</SPAN> counter = 0; <SPAN style="COLOR: blue">do</SPAN> { reportName = <SPAN style="COLOR: blue">string</SPAN>.Format(<SPAN style="COLOR: #2b91af">CultureInfo</SPAN>.CurrentUICulture, <SPAN style="COLOR: #2b91af">Misc</SPAN>.ReportDirectory + <SPAN style="COLOR: #a31515">@"\{0}_{1}.pdf"</SPAN>, FSA.Utility.<SPAN style="COLOR: #2b91af">Misc</SPAN>.UncEncode(headerName), counter); <SPAN style="COLOR: blue">try</SPAN> { <SPAN style="COLOR: green">// File.Exists here to cover issues with 3rd party PDF readers not putting exclusive lock on the file - ex. FoXiT</SPAN> <SPAN style="COLOR: blue">if</SPAN> (<SPAN style="COLOR: #2b91af">File</SPAN>.Exists(reportName)) { <SPAN style="COLOR: #2b91af">File</SPAN>.Delete(reportName); } stream = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">FileStream</SPAN>(reportName, <SPAN style="COLOR: #2b91af">FileMode</SPAN>.Create); } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">UnauthorizedAccessException</SPAN>) { counter++; } <SPAN style="COLOR: blue">catch</SPAN> (System.Security.<SPAN style="COLOR: #2b91af">SecurityException</SPAN>) { counter++; } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">ArgumentException</SPAN>) { counter++; } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">DirectoryNotFoundException</SPAN>) { <SPAN style="COLOR: blue">try</SPAN> { <SPAN style="COLOR: #2b91af">Directory</SPAN>.CreateDirectory(<SPAN style="COLOR: #2b91af">Misc</SPAN>.ReportDirectory); } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">UnauthorizedAccessException</SPAN>) { reportName = <SPAN style="COLOR: blue">string</SPAN>.Empty; <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">null</SPAN>; } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">NotSupportedException</SPAN>) { reportName = <SPAN style="COLOR: blue">string</SPAN>.Empty; <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">null</SPAN>; } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">IOException</SPAN>) { reportName = <SPAN style="COLOR: blue">string</SPAN>.Empty; <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">null</SPAN>; } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">ArgumentException</SPAN>) { reportName = <SPAN style="COLOR: blue">string</SPAN>.Empty; <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">null</SPAN>; } } <SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">IOException</SPAN>) { counter++; } } <SPAN style="COLOR: blue">while</SPAN> (stream == <SPAN style="COLOR: blue">null</SPAN>); <SPAN style="COLOR: blue">return</SPAN> stream; }
{
string[] countOne = { @“0”, @“1”, @“2”, @“3”, @“4”, @“5”, @“6”, @“7”, @“8”, @“9”, @“10” };
string[] countOneCode = { @“0”, @“1”, @“2”, @“3”, @“4”, @“5”, @“6”, @“7”, @“8”, @“9”, @“10” };
string[] countTwo = { @“Back”, @“11”, @“12”, @“13”, @“14”, @“15”, @“16”, @“17”, @“18”, @“19”, @“20” };
string[] countTwoCode = { @"$TV", @“11”, @“12”, @“13”, @“14”, @“15”, @“16”, @“17”, @“18”, @“19”, @“20” };
string[] specCodeName = { @“New Customer”, @“Skip”, string.Empty, string.Empty, string.Empty, string.Empty, @“Beep High”, @“Beep Medium”, @“Beep Low”, @“No CR”, @“CR” };
string[] specCode = { @"$TX", @“0”, string.Empty, string.Empty, string.Empty, string.Empty, @".F014$", @".F013$", @".F017$", @".D010$", @".D012$" };<SPAN style="COLOR: green">// Create new section</SPAN> <SPAN style="COLOR: #2b91af">Section</SPAN> section = _pdfDoc.Sections.Add(); section.PageInfo.Margin.Top = 30; section.PageInfo.Margin.Bottom = 0; section.PageInfo.Margin.Left = 20; section.PageInfo.Margin.Right = 20; section.PageInfo.PageHeight = <SPAN style="COLOR: #2b91af">PageSize</SPAN>.LetterHeight; section.PageInfo.PageWidth = <SPAN style="COLOR: #2b91af">PageSize</SPAN>.LetterWidth; section.IsLandscape = <SPAN style="COLOR: blue">true</SPAN>; <SPAN style="COLOR: green">//Title (for Report Titles)</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">TextInfo</SPAN> textInfoTitle = <SPAN style="COLOR: blue">new</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">TextInfo</SPAN>(); textInfoTitle.FontName = <SPAN style="COLOR: #a31515">@"Helvetica"</SPAN>; textInfoTitle.FontSize = 20; textInfoTitle.IsTrueTypeFontBold = <SPAN style="COLOR: blue">true</SPAN>; <SPAN style="COLOR: #2b91af">Table</SPAN> body = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Table</SPAN>(section); body.ColumnWidths = <SPAN style="COLOR: #a31515">@"100 125 100 125 150 150"</SPAN>; body.DefaultCellPadding.Bottom = body.DefaultCellPadding.Top = 2; body.DefaultCellPadding.Left = body.DefaultCellPadding.Right = 2; body.DefaultCellTextInfo = textInfoTitle; <SPAN style="COLOR: green">// Fill Table with bar code information</SPAN> <SPAN style="COLOR: #2b91af">Row</SPAN> rowItem; <SPAN style="COLOR: #2b91af">Cell</SPAN> cellItem; <SPAN style="COLOR: #2b91af">Cell</SPAN> cellBarCode; <SPAN style="COLOR: #2b91af">Text</SPAN> bcText = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: #2b91af">Text</SPAN> nameText = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: #2b91af">Segment</SPAN> segBC = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: blue">for</SPAN> (<SPAN style="COLOR: blue">int</SPAN> i = 0; i < 11; i++) { rowItem = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Row</SPAN>(body); <SPAN style="COLOR: green">// Column 1</SPAN> cellItem = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); nameText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(countOne[i], textInfoTitle); nameText.TextInfo.Alignment = <SPAN style="COLOR: #2b91af">AlignmentType</SPAN>.Center; cellItem.Paragraphs.Add(nameText); rowItem.Cells.Add(cellItem); <SPAN style="COLOR: green">// Barcode</SPAN> cellBarCode = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); cellBarCode.Padding.Top = 1.0F; cellBarCode.DefaultCellTextInfo = _textInfoBarcode24; bcText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(); bcText.Segments.Add(<SPAN style="COLOR: #a31515">@" "</SPAN>); segBC = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Segment</SPAN>(bcText); segBC.Content = <SPAN style="COLOR: blue">string</SPAN>.Format(<SPAN style="COLOR: #2b91af">CultureInfo</SPAN>.CurrentUICulture, <SPAN style="COLOR: #a31515">@"{0}"</SPAN>, countOneCode[i]); segBC.TextInfo = _textInfoBarcode24; bcText.Segments.Add(segBC); cellBarCode.Paragraphs.Add(bcText); rowItem.Cells.Add(cellBarCode); segBC = <SPAN style="COLOR: blue">null</SPAN>; bcText = <SPAN style="COLOR: blue">null</SPAN>; cellBarCode = <SPAN style="COLOR: blue">null</SPAN>; nameText = <SPAN style="COLOR: blue">null</SPAN>; cellItem = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: green">// Column 2</SPAN> cellItem = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); nameText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(countTwo[i], textInfoTitle); nameText.TextInfo.Alignment = <SPAN style="COLOR: #2b91af">AlignmentType</SPAN>.Center; cellItem.Paragraphs.Add(nameText); rowItem.Cells.Add(cellItem); <SPAN style="COLOR: green">// Barcode</SPAN> cellBarCode = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); cellBarCode.Padding.Top = 1.0F; cellBarCode.DefaultCellTextInfo = _textInfoBarcode24; bcText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(); bcText.Segments.Add(<SPAN style="COLOR: #a31515">@" "</SPAN>); segBC = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Segment</SPAN>(bcText); segBC.Content = <SPAN style="COLOR: blue">string</SPAN>.Format(<SPAN style="COLOR: #2b91af">CultureInfo</SPAN>.CurrentUICulture, <SPAN style="COLOR: #a31515">@"{0}"</SPAN>, countTwoCode[i]); segBC.TextInfo = _textInfoBarcode24; bcText.Segments.Add(segBC); cellBarCode.Paragraphs.Add(bcText); rowItem.Cells.Add(cellBarCode); segBC = <SPAN style="COLOR: blue">null</SPAN>; bcText = <SPAN style="COLOR: blue">null</SPAN>; cellBarCode = <SPAN style="COLOR: blue">null</SPAN>; nameText = <SPAN style="COLOR: blue">null</SPAN>; cellItem = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: green">// Column 3</SPAN> cellItem = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); nameText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(specCodeName[i], textInfoTitle); nameText.TextInfo.Alignment = <SPAN style="COLOR: #2b91af">AlignmentType</SPAN>.Center; cellItem.Paragraphs.Add(nameText); rowItem.Cells.Add(cellItem); <SPAN style="COLOR: green">// Barcode</SPAN> cellBarCode = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Cell</SPAN>(rowItem); cellBarCode.Padding.Top = 1.0F; cellBarCode.DefaultCellTextInfo = _textInfoBarcode24; bcText = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Text</SPAN>(); bcText.Segments.Add(<SPAN style="COLOR: #a31515">@" "</SPAN>); segBC = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Segment</SPAN>(bcText); segBC.Content = <SPAN style="COLOR: blue">string</SPAN>.Format(<SPAN style="COLOR: #2b91af">CultureInfo</SPAN>.CurrentUICulture, <SPAN style="COLOR: #a31515">@"{0}"</SPAN>, specCode[i]); segBC.TextInfo = _textInfoBarcode24; bcText.Segments.Add(segBC); cellBarCode.Paragraphs.Add(bcText); rowItem.Cells.Add(cellBarCode); segBC = <SPAN style="COLOR: blue">null</SPAN>; bcText = <SPAN style="COLOR: blue">null</SPAN>; cellBarCode = <SPAN style="COLOR: blue">null</SPAN>; nameText = <SPAN style="COLOR: blue">null</SPAN>; cellItem = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: green">// Add row</SPAN> body.Rows.Add(rowItem); rowItem = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: green">// Add an extra line between rows</SPAN> rowItem = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Row</SPAN>(body); rowItem.Cells.Add(<SPAN style="COLOR: blue">string</SPAN>.Empty); body.Rows.Add(rowItem); rowItem = <SPAN style="COLOR: blue">null</SPAN>; } <SPAN style="COLOR: green">// Add Table to section</SPAN> <SPAN style="COLOR: blue">if</SPAN> (_writeDirectToFile) { section.AddParagraph(body); } <SPAN style="COLOR: blue">else</SPAN> { section.Paragraphs.Add(body); } body = <SPAN style="COLOR: blue">null</SPAN>; <SPAN style="COLOR: green">// Return</SPAN> <SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">true</SPAN>; }
private void InitializeAsposeObjects() { //Default 8 _textInfoDefault8 = new Aspose.Pdf.TextInfo(); _textInfoDefault8.FontName = @"Helvetica"; _textInfoDefault8.FontSize = 8; //Default 6 _textInfoDefault6 = new Aspose.Pdf.TextInfo(); _textInfoDefault6.FontName = @"Helvetica"; _textInfoDefault6.FontSize = 6; //BarCode 24 _textInfoBarcode24 = new Aspose.Pdf.TextInfo(); _textInfoBarcode24.IsFontEmbedded = true; _textInfoBarcode24.FontName = @"C39P24DmTt"; _textInfoBarcode24.FontSize = 24; _textInfoBarcode24.Alignment = AlignmentType.FullJustify; _borderColor = new Aspose.Pdf.Color(@"Black"); } }