Peter Moore
(2 comments, 39 posts)
This user hasn't shared any profile information
Home page: http://www.pmlmedia.co.uk
Posts by Peter Moore
How to force download a PDF file instead of view in the browser
0Been having problems with my work computer when viewing PDFs in the browser - takes far too long to start up Adobe Reader on my machine. I found this snippet of code to force download the PDF instead.
Upload the file you want to make available for download from your Website. For example, huge_document.pdf
Edit a new PHP file and name it the same as your file to be downloaded, only with the extension .php. For example: huge_document.php
Your PHP file should look like this:
<?php
header(‘Content-disposition: attachment; filename=huge_document.pdf’);
header(‘Content-type: application/pdf’);
readfile(‘huge_document.pdf’);
?>
Link to your PHP file as a download link. For example:
<a href=”huge_document.php”>Download my huge document (PDF)</a>
To change the MIME type of the file you want to download, edit line 3
header(‘Content-type: application/pdf’);
Periodic Table of Typefaces
0http://www.squidspot.com/Periodic_Table_of_Typefaces/Periodic_Table_of_Typefaces_large.jpg
Typefaces set out in a periodic table showing some of the more popular typefaces at the top. there’s also a periodic table of the internet, and a periodic table of visulisations but it’s getting a bit silly now.
Created by squidspot.com
Create a robots.txt file for your website
0After you’ve created an xml sitemap, create a new text file in notepad and add the following to guide the google bot to your sitmap. this robots file also disallows the indexing of paths to the pdf and word docs on your site as well – this helps stop out of date links appearing in Google.
User-agent: *
disallow: /*.pdf$
disallow: /*.DOC$
User-agent: Googlebot
disallow: /*.pdf$
disallow: /*.DOC$
SITEMAP: http://www.domainname.co.uk/sitemap.xml
Create a knockout gradient layer in Photoshop CS3
0You might want to create a fade to transparency effect on one part of your image like this….
Easiest way to do this is to use the Advanced Blending options on a layer placed directly above the image you want to knock-out.
1/ Place you image on a new layer or double click on the background layer to turn it into a proper layer
2/ Insert a new blank layer above your image -(you can just click the ‘create a new layer’ icon next to the dustbin at the foot of the layers pallet) and rename it ‘knock out gradient’. keep the knockout gradient layer selected
3/ Select the gradient tool, if necessary click the linear gradient button and select the default foreground and background colours(to set foreground to black and background to white)
4/ Click the arrow to the right of the gradient display in the options bar to open the gradient picker, then choose the ‘foreground to transparent’ gradient (by default, this is usually the second gradient in the gradient pallet)
5/ Click, shift and drag from the bottom of the image to the mid point, to create a gradient to go from black at the bottom of the image to transparent at the top.
6/ In the layers pallet, click Layers style ‘Fx’ option and choose blending options (double clicking the layer also brings up the layer style options)
7/ In the advanced blending panel, drag the ‘fill opacity’ slider to zero percent. Change the knockout drop down from ‘none’ to ‘deep’. (note: ‘deep’ knocks out to the background, choose ‘shallow’ to knock out just the layer below
8/ click OK to apply the blending options
Reduce Spam by encoding your email address and mailto: links on your website
0This website allows you to convert email addresses into an encoded form suitable for inclusion on a web site. Simply add email.js to your site’s top-level javascript folder, remember to call the file email.js
Next you need to call the script in the head of your page with this line of code…
<script src="/scripts/email.js"></script>
Then encode your email address with this automatic encoder and use the encoded link code rather than your usual mailto: link.
-pete

