Converting from word to pdf.format issues

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

Dear shamley,

Could you please attach the fileName + “.tmp” document here for testing?

We will try to reproduce the same error and find out possible reasons.

Best regards,

Dear Shamley,

The "automatically resize to fit content" setting in table is not supported in Aspose.Pdf. You have to specify the column with for table. We will try to support this feature in the future version.