开发者

Print Adobe Illustrator documents

I have one file called test.ai and I need to print it several times, but changing the text inside it each time.

Added the illustrator reference to the project and it is already changing the text inside the image, my pr开发者_StackOverflowoblem is to stack up several of these documents and send them to a printer or to the printing dialog.

Here is the code to open the file

//open AI, init
Illustrator.Application illuApp = new Illustrator.Application();

// open doc
Illustrator.Document illuDoc = illuApp.Open("C:\\myai.ai", Illustrator.AiDocumentColorSpace.aiDocumentRGBColor, null);

there is this illuDoc.PrintOut function, it takes one option object as parameter, but I can't seem to find the documentation about it. And don't know if it could help in my situation.

How could I achieve this?

Thanks!

Jonathan


According to the documentation I find here (I assume this is the library that you're using?), the PrintOut function takes PrintOptions as an argument.

PrintOptions collects all information about all printing options including flattening, color management, coordinates, fonts, and paper. Used as an argument to the PrintOut method.  (page 184)

You should be able to set up a loop in your code with the number of iterations equal to the number of documents that you want printed, and in the body of that loop, make the change to the text of the document and call the PrintOut function for that document with the appropriate PrintOptions parameters.


Your best bet is to avoid any AI references for direct printing. The storage format for an AI file is nearly identical to a PDF (make a copy and change the extension from .ai to .pdf and be amazed). This opens the door to using any pdf printing method for your Illustrator file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜