How to export ai file properly using PDFNet SDK.

I'm evaluating PDFNet SDK to develop Adobe Illustrator (AI) file format compatibility.

I tested this through the sample, "ElementEditTest".
This sample works fine about pdf extension.
In the case of ai extension, it seems work fine.
But when I open edited ai file on Adobe Illustrator, the modified elements are not applied. This means there is no different between two ai files that original and edited one.

I could the see the modified elements when I open the edited ai file as pdf file.
Is this mean PDFNet SDK can not export ai file perfectly? or there is something that I missed.

While AI files contain PDF content in them, there is apparently more to the AI file than the PDF content. I’m sure if you open the modified AI file in a PDF reader, you see the changes you made.

I’m evaluating PDFNet SDK to develop Adobe Illustrator (AI) file format compatibility.

What sort of compatibility are you looking for? What are AI files important for you?

Adobe Illustrator (AI) files are similar to PDF and in some cases could be identical.

But often the app stores a separate working version of page content under PieceInfo dictionary (in the Page dictionary). So if you are using ElementEdit appoach you are only modifying the “Preview” part of the AI file.

You can use free version of CosEdit (https://www.pdftron.com/pdfcosedit/downloads.html) to explore AI files.

For more info about PieceInfo dict see PDF spec (Section 14,5; http://xodo.com/view/#/c0c11968-ee14-478e-9b09-6dc5635c0915)

For details re: contents of this dictionary you would need to refer to AI specifications.

A possible workaround may be simply to delete PieceInfo dict after your edit:

page.GetSDFObj().Erase(“PieceInfo”);

This way Illustrator should import PDF contant part of the file (not the possibly more rich AI version).

If this it not good enough, you could use SDF/Cos API to extract and modify contents of PieceInfo dict and all related AI structures (See http://www.pdftron.com/pdfnet/intro.html, http://www.pdftron.com/pdfnet/samplecode.html#SDF)

Thanks.
I understood that it is required additional implementation using SDF/Cos API to develop AI compatible completely.
This means if I want to edit AI’s shape completely, both implementation Element and SDF are needed, right?
I’m not tried apply SDF/Cos API yet, but I would and tell you the result.

2016년 6월 11일 토요일 오전 3시 47분 38초 UTC+9, Support 님의 말:

Adobe Illustrator (AI) files are similar to PDF and in some cases could be identical.

But often the app stores a separate working version of page content under PieceInfo dictionary (in the Page dictionary). So if you are using ElementEdit appoach you are only modifying the “Preview” part of the AI file.

You can use free version of CosEdit (https://www.pdftron.com/pdfcosedit/downloads.html) to explore AI files.

For more info about PieceInfo dict see PDF spec (Section 14,5; http://xodo.com/view/#/c0c11968-ee14-478e-9b09-6dc5635c0915)

For details re: contents of this dictionary you would need to refer to AI specifications.

A possible workaround may be simply to delete PieceInfo dict after your edit:

page.GetSDFObj().Erase(“PieceInfo”);

This way Illustrator should import PDF contant part of the file (not the possibly more rich AI version).

If this it not good enough, you could use SDF/Cos API to extract and modify contents of PieceInfo dict and all related AI structures (See http://www.pdftron.com/pdfnet/intro.html, http://www.pdftron.com/pdfnet/samplecode.html#SDF)

On Friday, June 10, 2016 at 9:02:33 AM UTC-7, (unknown) wrote:

I’m evaluating PDFNet SDK to develop Adobe Illustrator (AI) file format compatibility.

I tested this through the sample, “ElementEditTest”.
This sample works fine about pdf extension.
In the case of ai extension, it seems work fine.
But when I open edited ai file on Adobe Illustrator, the modified elements are not applied. This means there is no different between two ai files that original and edited one.

I could the see the modified elements when I open the edited ai file as pdf file.
Is this mean PDFNet SDK can not export ai file perfectly? or there is something that I missed.

Yes, correct.

Or you could drop the AI part and treat the file as PDF (erasing PieceInfo etc).