Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu May 21, 2020 10:35 am

HI Team,

We are having issues when we are replacing the a placeholder(Document 1) with a document.

Please find the sample code which we used. Also i have attached the documents as a ZIP which contains both files(Template.docx and Document1.docx)

Document document = new Document("Template.docx");

//Load another document to replace text
IDocument replaceDocument = new Document("Document1.docx");

//Replace specified text with the other document
document.Replace("Document 1", replaceDocument, false, true);

//Save the file
document.SaveToFile("Output.docx", FileFormat.Docx2013);

I am keep getting the Exception {"Value cannot be null.\r\nParameter name: textBody"} When i am using the documents which i shared in attachments

Can you please help me sorted why we are having this exception. Please let us know if you need more information.

Thanks
Ravi

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Fri May 22, 2020 2:21 am

Hello,

Thanks for your inquiry.
I tested your scenario and indeed got the error "Value cannot be null". This issue has been posted to our Dev team with the ticket SPIREDOC-4491 for further investigation and fixing. We will keep you informed if there is any update.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu May 28, 2020 3:47 am

HI Team,

I am still waiting for the response. Its has been long time i posted but no reply.

Can you please provide me a response.

Thanks
Ravi

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Thu May 28, 2020 5:56 am

Hello,

Thanks for your following up.
I checked the status of your issue and found it has been fixed. It is now under the test phase. If it passes the test, we will prepare a hotfix for you.
Sorry for the delay and inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Jun 05, 2020 11:08 am

Hello,

Thanks for your patient waiting.
Glad to tell you that we just released Spire.Doc Pack(hot fix) Version:8.6.3, which fixes the issue that application threw the error "Value cannot be null" when replacing document. Welcome to download it from the following links.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/8.6.3

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF