AddCell().AddParagraphToCell(“Product 1”) SetHorizontalAlignment(HorizontalAlignment.Center) AddCellToRow().AddCellToRow(“January”).AddCellToRow(“February”).AddCellToRow(“March”) AddRow().SetHorizontalAlignment(HorizontalAlignment.Center) SetHorizontalAlignment(HorizontalAlignment.Center).ToTable() SetBold().SetMarginBottom(5).SetMarginTop(20).ToSection() ![]() Section.AddParagraph(“Table with colspan and rowspan:”) Section.AddLine().SetLength(500).SetColor(Color.Gray).SetAlignment(HorizontalAlignment.Center).ToDocument() AddCell().AddImage(“MyImage.png”).SetWidth(150).SetAlignment(HorizontalAlignment.Right).SetMargins(10, 10, 10, 10).ToRow().ToDocument() Integer euismod pretium est, a efficitur nunc dapibus at. Praesent lacus ex, iaculis at aliquam vel, mattis eget lacus. Interdum et malesuada fames ac ante ipsum primis in faucibus. AddText(“\nVestibulum eget lorem ultricies, convallis sapien eu, tristique dui. AddCell().AddParagraph(“Lorem ipsum dolor sit amet”).SetFontColor(Color.FromHtml(“#FC6A03”)).SetFontSize(20) Section.AddParagraph(“Hello World!”).ToDocument() In your Main class start typing this code to create a simple paragraph:ĭocumentBuilder builder = DocumentBuilder.New() You can add various content to a section, including paragraphs, images, tables, lines, and repeating areas. A document may contain one or more sections. Hello World!Now the PDFFlow library is installed, we are ready to create our first “Hello world” PDF document.Ī section is a part of a document holding content and layout. Select the package from the list and click Install.Go to the Browse tab and search for the Gehtsoft.PDFFlowLib package using the search box on the upper left.In Solution Explorer, right-click either References or a project and select Manage NuGet Packages.You can also install it from the Visual Studio NuGet Package Manager: You can download it as a NuGet package from NuGet Gallery | Gehtsoft.PDFFlowLib. Then we need to add the Gehtsoft.PDFFlowlib library to our project. Getting startedFirst, we need to create a new console application project “MyPDFDoc” in Visual Studio and choose Language “C#”. In this tutorial, we would like to share some of our experience in generating PDF documents in C# using the PDFFlow library.
0 Comments
Leave a Reply. |