Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: Re: Clipping a page
Conf: (P-PDF) Developers, Msg: 56662
From: LeonardR
Date: 5/29/2002 05:20 PM

At 8:43 AM -0500 2/7/01, p-pdf-developer Listmanager wrote:
>Could some one let me now the best way
>to achecive the folowing steps by giving
>sample code or Acrobat SDK APIS
>to be used.

I am guessing the reason that no one is giving this to you on
a silver platter is that many of us have written this code as part of
commercial products, and it's pretty well integrated into those.
Also, you REALLY DO need to read the Acrobat SDK documentation AS
WELL AS the PDF specification if you are going to work with PDF files
- there isn't any getting around that no matter how much sample code
you get.

I'll break down each of the below a bit more for you so that
you should be able to find the API's call you'll need - BUT you will
STILL need to read the docs!


>step 1.Combine all content streams
>from the source page into a
>single content stream

Open the documents, acquire the source and destination pages,
create a new stream in the destination document, get the list of the
content from the source document, for each item in the content list,
copy the bytes.


>step 2. Write that stream out as a
>form XObject into the new
>document

Create a new Cos object from the stream and add the
appropriate dictionary entries.


>step 3. Copy the resources dict from
>the source page to the XObject

Get the Cos object from the source and then write it to the
destination.


>step 4. Loop through all pages of
>the destination document,
>adding a new content stream that renders
>the XObject.
>
Count the number of pages in the destination, for each one
create a content stream that renders the XObject ("Do" operator).



Leonard
--
----------------------------------------------------------------------------
Leonard Rosenthol
Sr. Software Engineer (215) 922-3509 (voice)
Digital Applications (215) 440-0504 (fax)

PGP Fingerprint: 8CC9 8878 921E C627 0BC1 15BB FC19 64A9 0016 1397



PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.