Q: I am developing pre-press software that must (among other things)
cut and paste PDF content (portions of PDF page, text and graphics)
from one document to another and from one page to another, and
possibly rearrenge some text; for example merge text boxes, rearrange
them in colums and so on. But the most important part is the ability
to cut a region of PDF text and paste it into another PDF document.
Can I do this using PDFNet? I have seen your pdf view sample and I
found it impressive.
A: Using PDFNet SDK (www.pdftron.com/net) you can add and delete
content from existing PDF pages. As a starting point you may want to
take a look at the following resources:
Placing new content on PDF page:
- Search for "stamp PDF" in PDFNet Knowledge Base:
Editing existing PDF pages (e.g. removing content or modifying
graphics attributes etc):
- Search for "ElementEdit" in PDFNet Knowledge Base.
In case you need to implement a fully interactive application similar
to Adobe Illustrator you have a couple of options:
- One option is to use PDFNet API for all of the rendering, editing,
and display list manipulation. Although this is a possibility it may
not be very intuitive to implement because PDF format was not designed
with highly dynamic editing operations in mind (such as automatic
layout reflow, simple text editing etc).
- Another option is to use a custom data structure to render and
edit the document view. In this scenario PDFNet could be used to
import PDF layers (e.g. using pdfdraw.GetBitmap() for the entire page
or using ElementReader to access individual objects) as well as for
final PDF document serialization (i.e. to generate the modified
document). The main advantage of this approach is that you would have
full control over the editing operations. In this case PDFNet would be
used only for import/export from the custom data structure.