PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Thu Apr 02, 2026 10:07 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Oct 16, 2014 11:04 am 
Offline

Joined: Tue Jun 24, 2014 6:34 am
Posts: 3
I am using C# to take an Excel file as input and convert it into PDF. There are no images, just data in the form of tables. I am getting files as big as 100 MB.
I am using the following code for the conversions:
Code:
PdfDocumentRenderer _pdfRendererDoc1 = new PdfDocumentRenderer(true);
                        Document _doc1 = new Document();
                        Style _styleDoc1 = _object.SetStyle(_doc1);
                        PdfDocument pdfDoc1 = new PdfDocument();

                        Section _sectionDoc1 = _object.SetSection(_doc1);
                        Table _tableDoc1 = _object.AddTables(_sectionDoc1);

                        Row _rowDoc1;
                        Cell _cellDoc1;

                        _object.AddColumns(_tableDoc1, colWidth);

                        for (int row = 1; row <= end.Row; row++)
                        {
                            _rowDoc1 = _object.AddRows(_tableDoc1);

                            int col = 1, pdfCol = 0;
                            while (pdfCol < numColumns)
                            {
                                _cellDoc1 = _rowDoc1.Cells[pdfCol];
                                pdfCol ++;
                                col++;
                            }
                        }

                        _pdfRendererDoc1.Document = _doc1;

                        // Render output file //
                        _pdfRendererDoc1.RenderDocument();

                        // Save output file //
                        _pdfRendererDoc1.Save(outputFileLocation + outputFileName);


So, is there an option (like resolution, may be) to reduce the size of PDFs?

Thanks in advance :)


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 16, 2014 11:22 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3144
Location: Cologne, Germany
The RELEASE build creates smaller files than the DEBUG build (verbose files with many comments).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: AhrefsBot, GPT and 197 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group