Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Save single-page Safari-generated PDFs Web Browsers
Saving a web page as a PDF in Safari is a pain. Unless the page is really small, you're going to end up with multi-page PDFs, and they're even going to be scaled down to match the width of your paper size. Without getting into the why, here is how to take a single-page PDF snapshot of a web page:
  1. Set up a really freaking big custom paper size:
    • Hit Cmd-Shift-P to bring up the Page Setup panel.
    • Select Custom Paper Size from the Settings drop-down menu.
    • Create a new paper size with obscenely large dimensions (something on the scale of 99"x99").
    • Select Page Attributes from the Settings drop-down menu.
    • Select your new paper size from the Paper Size drop-down menu.
  2. Save your web page as a PDF:
    • Hit Cmd-P to bring up the Print panel.
    • Click the Save as PDF... button.
    • Specify a n/s/l for the file and click Save.
  3. Crop the image:
    • Open the resulting PDF in Preview.
    • Click the Select Tool icon in the toolbar (or the Crop Tool icon if it is there and save yourself some keystrokes).
    • Select only the part of the PDF that you want to save.
    • Hit Cmd-K to Crop the image.
    • Hit Cmd-S to Save the image.
And you're done!

[robg adds: A couple other things to consider. One, if you do a lot of this stuff, get SnapWeb. It's $15.00 (or $30.00 for commercial use), but it uses Safari's rendering engine and makes it simple to save a web snapshot without any page breaks. Second, when I was testing this, I had troubles if I increased the page width -- sites that have infinite-width tables would render on the printed output as super wide. Instead, I just changed the page length and left the width alone.]
    •    
  • Currently 2.17 / 5
  You rated: 4 / 5 (6 votes cast)
 
[17,038 views]  

Save single-page Safari-generated PDFs | 8 comments | Create New Account
Click here to return to the 'Save single-page Safari-generated PDFs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Regarding a previous hint involving webpage saving and applescript...
Authored by: kafka007 on Nov 26, '03 02:37:16PM
While this isn't directly related to the above hint, I believe it is relevant to those of us that are still searching for an easy way to archive favorite webpages (since Safari lacks a IE-type scrapbook):

I've been trying to automate pasting selected content from Safari to TexEdit (See this hint from a few days ago) with an applescript.

Unfortunately, I don't know diddly about scripting and could use some help.

Here's what I have so far:

tell application "Safari"
        activate
        set t to name of window 1
end tell
set the clipboard to ""
tell application "System Events"
        tell process "Safari"
                click menu item "Select All" of menu "Edit" of menu bar 1
                click menu item "Copy" of menu "Edit" of menu bar 1
        end tell
end tell
tell application "Safari"
        activate
        set t to name of window 1
end tell

tell application "TextEdit"
        activate
        make new document at the beginning of documents
        set name of window 1 to t
end tell

tell application "System Events"
        tell process "TextEdit"
                click menu item "Paste" of menu "Edit" of menu bar 1
                click menu item "Save" of menu "File" of menu bar 1
        end tell
end tell

Now, obviously, this does not quite work as intended. It does select the contents of the page in Safari, copies and then pastes it into a new document in TextEdit.

What I'd like it to do is this: After the paste into TextEdit, automatically have the file named after the window in Safari and saved in a specific folder (for example, "~/Users/MyName/Documents/Web Snapshots/"

At this point, I give up. But I would love to use this while in Safari to archive articles without any fuss. Can anybody lend a hand with this little project?

I also thought others might be interested in using this, too -- once it's finished!

Thanks (again) for your time!

[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: alajuela on Nov 26, '03 03:02:34PM

Man oh man, would I love a replacement for IE's scrapbook. Neither mailing pages to myself, nor saving them as PDFs, comes close to the convenience of a scrapbook. I'm not much of a scripter either, but I'm happy to try and bang on this.



[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: qallunaaq on Nov 26, '03 03:37:05PM

I use MacJournal (freeware) for archiving selected text or entire web pages (complete with images and working urls) in Safari. MacJournal shows up in the Services menu so it's a simple matter to select/Select All and create a new entry. MacJournal may not have all the html bells and whistles but it's stable, v. useful and the price is right.



[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: kafka007 on Nov 26, '03 10:01:25PM
I agree -- MacJournal is an excellent app and I recommend it highly. One thing though: when pasting into it from Safari using the Services menu (as mentioned above), it doesn't automatically list the title of the webpage as an entry (unless I'm missing something). Perhaps the developer of MacJournal could be kindly coerced into adding this feature so it could double as a kind of IE-type scrapbook ;)

Personally, I'm looking for a single-click solution from my selection in Safari straight to a saved file in a default destination folder (such as ~users/myname/documents/web archive/) -- complete with the original webpage title as filename and including clickable links.

If only Applescript wasn't so damn difficult to pick up! Aargh!!

[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: Tim_Cox on Nov 28, '03 11:06:59AM
Good start. Thanks! Here's the basic addition you ask for. I'm sure you can polish it. Remove the click 'Save' at the end of your script and add:

property theUserFolder : "Documents:Web Snapshots:" -- You must create it before running script

tell application "Finder"
	set thePath to path to "cusr" from user domain -- returns an alias
	set theReceiver to (thePath as string) & theUserFolder & (t as string) & ".rtfd"
end tell
tell application "TextEdit"
	save document 1 in theReceiver
end tell


[ Reply to This | # ]
Save single-page Safari-generated PDFs
Authored by: alajuela on Nov 26, '03 03:21:52PM

Rob: Is there any way to use SnapWeb as a printer engine for saving transactional web pages? For example, I can use Safari-Save-As-PDF to save order records, surveys etc. Typically, those are dynamically generated web pages. SW looks like it requires you to input a web address, which it can then take a picture of. It's nice, but that won't work with the dynamically-driven sites or transactions, unless I am missing something.



[ Reply to This | # ]
Save single-page Safari-generated PDFs
Authored by: vdubya on Nov 26, '03 06:22:45PM

Instead of saving the PDF, then opening and cropping, I think this might be a quicker way to do it:

Set up the page size etc as the original hint (great hint btw) stated. Select print to bring up the dialog, and then click the PREVIEW button. Using the SELECT tool in Preview, select the entire image (you can hit 'Shrink To Fit' to make this a quick task). Then under the 'File' menu in Preview, just select 'New From Clipboard'. You now have the selection in a new Preview (unsaved) file which you can print, edit, or save as you wish.



[ Reply to This | # ]
Alternatively use WebCapture with Acrobat
Authored by: hamarkus on Nov 27, '03 06:52:42AM

I know this will not be much help to all those not owning Acrobat (6.0 Professional) but if you can you should try out the WebCapture feature in Acrobat. Similarly here, to reduce the number of pages produced, set the paper size big enough.



[ Reply to This | # ]