Save <div> as PDF automatically

Hi,

I wonder if there is an action that automatically saves a

(more specific, HTML or graphic object) or the entire webpage as PDF to a given folder, each time the site is generated ?

Or does this exceed the capabilities of FW actions ?


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I wonder if there is an action that automatically saves a

(more specific, HTML or graphic object) or the entire webpage as PDF to a given folder, each time the site is generated ?

Or does this exceed the capabilities of FW actions ?

It does. But all is not lost. Have a look at PrinceXML from YesLogic. http://princexml.com It works really, really well at translating HTML into PDF. It’s not free, or cheap, but it does this one trick with great aplomb and an utter lack of drama.

You will need to install it on your server, so depending on the sort of hosting plan you have, it might not work for you. I use it on the Online Library of Liberty, and it has turned a several month project of converting the entire library to PDF (through a browser, muttering darkly) into a 3 hour un-manned process.

Walter


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you, I’ll have a look at PrinceXML. Since we run our own XServe, it should be no matter to get it installed there. However the license fee is… well, outstanding (to say it in a positive way :wink:

Would it be possible using an action to copy the content of a

on one page into a
of an other page ? In this way we could realize a printer-friendly layout, which was my intention as I asked about PDF ?


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Tobias,

I’m not siure if this is exactly what you’re looking for but it could
be close:

Joe

On 5 Nov 2008, at 08:51, tobiaseichner wrote:

Thank you, I’ll have a look at PrinceXML. Since we run our own
XServe, it should be no matter to get it installed there. However
the license fee is… well, outstanding (to say it in a positive
way :wink:

Would it be possible using an action to copy the content of a


on one page into a
of an other page ? In this way we could
realize a printer-friendly layout, which was my intention as I asked
about PDF ?


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you, I’ll have a look at PrinceXML. Since we run our own XServe, it should be no matter to get it installed there. However the license fee is… well, outstanding (to say it in a positive way :wink:

Would it be possible using an action to copy the content of a

on one page into a
of an other page ? In this way we could realize a printer-friendly layout, which was my intention as I asked about PDF ?

Prince is incredibly configurable, and since it is all configured using CSS, I can tell you that pretty much anything you can imagine is possible.

What I would do to get this effect you want is to create a separate stylesheet just for Prince to follow, and in that stylesheet you could set everything on the page to display:none, then set your desired DIV to display:block. You could also do some additional tricks with the @page selector. I use it for some very tricky stuff, like headers and footers and automatic page numbers.

You shouldn’t need to pluck out a DIV from the rest of the page, that’s one of the many things CSS is for.

body * { display: none; }
#someDiv { 
    display: block; 
    position:absolute;
    width: 14cm;
    top: 2cm;
    left: 2cm;
    color: #000;
    font-size: 14pt;
}

When you pass a page to Prince for conversion, you can specify the stylesheet you want to use in the command-line. There will be some things you can’t override using this system, due to the way that Freeway codes some of the style information inline, but you might be able to override stubborn properties using the !important declaration.

You’ll want to use a dedicated CSS editor for this part of the task – I recommend CSSEdit from MacRabbit for this.

Walter


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If all you want to do is make one element on your page go “solo” when it is printed by the visitor’s browser, then try this little hack:

First, click on the element you DO want to appear (and this element needs to be a Layer for this trick to work, by the way) and note in the Inspector the name that Freeway has given it (maybe even edit that name to be something less arbitrary).

Next, in the Page > HTML Markup (Before /head section) dialog, add this (adjust the ID–item3 in this example–to match the name of the element you want to have appear):

<style type="text/css">
    @media print { 
        body * { display:none; } 
        #item3 { display:block; }
    }
</style>

If you wanted to make more than one DIV appear when the page is printed, then you can either add additional copies of the second rule (the one that starts with #item3 above), or you can make the rule read like this:

#item3, #item4, #item12 { display:block; }

…which will have the same effect.

Walter


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options