Hello,
I have code which converts the Excel file to PDF. I am using Aspose 18.6.0 version.
My excel contains some line charts. But Once I convert excel to PDF I observe that series lines are bold in PDF. Please the attached image.
PDF output screenshot.png (11.8 KB)
Here is my Code snippet :
private static byte[] GetPDFBytes(Workbook wb)
{
foreach (Worksheet ws in wb.Worksheets)
{
if (ws.IsVisible)
{
ws.PageSetup.PaperSize = PaperSizeType.PaperLetter;
ws.PageSetup.Orientation = PageOrientationType.Landscape;
ws.PageSetup.RightMarginInch = 0.25;
ws.PageSetup.TopMarginInch = 0.25;
ws.PageSetup.LeftMarginInch = 0.25;
ws.PageSetup.BottomMarginInch = 0.25;
ws.PageSetup.HeaderMarginInch = 0.3;
ws.PageSetup.FooterMarginInch = 0.3;
}
}
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(SaveFormat.Pdf);
pdfSaveOptions.OnePagePerSheet = true;
using (MemoryStream PDFStream = new MemoryStream())
{
wb.Save(PDFStream, pdfSaveOptions);
wb.Save(@"C:\TEMP\PDFOutput.pdf", pdfSaveOptions);
return PDFStream.ToArray();
}
}
Also attached the Excel template and PDF output
SampleApplication.zip (173.0 KB)
Please let me know how to resolve the issue so that excel and pdf look similar.
Thanks,
Sarthak