Hi,
Can you please go through below code and tell me why it's printing nice table in Word and not in pdf?
private Document temp()
{
Document document = new Document();
DocumentBuilder docBuilder = new DocumentBuilder();
docBuilder.StartTable();
for (int i = 0; i < 10;i++ )
{
docBuilder.InsertCell();
docBuilder.Write("enter Question here..");
docBuilder.InsertCell();
docBuilder.Writeln(i + "- enter answer here..");
docBuilder.EndRow();
}
docBuilder.EndTable();
return docBuilder.Document;
}
public void SaveAsPDF(string fileName) {
Document document = temp();
document.Save(fileName + ".tmp", SaveFormat.FormatAsposePdf);
// Convert the word document to PDF
Aspose.Pdf.Pdf pdfDoc = new Pdf();
pdfDoc.BindXML(fileName + ".tmp", null);
pdfDoc.Save(fileName);
File.Delete(fileName + ".tmp");
}
public void SaveAsWord(string fileName) {
Document document = temp();
document.Save(fileName);
}
Thanks,
S