We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save workbook as Pdf- returns pdf with overlapped values

Hi,


I am saving a worksheet as pdf file.

********************************************
            FileStream fstream = new FileStream( @“D:\Work\Aspose\new models\Sample.pdf”, FileMode.Open); 
//Instantiate a Workbook object that represents the existing Excel file
Workbook _workbook = new Workbook(fstream);
            Workbook workbook = new Workbook();
workbook.Worksheets.Clear();
workbook.Worksheets.Add(“Report”);
            _workbook.Worksheets[“Report”].Cells.RemoveFormulas();

Worksheet worksheet = _workbook.Worksheets[“Report”];
workbook.Worksheets[“Report”].Copy(worksheet);
        <span style="color:blue;">string</span> fileName = <span style="color:#a31515;">@"D:\Work\Aspose\new models\Sample.pdf"</span>;
        workbook.Save(fileName, <span style="color:#2b91af;">SaveFormat</span>.Pdf);</pre></div><div>********************************************</div><div><br></div><div>The resulting pdf file has some values overlapped.</div><div>How do I programatically make sure that the columns are re-sized so that the cell values don't overlap in pdf file.</div><div><br></div><div><br></div><div>Thanks</div><div>-Padma</div><div><br></div>

Hi,


Thanks for the files.


I have tested your case / scenario. I think Aspose.Cells component works better than Ms Excel. If you closely look into those cells in Excel(in the sheet), you will see that it shows “#” or “#####” etc. for the data/value, so, Aspose.Cells work in better way to at least show the value. I have attached one PDF file that is generated in Ms Excel, if you could look into it and check those areas or cells, you will find those “#” for the cells values. Do you need us to work in that way?

Thank you.