@mgornova
Hello,
We’ve received your report that converting a specific DOCX file to PDF fails with a 500 error:
Cannot insert a node of this type at this location.
Below is a systematic way to troubleshoot the issue and the steps you can take to get it resolved on the Aspose side.
1. Verify the library version
The error you see is a server‑side exception that was fixed in later releases of Aspose.Words Cloud.
Version you used |
Current stable version (as of Sep 2025) |
25.7.0 |
25.11.0 (or newer) |
Action
Update the NuGet package (or the Maven/Gradle dependency) to the latest version and try the conversion again.
# .NET (NuGet)
dotnet add package Aspose.Words.Cloud --version 25.11.0
If the problem persists with the latest version, proceed with the next steps.
2. Isolate the problematic part of the document
The message “Cannot insert a node of this type at this location.” usually originates from an invalid OpenXML element (e.g., a VML shape, OLE object, or corrupted table structure).
Quick ways to pinpoint the cause
Method |
Description |
Open in Word → “Open and Repair” |
Word will try to fix the corrupted XML. Save the repaired file and test conversion again. |
Remove content in stages |
Delete sections (e.g., first page, headers/footers, pictures) and re‑run the conversion after each change. |
Export to Flat OPC |
Save the document as Word XML Document (.xml)* then open the XML in a text editor and look for <w:pict> , <v:shape> or <rel:oleObject> elements that are not closed properly. |
If you identify a specific element (e.g., an embedded Excel chart), you can:
- Replace it with a regular image, or
- Remove the element programmatically before conversion:
var request = new ConvertDocumentRequest(
"part-of-real-document-aspose-doesnt-work.docx",
new ConvertDocumentOptions { SaveFormat = "pdf" });
var response = await wordsApi.ConvertDocument(request);
3. Use the local Aspose.Words for .NET library to get a detailed stack trace
Running the conversion locally (instead of via the cloud service) gives you a full exception message, which often contains the exact node that caused the failure.
using Aspose.Words;
using Aspose.Words.Saving;
var doc = new Document("part-of-real-document-aspose-doesnt-work.docx");
doc.Save("output.pdf", SaveFormat.Pdf);
If the same exception is thrown, the stack trace will indicate the offending node (e.g., Body
, Run
, Paragraph
). Send that stack trace to our support team – it speeds up the root‑cause analysis.
4. Submit a focused support ticket with the file
The attachment you added to the forum cannot be accessed by the support engineers. To let us reproduce the issue on our side:
- Create a support ticket in the Aspose Help Center:
https://forum.aspose.com/c/help-center/30
- Attach the original
part-of-real-document-aspose-doesnt-work.docx
.
- Include:
- The exact API call you performed (URL, request body, authentication method).
- The version of Aspose.Words Cloud you are using.
- Any additional logs you captured (e.g., the local exception stack trace if you tried step 3).
Our engineering team will run the conversion in a controlled environment, identify the offending OpenXML construct, and provide either a fix or a workaround.
5. Common work‑arounds that often resolve this error
Situation |
Work‑around |
Corrupted VML shapes |
Convert the document to DOCX → DOCX (re‑save) before converting to PDF. |
Embedded OLE objects |
Remove OLE objects (doc.RemoveAllChildren(NodeType.Shape); ). |
Invalid table markup |
Recreate the table programmatically or copy its content into a new table. |
Header/Footer issues |
Delete and recreate headers/footers via the API. |
Example (removing all shapes before conversion):
var doc = new Document("input.docx");
doc.GetChildNodes(NodeType.Shape, true).Clear(); // removes VML/SmartArt shapes
doc.Save("output.pdf", SaveFormat.Pdf);
6. Next steps for you
- Upgrade to the latest Aspose.Words Cloud version and retry.
- If the error remains, run the local conversion to capture the detailed stack trace.
- Open a support ticket with the original file and any stack trace you obtain.
We’ll investigate the document on our side as soon as we receive the ticket and will get back with a definitive fix.
Helpful Links
If you need any further assistance—whether it’s a code sample, guidance on removing problematic nodes, or help creating the support ticket—please let us know. We’re here to help!