Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • PortuguĂȘs
  • æ—„æœŹèȘžă‚łăƒŸăƒ„ニティ
  • 한ꔭ ì»€ëź€ë‹ˆí‹°
0

default resolution when exporting as png

New Here ,
Jul 26, 2015 Jul 26, 2015

Hi

We are using cc2014 and cc2015 and both have not a way for setting PNG export resolution. We must rely on a previous export by the user. If not set, it takes a long time to export ununusable 112bytes PNG files!

Any way to avoid that?

Thanks

Christian

TOPICS
SDK
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Aug 24, 2015 Aug 24, 2015

Hi,

Which method of which suite are you actually using for making your export?

There is definitely a way to set resolution parameter depending on how you do that.

Best regards,

Thomas.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2015 Aug 24, 2015

Hi

Here is my code:

err = sAIActionManager->AINewActionParamValue(&fActionParamValueRef);

//ne doit pas ĂȘtre null,

https://forums.adobe.com/thread/915571?start=0&tstart=0

err =

sAIActionManager->AIActionSetStringUS(fActionParamValueRef,

kAIExportDocumentNameKey, ai::UnicodeString(exportPath));

err =

sAIActionManager->AIActionSetStringUS(fActionParamValueRef,

kAIExportDocumentFormatKey, ai::UnicodeString("Adobe PNG Format"));

err = sAIActionManager->AIActionSetString(fActionParamValueRef,

kAIExportDocumentExtensionKey, "png");

err =

sAIActionManager->AIActionSetBoolean(fActionParamValueRef,

kAIExportDocumentSaveAllKey, false);

err =

sAIActionManager->AIActionSetBoolean(fActionParamValueRef,

kAIExportDocumentSaveMultipleArtboardsKey, true);

err = sAIActionManager->AIActionSetString(fActionParamValueRef,

kAIExportDocumentSaveRangeKey, range);

err =

sAIActionManager->AIActionSetBoolean(fActionParamValueRef,

kAIPDFRoundTripKey, false);

err =

sAIActionManager->PlayActionEvent(kAIExportDocumentAction, kDialogOff,

fActionParamValueRef);

Without a proper manual initialisation by exporting a PNG (and

correcting default values), exporting fails.

The same is true with a fresh installation of Illustrator.

Thank you for your help

cb

Le 24/08/2015 11:35, Toto RoToTO a écrit :

>

default resolution when exporting as png

created by Toto RoToTO <https://forums.adobe.com/people/Toto+RoToTO>

in /Illustrator SDK/ - View the full discussion

<https://forums.adobe.com/message/7892014#7892014>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 27, 2015 Aug 27, 2015

Have you had a look at AIImageOptimization.h, which includes AIImageOptSuite::AsPNG and AIImageOptSuite::MakePNG24. I haven't used them myself, but they include arguments for setting parameters like resolution.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 27, 2015 Aug 27, 2015

I have heard of this suite but I think it is note related to the export actions.

Do I have to rewrite the export code?

cb

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 27, 2015 Aug 27, 2015

As leoTaro said, you should definitely take a look at AIImageOptimization.h and use MakePNG24 method.

Take a look at AIImageOptPNGParams2 and AIImageOptPNGParams structs, which are used by MakePNG24.

This way you could set the image resolution

AIErr result = kNoErr;

AIDataFilter* dstFilter = 0;

AIDataFilter* filter = 0;

......

result = sAIDataFilter->NewFileDataFilter(fileP, "write", 'prw', 'PNGf', &filter);

aisdk::check_ai_error(result);

result = sAIDataFilter->LinkDataFilter(dstFilter, filter);

aisdk::check_ai_error(result);

dstFilter = filter;

AIImageOptPNGParams2 params;

params.versionOneSuiteParams.interlaced = ...;

params.versionOneSuiteParams.numberOfColors = ....;

params.versionOneSuiteParams.transparentIndex = ...;

params.versionOneSuiteParams.resolution = 300;

params.versionOneSuiteParams.outAlpha = ...;

params.antialias = ConfigurationManager::GetAntialias();

/* A cropping box for the art. If empty or degenerate, do not crop. */

params.cropBox = bounds;

params.backgroundIsTransparent = ConfigurationManager::GetBackgroundIsTransparentProperty();


result = sAIImageOpt->MakePNG24 (art, dstFilter, params, MyRasterizeProgressProc);

aisdk::check_ai_error(result);


....


if (dstFilter)

{

  result = sAIDataFilter->UnlinkDataFilter (dstFilter, &dstFilter);

  aisdk::check_ai_error(result);

}

I hope this will be helpful.

Thomas.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 01, 2015 Sep 01, 2015

So, is it working?

Did you use MakePNG24 ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2015 Sep 01, 2015
LATEST

I was on another project, i'll try this afternoon (Paris time).

Thanks

Christian Brugeron

christian@docinfo.fr

Le 01/09/2015 10:43, Toto RoToTO a écrit :

>

default resolution when exporting as png

created by Toto RoToTO <https://forums.adobe.com/people/Toto+RoToTO>

in /Illustrator SDK/ - View the full discussion

<https://forums.adobe.com/message/7918383#7918383>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines