Copy link to clipboard
Copied
I'm trying to find a way to export a number of symbols as separate PNGs, at 300 dpi quality.
So far I've found a number of scripts that come close, but typically, they all export at 72 dpi and the options of those methods don't support resolution.
ExportType.PNG24 does support horizontalScale and verticalScale, and setting these to 400 is close, but not the same thing and just causes workflow bottlenecks in another place.
I've seen some scripts use imageCapture which does have an option for setting resolution, but these seem to also require getting the rectSize of the artwork to export. The rect size should be of that of the symbol, and I'm not sure how to pass that info.
I saw one script that used the artboard size, and as the symbols will never have their own artboard, that's just not going to work.
Any ideas?
Copy link to clipboard
Copied
As one of the possible variants of Illustrator script algorithm:
Copy link to clipboard
Copied
The idea of opening hundreds of PDFs in Photoshop isn't terribly appealing. I'm not sure what BridgeTalk is (I've never used Bridge), but maybe you're proposing a second layer of automation.
But as it turns out, Google Docs doesn't seem to know the difference between resolution and size, so the whole thing is moot anyway. Since it incorrectly assumes all images are at screen resolution, and there's no way to specify a specific numeric size, using 400% size works the same. At least while I'm using Google Docs.
Copy link to clipboard
Copied
The actual percentage for 300 ppi equivalence is 416.67.
Copy link to clipboard
Copied
You can just use the symbol's bounds for imageCapture.
Copy link to clipboard
Copied
Silly-V, thanks! In fact, this way is most short, simple and compatible!
(function captureSymbols() {
var d = activeDocument,
pth = d.fullName + '',
opts = new ImageCaptureOptions();
opts.resolution = 300;
opts.antialiasing = true;
opts.transparency = true;
for (var i = 0; i < d.symbolItems.length; i++) {
try {
var symb = d.symbolItems;
symb.selected = true;
symb.selected = false;
d.imageCapture(
new File(pth.slice(0, pth.lastIndexOf('.')) + '_' + i + '.png'),
symb.geometricBounds,
opts
);
} catch (e) {
}
}
}());
Copy link to clipboard
Copied
Cool, do you have to be selecting and deselecting the symbol, or is that just for a visual aid or something?
Copy link to clipboard
Copied
Oh! I think this is the rudiment of the other versions of the script, when I tried different export options.
By the way, for some reason, png-files, which are the result of saving pdf through Photoshop have a very large size.
Although Photoshop saves PNG files much faster than Illustrator.
Copy link to clipboard
Copied
Hello team,
There is a super simple way.... š
....You're welcome!