Free Support Forum - aspose.com

Replace a text with a table in a exisiting PDF

Hi all,

I have this to generate a pdf with a very hard and maybe a lot of change in the format layout.

So I will generate the PDF as a template using Ms. Word to generate the first time and put content place holders to insert the dynamic information, for example if i have to add a client name in the pdf I will have this

Name:

then in the code I use:

PdfContentEditor pdfContentEditor = new PdfContentEditor();

pdfContentEditor.BindPdf(@"C:\..\..");

pdfContentEditor.ReplaceText("", 1, "Peter Capusoto");

This work fine! and smell great since the user can define or edit the format and save as a pdf and I not need to change my code.

The problem here is, how can I replace a Table using the same technic? I have ReplaceText but no have a ReplaceTable(...)

Thanks,

Regards,

Diego

Hi Diego,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.Pdf.

Do you need a feature to replace the existing table in a PDF document or your requirement is to replace some text (place holder) with a table? Please let us know about your requirement, so we can further check your issue.

Sorry for the inconvenience,

Hi Nausherwan

Thanks for your resposne, Yes I need replace a text with a table in a existing PDF, this could be work fine for me.

I see this in the new version of Aspose (7.1):

doc.Pages[1].AddTable(table);

but I need to insert in a place holder and no in the page.

this is not a Aspose method:

doc.Pages[1].AddTable(table, "tag_text"); If i have this or similar where tag_text is used to mach and replace it with the table.

Thanks,

Regards, Diego

I follow this as a first solution but this is not inaff since I need to add the table inside a aother table, the parent existe but i need to add dinamically childs tables.

http://www.aspose.com/docs/display/pdfnet/Add+Table+in+Existing+PDF+Document

this insert at point(x,y) postiion.

i will try to do this, convert my tamplate pdf as a xml then insert xml tag to represent the table at the position I need it (as a child of other table) then build the pdf using convertion xml to PDF.

Regards,

Ok, the Aspose PDF not provide the hability to read a PDF and work with the objetc inside that PDF to edit add new text, paragraf, tables, img etc?

Hi Diego,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am afraid; the feature to add a table in another table of existing PDF file is not supported at the moment. I have created a new feature request in our issue tracking system with issue id: PDFNEWNET-34411. Our development team will look into the feasibility of this feature and we will notify you regarding any updates via this thread.

Sorry for the inconvenience,

Hi Diego,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

DiegoCurbelo:

Ok, the Aspose PDF not provide the hability to read a PDF and work with the objetc inside that PDF to edit add new text, paragraf, tables, img etc?

Please provide some more details about your requirements so we can reply you accordingly and in case some feature is not support, we can include it in our development list.

Sorry for the inconvenience,