First, please let me say how thrilled I am to have found you guys! I looked for a long time for a way to easily convert an excel document to a pdf. Thank you for making such a great product!
I am having a bit of trouble in converting an excel worksheet to a PDF document. Some of the content is being clipped because it doesn't fit in the page. Is there a way that I can shrink the size of the Excel worksheet content so that it will fit inside the PDF document? This is the code I am using:
- Code: Select all
var result = GenerateBOMReport(Model, bom, path, true);
Workbook workbook = new Workbook();
workbook.LoadFromStream(result);
PdfConverter pdfConverter = new PdfConverter(workbook);
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape;
PdfConverterSettings settings = new PdfConverterSettings();
settings.TemplateDocument = pdfDocument;
pdfDocument = pdfConverter.Convert(settings);
pdfDocument.SaveToFile(@"..\..\docs\result.pdf");
Also, I am being told that this line is obsolete:
- Code: Select all
pdfDocument = pdfConverter.Convert(settings);
But I'm not sure how else to do it.
Thanks!