#25 Access to stream arrays

closed-fixed
nobody
None
5
2007-10-16
2007-10-03
Jeremias Märki
No

In Apache FOP I recently developed experimental support for embedding existing PDFs in XSL-FO documents destined for PDF output as normal fo:external-graphic elements. I used PDFBox to parse the PDFs since FOP's PDF library doesn't support parsing. I wrote some adapter code that translates PDFBox's object model into FOP's.

While doing that I stumbled over the problem that I couldn't access the individual streams in a stream array. Therefore I added accessors for that. Please find these in the patch file. I'd be grateful if they could be added to PDFBox.

During my work I changed from the scratch file to a RandomAccessBuffer in PDStream's constructor. Since it was before my holidays I don't remember exactly why I did that. I think I had a case where more than one scratch file was needed. But I can't reproduce it anymore. That may just be something to think about. I'll re-raise this if I can reproduce the problem.

Thanks,
Jeremias Maerki

Discussion

  • Ben Litchfield
    Ben Litchfield
    2007-10-16

    • status: open --> closed-fixed
     
  • Ben Litchfield
    Ben Litchfield
    2007-10-16

    Logged In: YES
    user_id=601708
    Originator: NO

    Patch is applied. Currently there is a limitation where you can one be writing to one stream per scratch file at a time. So right now you can't

    1)Start a content stream
    2)Add a image/font/... stream
    3)End the content stream

    Maybe that is what you were running into.

    Ben