如何使用actionscript在Photoshop中生成图形?
我有一个包含如下内容的文本文件:
id, pixelsize, color, text
block1, 200x60, black, Header
block2, 200x180, white, Body
block2, 200x60, black, Footer
现在使用actionscript,
我想生成一个psd文件,该文件将生成3个垂直块图形(像这样)解析给定文件后。所有块都垂直放置在彼此的顶部。
使用脚本自动将此 psd 文件转换为 PDF。
自动化整个过程,无需打开 Photoshop。这可能吗?
请帮忙。谢谢。
I've a text file with content like this:
id, pixelsize, color, text
block1, 200x60, black, Header
block2, 200x180, white, Body
block2, 200x60, black, Footer
Now using actionscript,
I want to generate a psd file which would generate a 3 vertical block graphics (like this) after parsing the given file. All the blocks are placed vertically on top of each other.
Convert this psd file into PDF automatically using the script.
Automate this whole process without opening photoshop. Is it possible?
Please help. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不打开 Photoshop,您将无法创建 PSD。即使您使用 Adobe Bridge 之类的工具来批处理来自任何 Adobe 应用程序的文件,它仍然使用适当的应用程序来打开受支持的文件并对其执行操作。
我见过一些应用程序允许您从用户定义的文本和可变图像输出 PDF(我想到了 PageFlex)...但即便如此,保存 Adobe 兼容文件也不是关闭和打开的简单任务(就像当您一个文本文件)。即使使用 PDF,也需要管理大量数据,而当您查看 PSD 文件时,我怀疑更多数据。
除非你能找到一个开源应用程序,以某种方式允许你扰乱其编码,以便你可以绕过 100% 打开它来输出某种程度上兼容的 PSD/PDF 文件,否则我认为你无法自动化不需要大量工作和一些可能昂贵的软件解决方案。
长答案短,我认为你必须在解决方案中的某个时刻使用 Photoshop。从好的方面来说,您可以在 PS 中记录操作,以便可以将单个文件输出为您喜欢的任何格式……而且我确信这些文件可以编写成复杂的解决方案。
You aren't going to be able to create a PSD w/o opening Photoshop. Even when you use something like Adobe Bridge to batch process files from any Adobe app it still uses the appropriate app to open a supported file and perform actions on it.
I have seen apps that allow you to output PDFs from user defined text and variable images (PageFlex comes to mind)...but even then, saving Adobe-compatible files aren't simple tasks to turn off and on (like when you make a text file). There's a lot of data to manage even with PDFs and I'd suspect even more when you look at a PSD file.
Unless you can find an open-source app that somehow allows you mess with its coding so that you can bypass opening it 100% to output a somewhat compatible PSD/PDF file, I don't think you're going to be able to automate much w/o lots of work and some potentially expensive software solutions.
Long answer short, I think you'll have to use Photoshop at some point in your solution. On the upside, you could make a recording of actions in PS so that individual files can be output to whatever format you like...and those I'm sure can be scripted into complicated solutions.
您可以使用 ExtendScript Toolkit< /a> 来自 Adobe。
不过,不确定是否可以在不打开 Photoshop 的情况下完成此操作。
You can do this kind of thing using the ExtendScript Toolkit from Adobe.
Not sure you can do it without having Photoshop open, however.
鉴于您最后想要一个 PDF,您可以使用类似 AlivePDF (ActionScript 3 开源 PDF图书馆)?
如果您实际上还需要生成 PSD,我不确定您如何从头开始执行此操作,但是 Photoshop SDK 将是一个很好的起点,并且可以很好地理解 字节数组。
Given that you want a PDF at the end, could you use something like AlivePDF (ActionScript 3 Open-Source PDF Library)?
If you actually need to also generate a PSD, I'm not sure how you do that from scratch, but the Photoshop SDK would be a good place to start, as well as getting a good understanding of bytearrays.