hi, all
I have a big problem here.
I have a 598 pages' PDF document and a logo image (jpg), now, i wanna import this logo image file as a PDF layer and merge it to every page's layers in the PDF document, the desired result document should like this: each page in the PDF document has this logo image merged into it.
just like the following procedure:
?PDF logo?mergeResult
===+========+======+==================
P1?layers jpg?layers+jpg -%26gt; ONE layer
P2?layers jpg?layers+jpg -%26gt; ONE layer
P3?layers jpg?layers+jpg -%26gt; ONE layer
...
so, i consider using javascript in my acrobat pro 9.
What could i start with?
thanks in advance.
batch processing problem: merge eacg...Are there any doc objects or methods for handling PDF page layers?
thanks again.
batch processing problem: merge eacg...Look in the documentation for OCG (optional content groups).
I don't think it's possible to create a new OCG with JS.
Methods addWatermarkFromFile or addWatermarkFromText creates a new OCG.
Optional Content Groups
k, i have seen a section about it in the acrobat js docs...
i'd like to try it out.
thanks for ur reply.
could watermark from file or text be merged into the page's layers?
for instance, in a certain page, there is a layer with doc content in it, now i want to add a logo image to the page, and merge the two objects (the doc content layer and the logo image layer) into just one layer.
okay, i would like try ur message out now.
thanks.
try {
?this.addWatermarkFromFile({
?cDIPath: ''/E/big.jpg'',
?nStart: 4, nEnd: 598,
?nHorizAlign: app.constants.align.left,
?nVertAlign: app.constants.align.top,
?nOpacity: 0.15
?});
} catch (e) { console.println(''Aborted: '' + e) }
----------------------------------------------------------------
I have successfully added a image watermark by using the above code. That is, now, the logo image is actually added to my document as a watermark.
BUT, how could i merge the watermark into each page's content?
Any clarifications would be appreciated. Thanks.
You can flatten the pages using
this.flattenPages();
Be aware that it will also flatten any annotations and form fields that you
have in the document.
Thanks for your reply.
I find some detailed instruction of this flattenPages() function in Acrobat Javascript Reference document, it reads as follows,
----------------------------------------------------------------
Converts all annotations in a page range to page contents. If a page range is not specified, all annotations in the document are converted.
Note:Great care must be used when using this method. All annotations閳ユ攰ncluding form fields, comments, and links閳ユ攼n the specified range of pages are flattened. They may have appearances, but they will no longer be annotations.
----------------------------------------------------------------
and, i have try this method as soon as your reply in my sight.
However, this operation could not merge the watermark and the page content. The logo image and the page content are still TWO seperate objects.
In a word, i just wanna convert any elements in the page into ONE. Exactly one.
Thanks so muck for reply above.
My hearty thanks for reply above.
However, I now basically aware that even after layers in a certain page are flattened into ONE, elements in the page are still seperated.
That's to say, not exactly one.
thanks again.
BTW: I run into another trouble, detailed description was posted in a new thread: http://forums.adobe.com/thread/457112 .
No comments:
Post a Comment