@@ -95,5 +95,85 @@ public virtual void Barcode02Test() {
9595 NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( destinationFolder + filename , sourceFolder
9696 + "cmp_" + filename , destinationFolder , "diff_" ) ) ;
9797 }
98+
99+ /// <exception cref="System.IO.IOException"/>
100+ /// <exception cref="iText.Kernel.PdfException"/>
101+ /// <exception cref="System.Exception"/>
102+ [ NUnit . Framework . Test ]
103+ public virtual void Barcode03Test ( ) {
104+ String filename = "barcodeDataMatrix3.pdf" ;
105+ PdfWriter writer = new PdfWriter ( destinationFolder + filename ) ;
106+ PdfDocument document = new PdfDocument ( writer ) ;
107+ PdfPage page1 = document . AddNewPage ( ) ;
108+ PdfCanvas canvas = new PdfCanvas ( page1 ) ;
109+ BarcodeDataMatrix barcode3 = new BarcodeDataMatrix ( ) ;
110+ barcode3 . SetWidth ( 36 ) ;
111+ barcode3 . SetHeight ( 12 ) ;
112+ barcode3 . SetCode ( "AbcdFFghijklmnopqrstuWXSQ" ) ;
113+ barcode3 . PlaceBarcode ( canvas , Color . BLACK , 10 ) ;
114+ document . Close ( ) ;
115+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( destinationFolder + filename , sourceFolder
116+ + "cmp_" + filename , destinationFolder , "diff_" ) ) ;
117+ }
118+
119+ /// <exception cref="System.IO.IOException"/>
120+ /// <exception cref="iText.Kernel.PdfException"/>
121+ /// <exception cref="System.Exception"/>
122+ [ NUnit . Framework . Test ]
123+ public virtual void Barcode04Test ( ) {
124+ String filename = "barcodeDataMatrix4.pdf" ;
125+ PdfWriter writer = new PdfWriter ( destinationFolder + filename ) ;
126+ PdfDocument document = new PdfDocument ( writer ) ;
127+ PdfPage page1 = document . AddNewPage ( ) ;
128+ PdfCanvas canvas = new PdfCanvas ( page1 ) ;
129+ BarcodeDataMatrix barcode3 = new BarcodeDataMatrix ( ) ;
130+ barcode3 . SetWidth ( 36 ) ;
131+ barcode3 . SetHeight ( 12 ) ;
132+ barcode3 . SetCode ( "01AbcdefgAbcdefg123451231231234" ) ;
133+ barcode3 . PlaceBarcode ( canvas , Color . BLACK , 10 ) ;
134+ document . Close ( ) ;
135+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( destinationFolder + filename , sourceFolder
136+ + "cmp_" + filename , destinationFolder , "diff_" ) ) ;
137+ }
138+
139+ /// <exception cref="System.IO.IOException"/>
140+ /// <exception cref="iText.Kernel.PdfException"/>
141+ /// <exception cref="System.Exception"/>
142+ [ NUnit . Framework . Test ]
143+ public virtual void Barcode05Test ( ) {
144+ String filename = "barcodeDataMatrix5.pdf" ;
145+ PdfWriter writer = new PdfWriter ( destinationFolder + filename ) ;
146+ PdfDocument document = new PdfDocument ( writer ) ;
147+ PdfPage page1 = document . AddNewPage ( ) ;
148+ PdfCanvas canvas = new PdfCanvas ( page1 ) ;
149+ BarcodeDataMatrix barcode3 = new BarcodeDataMatrix ( ) ;
150+ barcode3 . SetWidth ( 40 ) ;
151+ barcode3 . SetHeight ( 40 ) ;
152+ barcode3 . SetCode ( "aaabbbcccdddAAABBBAAABBaaabbbcccdddaaa" ) ;
153+ barcode3 . PlaceBarcode ( canvas , Color . BLACK , 10 ) ;
154+ document . Close ( ) ;
155+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( destinationFolder + filename , sourceFolder
156+ + "cmp_" + filename , destinationFolder , "diff_" ) ) ;
157+ }
158+
159+ /// <exception cref="System.IO.IOException"/>
160+ /// <exception cref="iText.Kernel.PdfException"/>
161+ /// <exception cref="System.Exception"/>
162+ [ NUnit . Framework . Test ]
163+ public virtual void Barcode06Test ( ) {
164+ String filename = "barcodeDataMatrix6.pdf" ;
165+ PdfWriter writer = new PdfWriter ( destinationFolder + filename ) ;
166+ PdfDocument document = new PdfDocument ( writer ) ;
167+ PdfPage page1 = document . AddNewPage ( ) ;
168+ PdfCanvas canvas = new PdfCanvas ( page1 ) ;
169+ BarcodeDataMatrix barcode3 = new BarcodeDataMatrix ( ) ;
170+ barcode3 . SetWidth ( 36 ) ;
171+ barcode3 . SetHeight ( 12 ) ;
172+ barcode3 . SetCode ( ">>>\r >>>THIS VERY TEXT>>\r >" ) ;
173+ barcode3 . PlaceBarcode ( canvas , Color . BLACK , 10 ) ;
174+ document . Close ( ) ;
175+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( destinationFolder + filename , sourceFolder
176+ + "cmp_" + filename , destinationFolder , "diff_" ) ) ;
177+ }
98178 }
99179}
0 commit comments