Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • So you mount a PDF doc as a filesystem. I was wondering: what happens when you try to open such a PDF in Acrobat and try to print it out? :-)

    Oh, and yes, I would have put that under ACME... well, at least that first implementation. But if you come up with a clever mapping, so that when mounting a real PDF the text inside is available as .txt files and the graphic is available as .png or .jpg, this would really be a nifty way of editing PDFs...
    • So you mount a PDF doc as a filesystem. I was wondering: what happens when you try to open such a PDF in Acrobat and try to print it out? :-)

      Nothing unusual. The filesystem does not affect the rendering of the PDF in any way. It's as if the filesystem were in the comments of an HTML file -- it just makes the PDF bigger from the point of view of rendering.


      Oh, and yes, I would have put that under ACME... well, at least that first implementation. But if you come up with a clever mapping, so that when mountin

      • Oh, and yes, I would have put that under ACME... well, at least that first implementation. But if you come up with a clever mapping, so that when mounting a real PDF the text inside is available as .txt files and the graphic is available as .png or .jpg, this would really be a nifty way of editing PDFs...


        Hmm, that's a clever idea. But it would only work well for read-only. The PDF layout format is way too specialized to be able to round-trip as a text file. Unless you meant present the PDF rendering commands in a text file?
        Well, I was thinking more into the lines of quick-n-dirty PDF template munging. Create a PDF template with some dummy text and then simply mount it and replace the dummy text with something more appropriate. If this allows to replace a whole textbox full of text, perfect! Even if you could only replace lines of text it could be useful. Exchanging a picture with one of the same dimensions should work regardless, no?

        OK, mounting the PDF is probably mostly useful for steganography. But part of that could be a simple interface to traverse the PDF. Or does this already exist?
        • Since you came up with this idea, I've been thinking about it a lot. PDF has a VERY write-only syntax (Perl's ill-gotten reputation has nothing on PDF), but I think there are a few opportunities here. Keep an eye on this journal over the next couple of weeks. ;-)
          • Hmm, would it be possible to add a PDF to the end of a mounted PDF? I mean, if you store a PDF into a mounted PDF that it would be incorporated in a way that it would also be printed out if I print the mounted PDF?

            I'll keep an eye on you... ;o)
            • Hmm, like putting the extra PDF in a magic folder and make it auto-append to the existing PDF? That has a pretty awkward feel to me. Instead, you're probably better off using the appendpdf.pl [cpan.org] helper in the CAM::PDF distibution.
              • I'm aware that all those things can be better accomplished using PDF manipulation libs. I'm just brainstorming about somewhat useful (or lunatic) uses of a writeable mounted PDF from a PDF view and not from a filesystem view... ;o)

                Have a webserver serve a PDF and have that PDF mounted. Then in the crontab do

                fortune > /mounted-PDF/chunk0042.txt

                Insane? I hope so... ;-)
                • Fuse::PDF v0.05 is on its way to CPAN. Here's what it can do:

                  % mount_pdf -A test.pdf $PWD/mnt &
                   
                  % find mnt
                    mnt
                    mnt/pages
                    mnt/pages/1
                    mnt/pages/1/fonts
                    mnt/pages/1/fonts/TT0
                    mnt/pages/1/fonts/TT0/Subtype
                    mnt/pages/1/fonts/TT0/BaseFont
                    mnt/pages/1/fonts/TT0/FirstChar
                    mnt/pages/1/fonts/TT0/LastChar
                    mnt/pages/1/fonts/TT0/Type
                    mnt/pages/1/layout.txt
                    mnt/pages/1/text.txt
                    mnt/metadata
                    mnt/metadata/Creator