C#. PLANET Generator Size Setting Tutorial

sample source code to generate linear PLANET images and adjust barcode size in C# .NET


  • Easy to install, integrate PLANET generating component in C#.NET development environments
  • Provide full-featured PLANET barcode properties to adjust PLANET size
  • Automatically add checksum digit for PLANET barcodes
  • Compatible with Microsoft Visual Studio 2005/2008/2010
  • Easy to manipulate PLANET short bar and tall bar ratio
  • Support Visual C#.NET2.0/3.0/4.0
  • Support high quality PLANET barcodes in GIF, BMP, PNG, JPEG/JPG & TIFF
  • Mature PLANET barcode generating components used by 1000+ clients
  • Tutorial for PLANET Image Setting in Visual C#.NET
  • Tutorial for PLANET Data Encoding in Visual C#.NET

Planet, also known as USPS PLANET Barcode, USPS Confirm Service Barcode, is a linear barcode symbology adopted by United States Postal Service for tracking purpose when mail is processed on automated mail processing equipment.

 

PLANET Structure



PLANET Image Width Related Settings

W: the barcode width of PLANET. Please see BarCodeWidth.

X: the width of a module bar; Xmin=1 pixel. Please see X.

Q: the width of the quiet zone; Qmin=10X. Please see Left & Right Margin.

PLANET Image Height Related Settings

H: the barcode height of PLANET. Please see BarCodeHeigth.

Y: the height of a tall module bar. Please see Y.

sY: the height of a short module bar. Please see Short to Tall Ratio.

Top & Bottom Margin: the height of the top & bottom margin. Please see Top & Bottom Margin.

Text Margin: the space between image bar and text. Please see TextMargin.

Text Font: the font style of human-readable text. Please see TextFont.



 

Setting PLANET Barcode Size in C#

C# PLANET barcode provides a set of barcode size settings to specify you PLANET barcodes. Please download C# barcode component and install, copy those following code to your Visual Studio:

Linear barcode = new Linear();

barcode.Type = BarcodeType.PLANET;

barcode.Data = "12345678901";

Modify your PLANET barcodes by setting those following properties:



UOM

UOM is short for Unit of Measure, which is the unit of measure for all size related settings in the library. C# PLANET barcode provides 3 options: Pixel, Cm, and Inch. The default is Pixel.

barcode.UOM = UnitOfMeasure.PIXEL;

Short to Tall Ratio

ShortTallRatio is the proportion of short bar and tall bar (Y). The default in C# PLANET barcode is 0.4f (float)..

barcode.ShortTallRatio = 0.7f;

Barcode Width & Height

BarcodeWidth is the PLANET barcode image width. The default in C# PLANET barcode is 0 (float).

BarcodeHeight is the PLANET barcode image height. The default in C# PLANET barcode is 0 (float).

barcode.BarcodeWidth = 0;

barcode.BarcodeHeigth =0;

Notice: if your setting is smaller than the barcode required minimum width and height, the library will automatically reset to barcode minimum width. Or you may enable AutoResize to automatically resize your PLANET barcode image.

Barcode Margin

BarcodeMargin is the white zone around the PLANET symbol. C# 128 barcode provides 4 options: Left Margin, Right Margin, Top Margin and Bottom Margin. The default of these four margins are 0 (float).

barcode.TopMargin = 3;

barcode.BottomMargin = 3;

barcode.LeftMargin = 1;

barcode.RightMargin = 1;

X & Y

X is the width of barcode bar module (narrow bar). The default in C# PLANET barcode is 1 (float).

Y is the height of barcode bar module. The default in C# PLANET barcode is 60 (float).

barcode.X = 2;

barcode.Y = 80;

Text Margin & Font

TextMargin is the space between barcode and barcode data text. The default in C# PLANET barcode is 6 (float).

TextFont is the font style of human-readable text. The default in C# PLANET barcode is new Font ("Arial", 9f, FontStyle.Regular).

barcode.TextMargin = 9;

barcode.TextFont = new Font("Arial", 20f, FontStyle.Regular);







OnBarcode is a market-leading provider of barcode generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides high quality tutorials and guides for various linear, 2d barcode information, such as C# Barcode, QR Code C#, QR Code VB.NET, QR Code ASP.NET, QR Code .NET, ASP.NET Barcode. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.