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
