Hi, I have flowing problem
I have doc file which I need to update and subsequently save to pdf. It can be reproduced.
public Document GetDoc()
{
Run run = null;
Document doc = new Document();
Paragraph para = new Paragraph(doc);
para.AppendChild(new Run(doc, "Clean"));
Section sec = doc.Sections[0];
sec.Body.AppendChild(para);
return doc;
}
[Test]
public void EditAndSaveAsPdf()
{
Document doc = GetDoc();
var nodes = doc.GetChildNodes(NodeType.Run, true);
Run firstRun = (Run) nodes[0];
for (int i = 1; i <= 3; i++)
{
firstRun.Text = String.Format("Iteration no: {0}", i);
doc.Save(String.Format("out{0}.pdf", i), SaveFormat.Pdf);
doc.Save(String.Format("out{0}.doc", i), SaveFormat.Doc);
}
}
Each of doc files has correct content - sequently
Iteration no: 1
Iteration no: 2
Iteration no: 3
but in each of pdf file content is “Iteration no: 1”
Currently I saving to doc stream first, create doc from that stream and then saving to pdf as workaround but its time and memory consuming.
Is there any other workaround for this?
Tested with Aspose.Words 10.4 and 10.8