├── .gitignore
├── FastReport.OpenSource.HtmlExporter
├── FastReport.OpenSource.HtmlExporter.Core
│ ├── FastReport.OpenSource.HtmlExporter.Core.csproj
│ ├── FastReportGenerator.cs
│ ├── Utils.cs
│ └── Workers
│ │ ├── CustomPageTagWorker.cs
│ │ └── CustomTagWorkerFactory.cs
├── FastReport.OpenSource.HtmlExporter.sln
└── FastReport.OpenSource.HtmlExporter
│ ├── FastReport.OpenSource.HtmlExporter.csproj
│ ├── Models
│ └── TestReportDataModel.cs
│ ├── Program.cs
│ ├── ReportDesigns
│ └── test.frx
│ ├── ReportExports
│ ├── testWithPdfSimple.pdf
│ └── testWithoutPdfSimple.pdf
│ └── ReportUtils.cs
├── README.md
└── logo.png
/.gitignore:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3 | ################################################################################
4 |
5 | /.vs
6 | /FastReport.OpenSource.HtmlExporter/.vs/FastReport.OpenSource.HtmlExporter
7 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/bin/Debug/net5.0
8 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/obj
9 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/bin/Debug/net5.0
10 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/obj
11 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/bin/Debug/net8.0
12 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/bin/Debug/net8.0
13 | /FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/bin
14 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/FastReport.OpenSource.HtmlExporter.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | PdfExporter.FastReport.OpenSource
6 | PdfExporter.FastReport.OpenSource: Create PDF Files Without PdfSimple Plugin
7 | 1.0.0
8 | Yusuf Bal
9 | PdfExporter.FastReport.OpenSource
10 | Create FastReport PDF Files From Html with itext7 Library, Without PdfSimple Plugin
11 | https://github.com/yusufbal/FastReport.OpenSource.HtmlExporter
12 | logo.png
13 | README.md
14 | https://github.com/yusufbal/FastReport.OpenSource.HtmlExporter
15 | MIT
16 | True
17 |
18 |
19 |
20 |
21 | True
22 | \
23 |
24 |
25 | True
26 | \
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/FastReportGenerator.cs:
--------------------------------------------------------------------------------
1 | using iText.Html2pdf;
2 | using iText.Kernel.Geom;
3 | using iText.Kernel.Pdf;
4 | using iText.Layout.Element;
5 | using iText.Layout.Properties;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using FastReport;
12 | using System.IO;
13 | using iText.Html2pdf.Resolver.Font;
14 | using iText.Layout.Font;
15 | using FastReport.OpenSource.HtmlExporter.Core.Workers;
16 | using iText.Layout;
17 | using FastReport.Export.Html;
18 | using FastReport.Export.PdfSimple;
19 |
20 | namespace FastReport.OpenSource.HtmlExporter.Core
21 | {
22 | public class FastReportGenerator where T : class
23 | {
24 | public string DesignPath { get; set; }
25 |
26 | public string DesignFileName { get; set; }
27 |
28 | public FastReportGenerator(string designPath, string DesignFileName)
29 | {
30 | this.DesignPath = designPath;
31 | this.DesignFileName = DesignFileName;
32 | }
33 |
34 | private Report CreateReportWithData(List model)
35 | {
36 | var fileName = System.IO.Path.Combine(DesignPath, DesignFileName);
37 | var report = new Report();
38 | report.Load(fileName);
39 | report.RegisterData(model, typeof(T).Name, 10);
40 | return report;
41 | }
42 |
43 | public byte[] GenerateWithPDFSimplePlugin(T model, int duplicateCount = 1)
44 | {
45 | var data = new List();
46 | for (int i = 0; i < duplicateCount; i++)
47 | {
48 | data.Add(model);
49 | }
50 | return GenerateWithPDFSimplePlugin(data);
51 | }
52 |
53 | public byte[] GenerateWithPDFSimplePlugin(List model)
54 | {
55 | var report = CreateReportWithData(model);
56 | if (report.Report.Prepare())
57 | {
58 | var pdfExport = new PDFSimpleExport();
59 | var stream = new MemoryStream();
60 | report.Report.Export(pdfExport, stream);
61 | report.Dispose();
62 | pdfExport.Dispose();
63 | stream.Position = 0;
64 | return stream.ToArray();
65 | }
66 | else
67 | {
68 | return new byte[0];
69 | }
70 | }
71 |
72 | public string GenerateHtml(List model, out List pages)
73 | {
74 | pages = new List();
75 | var report = CreateReportWithData(model);
76 | if (report.Report.Prepare())
77 | {
78 | HTMLExport export = new HTMLExport();
79 | export.Layers = true;
80 | using (MemoryStream ms = new MemoryStream())
81 | {
82 | export.EmbedPictures = true;
83 | export.Export(report, ms);
84 | for (int i = 0; i < report.Report.PreparedPages.Count; i++)
85 | {
86 | pages.Add(report.Report.PreparedPages.GetPage(i));
87 | }
88 | ms.Flush();
89 | return Encoding.UTF8.GetString(ms.ToArray());
90 | }
91 | }
92 | return string.Empty;
93 | }
94 |
95 | public byte[] GeneratePdfFromHtml(T model)
96 | {
97 | var data = new List();
98 | data.Add(model);
99 | return GeneratePdfFromHtml(data);
100 | }
101 |
102 | public byte[] GeneratePdfFromHtml(List model)
103 | {
104 | var reportHtml = GenerateHtml(model, out var pages);
105 | if (string.IsNullOrEmpty(reportHtml) || pages.Count == 0)
106 | return null;
107 | using (var workStream = new MemoryStream())
108 | {
109 | using (var pdfWriter = new PdfWriter(workStream))
110 | {
111 | FontProvider fontProvider = new DefaultFontProvider(true, true, true);
112 | var converterProperties = new ConverterProperties();
113 | converterProperties.SetTagWorkerFactory(new CustomTagWorkerFactory());
114 | converterProperties.SetFontProvider(fontProvider);
115 | var pdfDocument = new PdfDocument(pdfWriter);
116 | pdfDocument.SetDefaultPageSize(Utils.GetPageSizeFromMilimeters(pages[0].PaperWidth, pages[0].PaperHeight));
117 | var elements = HtmlConverter.ConvertToElements(reportHtml, converterProperties);
118 | var document = new Document(pdfDocument);
119 | document.SetMargins(pages[0].TopMargin, pages[0].RightMargin, pages[0].BottomMargin, pages[0].LeftMargin);
120 | int elementIndex = 0;
121 | int pageIndex = 0;
122 | foreach (IElement element in elements)
123 | {
124 | if (element.HasProperty(Utils.PageDivProperty) && elementIndex > 0)
125 | {
126 | pageIndex++;
127 | pdfDocument.SetDefaultPageSize(Utils.GetPageSizeFromMilimeters(pages[pageIndex].PaperWidth, pages[pageIndex].PaperHeight));
128 | document.SetMargins(pages[pageIndex].TopMargin, pages[pageIndex].RightMargin, pages[pageIndex].BottomMargin, pages[pageIndex].LeftMargin);
129 | document.Add(new AreaBreak(AreaBreakType.NEXT_PAGE));
130 | }
131 | document.Add((IBlockElement)element);
132 | elementIndex++;
133 | }
134 | document.Close();
135 | return workStream.ToArray();
136 | }
137 | }
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/Utils.cs:
--------------------------------------------------------------------------------
1 | using iText.Kernel.Geom;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FastReport.OpenSource.HtmlExporter.Core
9 | {
10 | public static class Utils
11 | {
12 | public const int PageDivProperty = -10;
13 |
14 | public static PageSize GetPageSizeFromMilimeters(float width, float height)
15 | {
16 | width = (float)Math.Round(width);
17 | height = (float)Math.Round(height);
18 | if (width == 841 && height == 1189) return PageSize.A0;
19 | if (width == 594 && height == 841) return PageSize.A1;
20 | if (width == 420 && height == 594) return PageSize.A2;
21 | if (width == 297 && height == 420) return PageSize.A3;
22 | if (width == 210 && height == 297) return PageSize.A4;
23 | if (width == 148 && height == 210) return PageSize.A5;
24 | if (width == 105 && height == 148) return PageSize.A6;
25 | if (width == 74 && height == 105) return PageSize.A7;
26 | if (width == 52 && height == 74) return PageSize.A8;
27 | if (width == 37 && height == 52) return PageSize.A9;
28 | if (width == 26 && height == 37) return PageSize.A10;
29 | if (width == 1000 && height == 1414) return PageSize.B0;
30 | if (width == 707 && height == 1000) return PageSize.B1;
31 | if (width == 500 && height == 707) return PageSize.B2;
32 | if (width == 353 && height == 500) return PageSize.B3;
33 | if (width == 250 && height == 353) return PageSize.B4;
34 | if (width == 176 && height == 250) return PageSize.B5;
35 | if (width == 125 && height == 176) return PageSize.B6;
36 | if (width == 88 && height == 125) return PageSize.B7;
37 | if (width == 62 && height == 88) return PageSize.B8;
38 | if (width == 44 && height == 62) return PageSize.B9;
39 | if (width == 31 && height == 44) return PageSize.B10;
40 | return PageSize.DEFAULT;
41 | }
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/Workers/CustomPageTagWorker.cs:
--------------------------------------------------------------------------------
1 | using iText.Html2pdf.Attach;
2 | using iText.Html2pdf.Attach.Impl.Tags;
3 | using iText.Html2pdf.Html;
4 | using iText.Layout;
5 | using iText.StyledXmlParser.Node;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 |
12 | namespace FastReport.OpenSource.HtmlExporter.Core.Workers
13 | {
14 | public class CustomPageTagWorker : DivTagWorker
15 | {
16 | public CustomPageTagWorker(IElementNode element, ProcessorContext context) : base(element, context)
17 | {
18 | }
19 |
20 | public override void ProcessEnd(IElementNode element, ProcessorContext context)
21 | {
22 | base.ProcessEnd(element, context);
23 | IPropertyContainer elementResult = GetElementResult();
24 | if (elementResult != null && !String.IsNullOrEmpty(element.GetAttribute(AttributeConstants.CLASS)) && element.GetAttribute(AttributeConstants.CLASS).StartsWith("frpage"))
25 | {
26 | elementResult.SetProperty(Utils.PageDivProperty, element.GetAttribute(AttributeConstants.CLASS));
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.Core/Workers/CustomTagWorkerFactory.cs:
--------------------------------------------------------------------------------
1 | using iText.Html2pdf.Attach;
2 | using iText.Html2pdf.Attach.Impl;
3 | using iText.Html2pdf.Html;
4 | using iText.StyledXmlParser.Node;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace FastReport.OpenSource.HtmlExporter.Core.Workers
12 | {
13 | public class CustomTagWorkerFactory : DefaultTagWorkerFactory
14 | {
15 | public override ITagWorker GetCustomTagWorker(IElementNode tag, ProcessorContext context)
16 | {
17 | if (TagConstants.DIV.Equals(tag.Name().ToLower()))
18 | {
19 | return new CustomPageTagWorker(tag, context);
20 | }
21 | return base.GetCustomTagWorker(tag, context);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.32210.238
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.OpenSource.HtmlExporter", "FastReport.OpenSource.HtmlExporter\FastReport.OpenSource.HtmlExporter.csproj", "{0D345CB5-FEC9-4286-B601-F838E4033BD3}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.OpenSource.HtmlExporter.Core", "FastReport.OpenSource.HtmlExporter.Core\FastReport.OpenSource.HtmlExporter.Core.csproj", "{510C331C-3373-43BE-B250-FCF655031DB3}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {0D345CB5-FEC9-4286-B601-F838E4033BD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {0D345CB5-FEC9-4286-B601-F838E4033BD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {0D345CB5-FEC9-4286-B601-F838E4033BD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {0D345CB5-FEC9-4286-B601-F838E4033BD3}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {510C331C-3373-43BE-B250-FCF655031DB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {510C331C-3373-43BE-B250-FCF655031DB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {510C331C-3373-43BE-B250-FCF655031DB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {510C331C-3373-43BE-B250-FCF655031DB3}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BEDDEE68-916B-406A-82F7-5DA8484F46A4}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/Models/TestReportDataModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FastReport.OpenSource.HtmlExporter.Models
8 | {
9 | public class TestReportDataModel
10 | {
11 | public int Id { get; set; }
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/Program.cs:
--------------------------------------------------------------------------------
1 | using FastReport.OpenSource.HtmlExporter.Core;
2 | using FastReport.OpenSource.HtmlExporter.Models;
3 | using iText.Kernel.Geom;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO;
7 |
8 | namespace FastReport.OpenSource.HtmlExporter
9 | {
10 | internal class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | ExportWithPdfSimple();
15 | ExportWithoutPdfSimple();
16 | }
17 |
18 | static void ExportWithPdfSimple()
19 | {
20 | var data = GenerateData();
21 | var fastReportGenerator = new FastReportGenerator(ReportUtils.DesignerPath, "test.frx");
22 | var report = fastReportGenerator.GenerateWithPDFSimplePlugin(data);
23 | ExportToFile(report, "testWithPdfSimple");
24 | }
25 |
26 | static void ExportWithoutPdfSimple()
27 | {
28 | var data = GenerateData();
29 | var fastReportGenerator = new FastReportGenerator(ReportUtils.DesignerPath, "test.frx");
30 | var report = fastReportGenerator.GeneratePdfFromHtml(data);
31 | ExportToFile(report, "testWithoutPdfSimple");
32 | }
33 |
34 | static void ExportToFile(byte[] report,string fileName)
35 | {
36 | fileName = System.IO.Path.Combine(ReportUtils.ExportPath, string.Format("{0}.pdf", fileName));
37 | if (File.Exists(fileName))
38 | {
39 | File.Delete(fileName);
40 | }
41 | File.WriteAllBytes(fileName, report);
42 | }
43 |
44 | static List GenerateData()
45 | {
46 | var data = new List();
47 | for (int i = 0; i < 1000; i++)
48 | {
49 | data.Add(new TestReportDataModel { Id = i });
50 | }
51 | return data;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportDesigns/test.frx:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System;
4 | using System.Collections;
5 | using System.Collections.Generic;
6 | using System.ComponentModel;
7 | using System.Windows.Forms;
8 | using System.Drawing;
9 | using System.Data;
10 | using FastReport;
11 | using FastReport.Data;
12 | using FastReport.Dialog;
13 | using FastReport.Barcode;
14 | using FastReport.Table;
15 | using FastReport.Utils;
16 |
17 | namespace FastReport
18 | {
19 | public class ReportScript
20 | {
21 |
22 | }
23 | }
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportExports/testWithPdfSimple.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yusufbal/FastReport.OpenSource.HtmlExporter/8cec0092e1adc4b5af8062ff4af9f6afab47939f/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportExports/testWithPdfSimple.pdf
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportExports/testWithoutPdfSimple.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yusufbal/FastReport.OpenSource.HtmlExporter/8cec0092e1adc4b5af8062ff4af9f6afab47939f/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportExports/testWithoutPdfSimple.pdf
--------------------------------------------------------------------------------
/FastReport.OpenSource.HtmlExporter/FastReport.OpenSource.HtmlExporter/ReportUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FastReport.OpenSource.HtmlExporter
9 | {
10 | public static class ReportUtils
11 | {
12 | private static string ProjectDirPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\"));
13 |
14 |
15 | public static string DesignerPath
16 | {
17 | get
18 | {
19 | return Path.Combine(ProjectDirPath, "ReportDesigns");
20 | }
21 | }
22 |
23 | public static string ExportPath
24 | {
25 | get
26 | {
27 | return Path.Combine(ProjectDirPath, "ReportExports");
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FastReport.OpenSource.HtmlExporter: Generate FastReport PDF Files Without PdfSimple Plugin
2 | ## Overview
3 | FastReport provides open source report generator for ..NET8/.NET6/.NET Core/.NET Framework 4.x. You can use the FastReport in MVC, Web API applications. FastReport Open Source is based on the FastReport.Net project. You can find more information at https://github.com/FastReports/FastReport.Documentation
4 |
5 | FastReport Open Source can save documents in HTML, BMP, PNG, JPEG, GIF, TIFF, EMF.
6 |
7 | When you want to export report with PDF format, you must use FastReport.OpenSource.Export.PdfSimple plugin. You can find more information at https://github.com/FastReports/FastReport/tree/master/Extras/OpenSource/FastReport.OpenSource.Export.PdfSimple
8 |
9 | PdfSimple plugin exports pdf files as images. For example, if you have 10 pages of an exported report, PdfSimple converts every page as an image then it merges all images in one pdf file. Therefore, with this plugin, the size of your pdf output is too large and you cannot copy the texts from the pdf output.
10 |
11 | ## How can we solve this problem?
12 | FastReport's solution for this is to switch to the paid version: https://github.com/FastReports/FastReport/issues/86
13 | You can compare versions from: https://www.fast-report.com/en/fast-report-comparison/
14 |
15 | If you want to find a solution for this problem without going to the paid version, you can solve the problem by getting help from the itext7 library.
16 |
17 | In this application, we will create the report outputs that we will create with FastReport as html and convert them to pdf with the itext7 library.
18 |
19 | ## Versions
20 | ### Initial Version (.NET 5 & FastReport 2022.2.2)
21 | The initial version of the library, developed using .NET 5 and FastReport 2022.2.2, incorporated the GeneratePdfFromHtml method within the FastReportGenerator class. This method utilized FastReport's HTML export tool to convert reports to HTML, which were then transformed into PDFs using the iText7 library. One limitation of this version was that it standardized all pages to a single size regardless of the original report specifications, with default margins set to zero.
22 |
23 | ### Latest Version (.NET 8.0 & Latest FastReport)
24 | The library has been upgraded to .NET 8.0 and uses the latest FastReport libraries. Improvements include ensuring each page in the PDF retains the size and margins defined in the original report template. This version facilitates the creation of PDFs where each page can vary in dimensions according to the specifications within the report template.
25 |
26 | ## Features
27 | FastReport.OpenSource.HtmlExporter provides significant improvements over the basic functionalities offered by FastReport's PdfSimple tool, particularly in terms of file size optimization and text accessibility:
28 |
29 | * **Enhanced File Size Optimization:** Unlike the free version of FastReport's PdfSimple tool, which only allows creation of large-sized PDF files, FastReport.OpenSource.HtmlExporter efficiently generates much smaller PDF files. This reduction in file size does not compromise the quality or the detail of the reports, making it an ideal solution for extensive data reporting.
30 |
31 | * **Text Selectability in PDFs:** One of the major limitations of the PdfSimple tool in its free version is that it converts report pages into images within the PDF, which prevents text from being selectable. Our library overcomes this issue by retaining text as selectable elements within the PDF. This feature greatly enhances usability, allowing for text to be copied directly from the PDF files, which is crucial for report documentation and accessibility.
32 |
33 | * **Cost-Effective Solution:** FastReport provides advanced PDF generation features such as smaller file sizes and selectable text only in its paid versions. FastReport.OpenSource.HtmlExporter, on the other hand, offers these advanced features for free. This makes it an invaluable tool for developers and companies looking to optimize their reporting solutions without additional cost.
34 |
35 | By using FastReport.OpenSource.HtmlExporter, users gain access to professional-level PDF generation features at no cost, providing a robust alternative to the limited free functionalities of FastReport's PdfSimple tool.
36 |
37 | ## Getting Started
38 | To start using FastReport.OpenSource.HtmlExporter, clone the repository and include it in your .NET projects or you can add nuget package to your project.
39 |
40 | ## Nuget
41 | https://www.nuget.org/packages/PdfExporter.FastReport.OpenSource v1.0.0
42 |
43 |
44 | ## Usage
45 | Here's how to use the library with an example:
46 |
47 | ```cs
48 | // Create an instance of the FastReportGenerator with the path to the report designer and the report file
49 | var fastReportGenerator = new FastReportGenerator(ReportUtils.DesignerPath, "test.frx");
50 |
51 | // Generate the PDF from the provided data model
52 | var report = fastReportGenerator.GeneratePdfFromHtml(data);
53 | ```
54 |
55 | ## License
56 | FastReport.OpenSource.HtmlExporter is licensed under the MIT License. See the LICENSE file for more details.
57 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yusufbal/FastReport.OpenSource.HtmlExporter/8cec0092e1adc4b5af8062ff4af9f6afab47939f/logo.png
--------------------------------------------------------------------------------