Sorry to be speaking different languages (XMLUI, JSPUI), but I've been
using XMLUI much more frequently, and so my brain is already primed.

For our local repository, we built what I call a PDF "disseminator".
Instead of getting the original PDF, you get modified PDF with an
on-the-fly coverpage generated.
https://github.com/osulibraries/DSpace/blob/osukb/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/BitstreamReader.java#L315

This won't as-is work in your situation, since for you one PDF corresponds
to a bunch of PNGs, my route basically just intercepted the bits, and gives
you different bits.

Following the OAIS reference model:
- Submission (SIP) - Take in the originally submitted PDF
- Archive (AIP) - Store the original PDF in asset store
- Disseminate (DIP) - Generate a new on-the-fly PDF with cover page

For you,
- Disseminate (DIP) - Generate a sequence of PNGs and have a viewer to
order them.


I don't have the solution just yet, I'd need to draw on lots of
white-boards. But my initial-pass might be:
Build some servlet that listens to a URL /pdf2png/12345.pdf, and return
meta-info about PNGs.
Maybe that runs some pdf2png code, and returns data like: pageCount=15, and
url's to the pngs. /pdf2png/12345.pdf/1.png, /pdf2png/12345.pdf/2.png, ...

ItemTag.listBitstreams()
https://github.com/DSpace/DSpace/blob/master/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemTag.java#L754

In addition to providing the link to the full PDF, you then spit out img
tags to all of the PNGs. When the browser tries to load
/pdf2png/12345.pdf/1.png, pdf2png will then do the work to generate the
image.




Peter Dietz


On Mon, Jun 10, 2013 at 12:26 PM, David <[email protected]> wrote:

> Hi Peter, thank you for your answer!
>
> The Google and @mire solutions are pretty much out of the question.
> Google because of copyright problems and @mire because it doesn't comply
> with the client's specifications (flash is a no no).
>
> I agree with you, making a new bundle to store the previews is tricky
> and very likely unnecessary I was just following (or trying to follow)
> the media filter's patterns.
>
> In any case. I am developing over (the client was already using when
> they hired me) a fairly modified version of the jspui and the
> BitstreamReader is from the xmlui. What is it's jspui equivalent?
> BitstreamServlet maybe?
>
> I was thinking. Maybe the best idea is to modify the HandleServlet and
> add there the code to make the dissemination (if the bitstream is not
> already in the specified format) and then have the item viewer request
> for the images. Do you think it's a good idea?
>
> Thanks for your help!
>
> On Mon, 2013-06-10 at 10:45 -0400, Peter Dietz wrote:
> > Hi David,
> >
> >
> > Ultimately you want document preview for PDF.
> >
> >
> > You can take a look at one approach, using Google Docs Previewer. It
> > embeds an iframe on your page that makes Google Docs produce
> > images/pages from the URL of your PDF.
> > https://wiki.duraspace.org/display/DSPACE/Document+Preview+with+Google
> > +Docs+viewer
> >
> >
> >
> >
> >
> > You can take a look at a module from @mire that does exactly this:
> > (module) http://atmire.com/website/?q=modules/ds
> > (demo)
> >
> http://atmire.com/dspace-labs3/pdfpreview/bitstream/handle/123456789/7624/Document%20Streaming.doc?sequence=1
> >
> >
> >
> >
> >
> > Another interesting concept that I've heard of is Brasiliana's Corisco
> > DSpace. They have an interceptor/disseminator for PDFs that do some
> > rendering.
> >
> https://github.com/brasiliana/Corisco/blob/master/docs/CoriscoDiagram.png
> >
> >
> >
> >
> >
> > Here's a link to a previous dspace-tech discussion on
> > this:
> http://dspace.2283337.n4.nabble.com/Dspace-tech-anyone-coding-document-streaming-for-DSpace-on-their-own-td3277721.html
> >
> >
> >
> >
> > If I had to approach this project from scratch, I don't think I would
> > store the dissemination renditions of the PDF (the JPEGS) into your
> > repository. Messing with a new bundle for previews is tricky. I would
> > customize the BitstreamReader to add a dissemination so that the PDF
> > could be converted to PNG. Then have the ItemViewer request all the
> > PNG-dissemination for the PDF, instead of the PDF itself. Then you
> > could plop in a PNG-viewer/gallery/page-turner. The generated PNG's
> > wouldn't be stored in your DSpace assetstore, but in a temp directory,
> > or just generated on the fly.
> >
> >
> >
> > Peter Dietz
> >
> >
> >
> > On Mon, Jun 10, 2013 at 10:04 AM, David <[email protected]>
> > wrote:
> >         Hello there list! My name is David and I'm from Argentina.
> >
> >         I am quite new with Dspace (and java) development and I am
> >         failing to
> >         find a solution for my problem.
> >
> >         My client (a library) wants to show pdf files embedded
> >         directly in the
> >         page of the item detail "display-item.jsp". I tried several
> >         aproaches
> >         but non where 100% efective.
> >
> >         I tried:
> >             a. Embbeding the pdf in the page using PDF.js but the
> >         script doesn't
> >         work perfectly in IE and Chrome, some (few) files fail to
> >         load.
> >             b. Embedding the pdf with a reader made with flash.
> >         Converting the
> >         pdf to swf with a custom filter made with pdf2swf. But my
> >         client is not
> >         convinced by flash. He wants something that works with firefox
> >         in unix
> >         as well and flash is certainly dying as a linux/unix friendly
> >         technology.
> >
> >         So now I had the idea of converting the pdf file to a
> >         collection of pngs
> >         (using pdftoppm) and show the pngs in a custom javascript
> >         "gallery". But
> >         I am not sure if and how can I convert one Bitstream (the pdf
> >         file) to a
> >         collection of Bitstreams (the images) and save them to a
> >         bundle. I
> >         looked at the documentation but it kind of assumes that one
> >         wants a 1:1
> >         conversion. And Google returned nothing.
> >
> >         If someone could help me or give me a trail to follow I would
> >         be very
> >         thankful and of course whatever I end up making I will publish
> >         it in my
> >         git account for the public
> >
> >         I am developing in dspace 1.8.2 (client is already using this
> >         version
> >         and, by now, refuses to upgrade)
> >
> >         Thanks in advance!.
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> >         How ServiceNow helps IT people transform IT departments:
> >         1. A cloud service to automate IT design, transition and
> >         operations
> >         2. Dashboards that offer high-level views of enterprise
> >         services
> >         3. A single system of record for all IT processes
> >         http://p.sf.net/sfu/servicenow-d2d-j
> >         _______________________________________________
> >         DSpace-tech mailing list
> >         [email protected]
> >         https://lists.sourceforge.net/lists/listinfo/dspace-tech
> >         List Etiquette:
> >         https://wiki.duraspace.org/display/DSPACE/Mailing+List
> >         +Etiquette
> >
> >
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to