Skip to content

Commit f85ee71

Browse files
committed
986455: Updated the changes in 98 files.
1 parent 98a4704 commit f85ee71

File tree

98 files changed

+1571
-2293
lines changed
  • Barcode
    • Add-a-barcode-to-the-PDF-document-without-displaying-text/.NET
    • Adding-quiet-zones-to-a-barcode/.NET/Adding-quiet-zones-to-a-barcode
    • Export-one-dimensional-barcode-as-image/.NET/Export-one-dimensional-barcode-as-image
    • Export-two-dimensional-barcode-as-image/.NET/Export-two-dimensional-barcode-as-image
    • One dimensional barcode
      • Add-Code39-barcode-to-the-PDF-document/.NET/Add-Code39-barcode-to-the-PDF-document
      • Add-PdfEan13-barcode-to-a-PDF-document/.NET/Add-PdfEan13-barcode-to-a-PDF-document
      • Add-PdfEan8-barcode-to-a-PDF-document/.NET/Add-PdfEan8-barcode-to-a-PDF-document
    • Set-location-and-size-to-the-barcode-in-a-PDF-document/.NET/Set-location-and-size-to-the-barcode-in-a-PDF-document
    • Two dimensional barcode
      • Add-a-Pdf417-barcode-to-the-PDF-document/.NET/Add-a-Pdf417-barcode-to-the-PDF-document
      • Add-a-QRBarcode-to-the-PDF-document/.NET/Add-a-QRBarcode-to-the-PDF-document
  • Bookmarks
    • Adding-a-child-to-the-bookmarks-in-a-PDF/.NET/Adding-a-child-to-the-bookmarks-in-a-PDF
    • Adding-bookmarks-in-a-PDF-document/.NET/Adding-bookmarks-in-a-PDF-document
    • Adding-bookmarks-in-an-existing-PDF-document/.NET/Adding-bookmarks-in-an-existing-PDF-document
    • Get-bookmark-page-index-from-the-existing-PDF-document/.NET/Get-bookmark-page-index-from-the-existing-PDF-document
    • Inserting-bookmarks-in-an-existing-PDF/.NET/Inserting-bookmarks-in-an-existing-PDF
    • Modify-the-bookmarks-in-an-existing-PDF-document/.NET/Modify-the-bookmarks-in-an-existing-PDF-document
    • Remove-bookmarks-from-an-existing-PDF-document/.NET/Remove-bookmarks-from-an-existing-PDF-document
  • Brushes
    • Draw-shape-on-PDF-with-tiling-brush/.NET/Draw-shape-on-PDF-with-tiling-brush
    • Draw-shapes-on-PDF-with-radial-gradient-brush/.NET/Draw-shapes-on-PDF-with-radial-gradient-brush
    • Fill-an-object-with-gradient-brush-in-a-PDF/.NET/Fill-an-object-with-gradient-brush-in-a-PDF
    • Fill-an-object-with-solid-brush-in-a-PDF/.NET/Fill-an-object-with-solid-brush-in-a-PDF
    • Hatch-brush/.NET/Hatch-brush
    • Linear-Gradient-Brush-with-Multiple-Colors/.NET/Linear-Gradient-Brush-with-Multiple-Colors
    • Radial-gradient-rectangle-in-PDF/.NET/Radial-gradient-rectangle-in-PDF
  • ColorSpace
    • Add-color-space-in-particular-object-in-an-existing-PDF/.NET/Add-color-space-in-particular-object-in-an-existing-PDF
    • Add-graphics-elemets-by-Pantone-color-in-existing-PDF/.NET/Add-graphics-elemets-by-Pantone-color-in-existing-PDF
    • Create-PDF-document-with-ICC-color-space/.NET/Create-PDF-document-with-ICC-color-space
    • Draw-graphics-elements-by-using-Pantone-colors-in-a-PDF/.NET/Draw-graphics-elements-by-using-Pantone-colors-in-a-PDF
    • Draw-rectangle-on-new-PDF-with-CalGray-brush/.NET/Draw-rectangle-on-new-PDF-with-CalGray-brush
    • Draw-rectangle-with-CalGray-brush-in-an-existing-PDF/.NET/Draw-rectangle-with-CalGray-brush-in-an-existing-PDF
    • Set-ICC-color-space-in-an-existing-PDF-document/.NET/Set-ICC-color-space-in-an-existing-PDF-document
    • Use-color-space-in-particular-object-in-a-new-PDF/.NET/Use-color-space-in-particular-object-in-a-new-PDF
  • Compression
    • Compress-and-replace-image-in-a-PDF-document/.NET-Framework/Compress-and-replace-image-in-a-PDF-document
    • Compress-quality-of-image-in-PDF-document/.NET-Framework/Compress-quality-of-image-in-PDF-document
    • Compress-the-content-of-the-PDF-document/.NET/Compress-the-content-of-the-PDF-document
    • Compress-the-existing-PDF-document/.NET/Compress-the-existing-PDF-document
    • Compress-the-images-in-an-existing-PDF-document/.NET/Compress-the-images-in-an-existing-PDF-document
    • Optimize-embedded-font-in-an-existing-PDF-document/.NET/Optimize-embedded-font-in-an-existing-PDF-document
    • Optimize-page-contents-in-an-existing-PDF-document/.NET/Optimize-page-contents-in-an-existing-PDF-document
    • Reduce-PDF-file-size-by-removing-PDF-metadata/.NET/Reduce-PDF-file-size-by-removing-PDF-metadata
  • Document conversion
    • Converting-XPS-to-PDF-document/.NET/Converting-XPS-to-PDF-document
    • Excel-to-PDF
      • Convert-workbook-to-PDF-document/.NET/Convert-workbook-to-PDF-document
      • Converting-Excel-with-chart-to-PDF-document/.NET/Converting-Excel-with-chart-to-PDF-document
      • Converting-a-worksheet-to-PDF-document/.NET/Converting-a-worksheet-to-PDF-document
      • Creating-individual-PDF-document-for-each-worksheet/.NET
    • RTF-to-PDF/Convert-RTF-to-PDF-document/.NET/Convert-RTF-to-PDF-document
    • TIFF-to-PDF/Converting-multipage-TIFF-to-PDF-document/.NET/Converting-multipage-TIFF-to-PDF-document
    • Word-to-PDF/Converting-Word-to-PDF-document/.NET/Converting-Word-to-PDF-document
  • Redaction
    • Display-text-on-the-redacted-area/.NET/Display-text-on-the-redacted-area
    • Draw-image-on-the-redacted-area-in-PDF-document/.NET/Draw-image-on-the-redacted-area-in-PDF-document
    • Draw-pattern-on-the-redacted-area-in-PDF-document/.NET/Draw-pattern-on-the-redacted-area-in-PDF-document
    • Fill-color-on-the-redacted-area-in-a-PDF/.NET/Fill-color-on-the-redacted-area-in-a-PDF
    • Find-text-by-regular-expression-pattern-and-redact-it-from-PDF-document/.NET/Find_text_by_regular_expression
    • Get-the-redaction-progress-from-PDF-document/.NET/Get-the-redaction-progress-from-PDF-document
    • Get-the-result-of-redaction-with-other-information/.NET/Get-the-result-of-redaction-with-other-information
    • Redact-text-content-alone-on-the-redated-area/.NET
    • Redaction-fill-color-customization/.NET/Redaction-fill-color-customization
    • Redaction-without-fill-color-and-appearance/.NET/Redaction-without-fill-color-and-appearance
    • Removing-sensitive-content-from-the-PDF-document/.NET/Removing-sensitive-content-from-the-PDF-document
  • Save-PDF-file
  • Split PDFs
    • Import-multiple-pages-from-an-existing-PDF/.NET/Import-multiple-pages-from-an-existing-PDF
    • Import-pages-from-multiple-documents-and-arrange-pages/.NET/Import-pages-from-multiple-documents-and-arrange-pages
    • Import-tagged-structure-when-splitting-PDF-documents/.NET/Import-tagged-structure-when-splitting-PDF-documents
    • Importing-pages-from-one-document-another-document/.NET/Importing-pages-from-one-document-another-document
    • Password-Protect-Split-PDF/.NET/Password-Protect-Split-PDF
    • Rearrange-Page-and-Split/.NET/Rearrange-Page-and-Split
    • Remove-Unused-Resources-when-Splitting-PDF-Documents/.NET/Remove-Unused-Resources-when-Splitting-PDF-Documents
    • Rotate-PDF-and-Split/.NET/Rotate-PDF-and-Split
    • Split-PDF-based-Bookmarks/.NET/Split-PDF-based-Bookmarks
    • Split-a-Range-of-Pages/.NET/Split-a-Range-of-Pages
    • Split-by-FixedNumber/.NET/Split-by-FixedNumber
  • Table/PdfLightTable
    • Add-string-formatting-for-whole-table-in-a-PDF/.NET/Add-string-formatting-for-whole-table-in-a-PDF
    • Add-string-formatting-to-a-column-in-table/.NET/Add-string-formatting-to-a-column-in-table
    • Add-the-data-directly-into-the-PDF-table/.NET/Add-the-data-directly-into-the-PDF-table
    • Column-customization-of-the-table-in-PDF-document/.NET/Column-customization-of-the-table-in-PDF-document
    • Create-simple-table-from-data-source/.NET/Create-simple-table-from-data-source
    • Create-table-with-built-in-style/.NET/Create-table-with-built-in-style
    • Creating-the-table-in-an-existing-PDF-document/.NET/Creating-the-table-in-an-existing-PDF-document
    • Customize-the-table-cell-in-PDF-document/.NET/Customize-the-table-cell-in-PDF-document
    • Customize-the-table-in-a-PDF-document/.NET/Customize-the-table-in-a-PDF-document
    • Draw-graphics-element-in-particular-cell/.NET/Draw-graphics-element-in-particular-cell
    • Paginate-table-in-a-PDF-document/.NET/Paginate-table-in-a-PDF-document
    • Row-customization-of-the-table-in-PDF-document/.NET/Row-customization-of-the-table-in-PDF-document
  • Text Extraction
    • Extract-collection-of-words-from-PDF-document/.NET/Extract-collection-of-words-from-PDF-document
    • Extract-each-lines-from-an-existing-PDF-document/.NET/Extract-each-lines-from-an-existing-PDF-document
    • Extract-text-from-the-entire-PDF-document/.NET/Extract-text-from-the-entire-PDF-document
    • Extract-the-text-with-layout-in-a-PDF-document/.NET/Extract-the-text-with-layout-in-a-PDF-document
    • Extract-the-texts-from-a-page-in-the-PDF-document/.NET/Extract-the-texts-from-a-page-in-the-PDF-document
    • Get-text-glyph-details-from-extract-text/.NET/Get-text-glyph-details-from-extract-text
  • Watermark
    • Add-text-watermark-in-an-existing-PDF-document/.NET/Add-text-watermark-in-an-existing-PDF-document
    • Adding-image-watermark-in-PDF-document/.NET/Adding-image-watermark-in-PDF-document
    • Adding-text-watermark-in-PDF-document/.NET/Adding-text-watermark-in-PDF-document
    • Draw-the-image-watermark-in-an-existing-PDF-document/.NET/Draw-the-image-watermark-in-an-existing-PDF-document
    • Removing-watermark-annotation-in-PDF-document/.NET/Remove-watermark-annotation-in-the-PDF-document
  • ZUGFeRD
    • Create-ZUGFeRD-compliment-PDF-invoice/.NET/Create-ZUGFeRD-compliment-PDF-invoice
    • Extract-ZUGFeRD-invoice-from-PDF-document/.NET/Extract-ZUGFeRD-invoice-from-PDF-document
    • Factur-X/.NET/Factur-X

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1571
-2293
lines changed
Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

7-
//Creating new PDF Document.
8-
PdfDocument document = new PdfDocument();
9-
10-
//Adding a new page to the PDF document.
11-
PdfPage page = document.Pages.Add();
5+
//Create a new PDF document.
6+
using (PdfDocument document = new PdfDocument())
7+
{
8+
//Adding a new page to the PDF document.
9+
PdfPage page = document.Pages.Add();
1210

13-
//Create a new instance for the Codabar barcode.
14-
PdfCode39Barcode barcode = new PdfCode39Barcode();
11+
//Create a new instance for the Codabar barcode.
12+
PdfCode39Barcode barcode = new PdfCode39Barcode();
1513

16-
//Set the barcode location.
17-
barcode.Location = new PointF(10, 10);
14+
//Set the barcode location.
15+
barcode.Location = new PointF(10, 10);
1816

19-
//Set the barcode text.
20-
barcode.Text = "123456789";
17+
//Set the barcode text.
18+
barcode.Text = "123456789";
2119

22-
//Disable the barcode text.
23-
barcode.TextDisplayLocation = TextLocation.None;
20+
//Disable the barcode text.
21+
barcode.TextDisplayLocation = TextLocation.None;
2422

25-
//Printing barcode on to the PDF document.
26-
barcode.Draw(page);
23+
//Printing barcode on to the PDF document.
24+
barcode.Draw(page);
2725

28-
//Create file stream.
29-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
30-
{
31-
//Save the PDF document to file stream.
32-
document.Save(outputFileStream);
26+
//Save the PDF document
27+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
3328
}
3429

35-
//Close the document.
36-
document.Close(true);
37-
3830

Barcode/Adding-quiet-zones-to-a-barcode/.NET/Adding-quiet-zones-to-a-barcode/Program.cs

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,31 @@
44
using Syncfusion.Pdf.Graphics;
55

66
//Create a new PDF document.
7-
PdfDocument document = new PdfDocument();
8-
9-
//Create a new page.
10-
PdfPage page = document.Pages.Add();
11-
12-
// Create barcode with quiet zones
13-
PdfCode128Barcode barcode = new PdfCode128Barcode
7+
using (PdfDocument document = new PdfDocument())
148
{
15-
Text = "SYNCFUSION",
16-
BarHeight = 40,
17-
QuietZone = new PdfBarcodeQuietZones
18-
{
19-
Left = 15, // 15 points = ~5.3mm
20-
Right = 15,
21-
Top = 8, // 8 points = ~2.8mm
22-
Bottom = 8
23-
}
24-
};
9+
//Create a new page.
10+
PdfPage page = document.Pages.Add();
2511

26-
//Draw a barcode on the new page.
27-
barcode.Draw(page, new PointF(10, 10));
12+
// Create barcode with quiet zones
13+
PdfCode128Barcode barcode = new PdfCode128Barcode
14+
{
15+
Text = "SYNCFUSION",
16+
BarHeight = 40,
17+
QuietZone = new PdfBarcodeQuietZones
18+
{
19+
Left = 15, // 15 points = ~5.3mm
20+
Right = 15,
21+
Top = 8, // 8 points = ~2.8mm
22+
Bottom = 8
23+
}
24+
};
2825

29-
//Draw a rectangle based on the barcode size.
30-
page.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(10, 10, barcode.Size.Width, barcode.Size.Height));
26+
//Draw a barcode on the new page.
27+
barcode.Draw(page, new PointF(10, 10));
3128

32-
//Create file stream.
33-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
34-
{
35-
//Save the PDF document to file stream.
36-
document.Save(outputFileStream);
37-
}
29+
//Draw a rectangle based on the barcode size.
30+
page.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(10, 10, barcode.Size.Width, barcode.Size.Height));
3831

39-
//Close the document.
40-
document.Close(true);
32+
//Save the PDF document
33+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
34+
}

Barcode/Export-one-dimensional-barcode-as-image/.NET/Export-one-dimensional-barcode-as-image/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Pdf.Barcode;
1+
using Syncfusion.Pdf.Barcode;
42
using Syncfusion.Pdf.Graphics;
53
using Syncfusion.Drawing;
64

Barcode/Export-two-dimensional-barcode-as-image/.NET/Export-two-dimensional-barcode-as-image/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Pdf.Barcode;
1+
using Syncfusion.Pdf.Barcode;
42
using Syncfusion.Pdf.Graphics;
53
using Syncfusion.Drawing;
64

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

7-
//Creating new PDF Document.
8-
PdfDocument document = new PdfDocument();
9-
10-
//Adding new page to PDF document.
11-
PdfPage page = document.Pages.Add();
5+
//Create a new PDF document.
6+
using (PdfDocument document = new PdfDocument())
7+
{
8+
//Adding new page to PDF document.
9+
PdfPage page = document.Pages.Add();
1210

13-
//Drawing Code39 barcode.
14-
PdfCode39Barcode barcode = new PdfCode39Barcode();
11+
//Drawing Code39 barcode.
12+
PdfCode39Barcode barcode = new PdfCode39Barcode();
1513

16-
//Setting height of the barcode.
17-
barcode.BarHeight = 45;
14+
//Setting height of the barcode.
15+
barcode.BarHeight = 45;
1816

19-
//Set barcode text.
20-
barcode.Text = "CODE39$";
17+
//Set barcode text.
18+
barcode.Text = "CODE39$";
2119

22-
//Printing barcode on to the Pdf.
23-
barcode.Draw(page, new PointF(25, 70));
20+
//Printing barcode on to the Pdf.
21+
barcode.Draw(page, new PointF(25, 70));
2422

25-
//Create file stream.
26-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
27-
{
28-
//Save the PDF document to file stream.
29-
document.Save(outputFileStream);
23+
//Save the PDF document
24+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
3025
}
31-
32-
//Close the document.
33-
document.Close(true);
34-
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

@@ -13,21 +11,15 @@
1311
//Set the barcode text.
1412
barcode.Text = "400638133393";
1513

16-
//Creating new PDF document.
17-
PdfDocument document = new PdfDocument();
18-
19-
//Adding new page to PDF document.
20-
PdfPage page = document.Pages.Add();
14+
//Create a new PDF document.
15+
using (PdfDocument document = new PdfDocument())
16+
{
17+
//Adding new page to PDF document.
18+
PdfPage page = document.Pages.Add();
2119

22-
//Printing barcode on to the PDF document.
23-
barcode.Draw(page, new PointF(25, 70));
20+
//Printing barcode on to the PDF document.
21+
barcode.Draw(page, new PointF(25, 70));
2422

25-
//Create file stream.
26-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
27-
{
28-
//Save the PDF document to file stream.
29-
document.Save(outputFileStream);
23+
//Save the PDF document
24+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
3025
}
31-
32-
//Close the document.
33-
document.Close(true);
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

@@ -13,22 +11,16 @@
1311
//Set the barcode text.
1412
barcode.Text = "1234567";
1513

16-
//Creating new PDF document.
17-
PdfDocument document = new PdfDocument();
18-
19-
//Adding new page to PDF document.
20-
PdfPage page = document.Pages.Add();
14+
//Create a new PDF document.
15+
using (PdfDocument document = new PdfDocument())
16+
{
17+
//Adding new page to PDF document.
18+
PdfPage page = document.Pages.Add();
2119

22-
//Printing barcode on to the PDF.
23-
barcode.Draw(page, new PointF(25, 70));
20+
//Printing barcode on to the PDF.
21+
barcode.Draw(page, new PointF(25, 70));
2422

25-
//Create file stream.
26-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
27-
{
28-
//Save the PDF document to file stream.
29-
document.Save(outputFileStream);
23+
//Save the PDF document
24+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
3025
}
3126

32-
//Close the document.
33-
document.Close(true);
34-
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

7-
//Creating new PDF Document.
8-
PdfDocument document = new PdfDocument();
9-
10-
//Adding new page to PDF document.
11-
PdfPage page = document.Pages.Add();
12-
13-
//Create new instance for Codabar barcode.
14-
PdfCodabarBarcode barcode = new PdfCodabarBarcode();
5+
//Create a new PDF document.
6+
using (PdfDocument document = new PdfDocument())
7+
{
8+
//Adding new page to PDF document.
9+
PdfPage page = document.Pages.Add();
1510

16-
//Setting location of the barcode.
17-
barcode.Location = new PointF(100, 100);
11+
//Create new instance for Codabar barcode.
12+
PdfCodabarBarcode barcode = new PdfCodabarBarcode();
1813

19-
//Setting size of the barcode.
20-
barcode.Size = new SizeF(200, 100);
21-
barcode.Text = "123456789$";
14+
//Setting location of the barcode.
15+
barcode.Location = new PointF(100, 100);
2216

23-
//Printing barcode on to the PDF document.
24-
barcode.Draw(page);
17+
//Setting size of the barcode.
18+
barcode.Size = new SizeF(200, 100);
19+
barcode.Text = "123456789$";
2520

26-
//Create file stream.
27-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
28-
{
29-
//Save the PDF document to file stream.
30-
document.Save(outputFileStream);
31-
}
21+
//Printing barcode on to the PDF document.
22+
barcode.Draw(page);
3223

33-
//Close the document.
34-
document.Close(true);
24+
//Save the PDF document
25+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// See https://aka.ms/new-console-template for more information
2-
3-
using Syncfusion.Drawing;
1+
using Syncfusion.Drawing;
42
using Syncfusion.Pdf;
53
using Syncfusion.Pdf.Barcode;
64

@@ -16,23 +14,17 @@
1614
//Set the barcode text.
1715
barcode.Text = "http://www.syncfusion.com";
1816

19-
//Creating new PDF document.
20-
PdfDocument document = new PdfDocument();
21-
22-
//Adding new page to PDF document.
23-
PdfPage page = document.Pages.Add();
17+
//Create a new PDF document.
18+
using (PdfDocument document = new PdfDocument())
19+
{
20+
//Adding new page to PDF document.
21+
PdfPage page = document.Pages.Add();
2422

25-
//Printing barcode on to the PDF.
26-
barcode.Draw(page, new PointF(25, 70));
23+
//Printing barcode on to the PDF.
24+
barcode.Draw(page, new PointF(25, 70));
2725

28-
//Create file stream.
29-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
30-
{
31-
//Save the PDF document to file stream.
32-
document.Save(outputFileStream);
26+
//Save the PDF document
27+
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
3328
}
3429

35-
//Close the document.
36-
document.Close(true);
37-
3830

0 commit comments

Comments
 (0)