The annotation within the block cannot be exported

The annotation within the block cannot be exported.
question.zip (110.5 KB)

@DervinW

1. Exporting a drawing that contains annotations (Java)

A typical way to export a CAD file (DWG/DXF) with Aspose.CAD for Java is:

import com.aspose.cad.Image;
import com.aspose.cad.ImageExportFormats;

public class ExportCad {
    public static void main(String[] args) throws Exception {
        // Load the source CAD file
        Image cadImage = Image.load("Drawing5.dwg");

        // Export to PDF (or any other supported format)
        cadImage.save("Drawing5.pdf", ImageExportFormats.Pdf);
    }
}

This code works for most entities, including stand‑alone annotations such as TEXT, MTEXT, DIMENSION, etc.

2. Observation about the attached file

In the file you attached (question.zip) the annotation is placed inside a block definition. After exporting with the code above, the resulting PDF does not show that annotation. The attachment was created with Aspose.CAD [2] and the issue was reported in the forum thread “The annotation within the block cannot be exported” [1].

3. Possible work‑arounds

Option Description
Explode the block before export If you can modify the source DWG (e.g., using a CAD editor) and explode the block so that the annotation becomes a top‑level entity, the export is more likely to include it.
Extract annotation data manually Use the low‑level CAD API (e.g., DwgImageGetEntities()) to locate the annotation inside the block, read its properties, and add a custom overlay after export.
Contact support Provide the sample file to Aspose support so the engineering team can investigate the behavior further.

If none of these approaches suit your scenario, please open a support ticket and attach the same DWG file for deeper analysis.

@DervinW,
Hi,
thank you for all details provided, we have created CADJAVA-12056 to investigate this issue.