How can I export Canvas Drawing as dxf file format .dxf

**How can I export Canvas Drawing as dxf drawing file format to be used in autodesk autocad program ( lines points circles shapes vectors) not image **

What would a dxf format file look like? Provide an example.

DXF is short for Drawing Exchange Format or Drawing Interchange Format and is a type of [vector file]. Engineers, designers and architects often use the DXF format for 2D and 3D drawings during product design.

https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3


https://en.wikipedia.org/wiki/AutoCAD

You did not show the format of an example dxf file.

We need to see this in order to see if it is possible to translate drawing coordinates on a canvas.

https://drive.google.com/file/d/1Q6A7W4Pjjpzbtu9FhAKN2g_TefYEJuRX/view?usp=sharing

this link contain a dxf drawing file , I have drawn some drawings elements in it for clarification ( circle and square and polygon by dimensions ) using autocad program

Having looked at the format, my guess is that unless autocad has some for of importer that the canvas data can export to, this will be nigh on impossible.

Have you experimented with SVG graphics in a WebViewer for your drawings?

If that works, then look at

https://www.google.com/search?q=svg+to+dxf+converter

There are many programs that import and export dxf files such as Autodesk Programs ( AutoCAD , REVIT ... ETC ) , Adobe Programs ( Illustrator ) , CNC Softwares

Through my research, exporting to dxf can be done in Java
https://stackoverflow.com/questions/23801956/save-dxf-file-in-java

Just look for a direct way to expoert a dxf or dwg file so that the user can open it directly in AutoCAD

I am find this " Java DXF Library _ Mit Licence "
https://jsevy.com/wordpress/index.php/java-and-android/jdxf-java-dxf-library/

But I don't know if I learn Java, can I use it to develop an App Inventor extension to do the same functions !!

That library does not help to convert jpg or png files to dxf format...

Let me suggest to do a Google search like this https://www.google.com/search?q=api%20convert%20jpg%20to%20dxf
to find an API, which is able to do that and then just use the web component to upload the jpg or png file and get back the converted file in dxf format

Taifun