Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Aspose Pdf is taking 4.902 seconds and the opensource one is taking 2.817 seconds

$
0
0

I was evaluating the product for PDF creation.

 

I did a simple performance benchmark testing of Aspose against some opensource pdf creators (like PdfSharp-Migradoc).

 

Test Setup – Simple pdf with 15,000 lines and 80 characters in each line.

 

Aspose Pdf is taking 4.902 seconds and the opensource one is taking 2.817 seconds , I did applied the License you have send me and it is creating a PDF without watermark.

Note : I also used the basic code samples given in the respective sites.

 

Question : is this performance deviation normal ? With this it will be difficult for me to proceed further as we do have very strict performance requirements.

 

Let me know if I am missing something.

 

Here is the code used for Aspose pdf

 

publicvoid CreatePdf()

        {

           //Create pdf document

           Pdf pdf1 = newPdf();

 

           //Instantiate License class and call its SetLicense method to use the license

            Aspose.Pdf.License license = new Aspose.Pdf.License();

            license.SetLicense("Aspose.Total.lic");

 

           //Add a section into the pdf document

            Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

 

           //Add a text paragraph into the section

           //sec1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("Hello World"));

           for (int i = 0; i < 15000; i++)

            {

                sec1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("01234567890123456789012345678901234567890123456789012345678901234567890123456789"));

               

            }

 

           //Save the document

            pdf1.Save("Aspose.pdf");

        }

 

 

And here is the one using pdf-sharp Migradoc

 

using PdfSharp;

using PdfSharp.Drawing;

using PdfSharp.Pdf;

using PdfSharp.Pdf.IO;

using MigraDoc.DocumentObjectModel;

using MigraDoc.Rendering;

 

 

       publicvoid CreatePdf()

        {

           Document document = newDocument();

 

           Section section = document.AddSection();

           for (int i = 0; i < 15000; i++)

            {

                section.AddParagraph("01234567890123456789012345678901234567890123456789012345678901234567890123456789");

            }

 

           PdfDocumentRenderer pdfRenderer = newPdfDocumentRenderer(false,PdfFontEmbedding.Always);

 

            pdfRenderer.Document = document;

 

            pdfRenderer.RenderDocument();

           string filename = "PdfSharp.pdf";

            pdfRenderer.PdfDocument.Save(filename);

        }

 



Viewing all articles
Browse latest Browse all 3131

Trending Articles