I have a request for a template to be copied/repeated and filled in one document many times. Effectively importing many time the template in one docx.
I read the template and i putt it i a new document but the i loose the images of the template in the process
the code i use is as bellow
tDOCX := TDOCXReadWriteVcl.Create(Nil);
tDOCX.LoadFromFile(mytemplate); //read from template.
wDocx := TDOCXReadWriteVcl.Create(Nil); //create a new working document
wDocx.Editor.Clear;
try
wDocx.Editor.Assign(tDOCX.Editor); // assign template to working doc
finally
end;
……
Loop // while db not eof
Begin
….
….
wDOCX.Editor.Paras.Last.InsertBreak(acrbtPageBreak,wDOCX.Editor.Paras.Last.EndOfParaPos);
wDocx.Editor.Append(tDOCX.Editor); // append template to working doc
…..
End;
wDOCX.SaveToFile(myoutputfile);
One strange thing also . In the template i have a page break in the end of the template that is not inserted in main document.
we could insert the page break manually (we will try that and come back to you) but the Assign does not seem to
Please inform us about these issues.
Thanks in advance
DOCXReadWrite Appended document looses images and page break
Re: DOCXReadWrite Appended document looses images and page break
Hello
After we converted the image to BMP it worked ok.
But the page break we manually input in docx still not working in PDF.
I send the command we use.
FDOCX.Editor.Paras.Last.InsertBreak(acrbtPageBreak,FDOCX.Editor.Paras.Last.EndOfParaPos);
After we converted the image to BMP it worked ok.
But the page break we manually input in docx still not working in PDF.
I send the command we use.
FDOCX.Editor.Paras.Last.InsertBreak(acrbtPageBreak,FDOCX.Editor.Paras.Last.EndOfParaPos);
Re: DOCXReadWrite Appended document looses images and page break
Hello
Page breaks must be added to an empty para. Example:
Page breaks must be added to an empty para. Example:
Code: Select all
DOCX.Editor.AppendPara.AppendBreak(acrbtPageBreak);
Lars Arvidsson, Axolot Data
Re: DOCXReadWrite Appended document looses images and page break
Thanks for the fast reply.