<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#TR+Postscript+to+PNG'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:name>TR Postscript to PNG</s:name>
        <s:content>\\&#xD;&#xA;&#xD;&#xA;How to convert Postscript or PDF images into PNG format.&#xD;&#xA;&#xD;&#xA;1.1 Artwork&#xD;&#xA;&#xD;&#xA;For artwork that is transparent in undrawn-upon areas:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;gs -dSAFTER -dBATCH -dNOPAUSE -sDEVICE=pngalpha \\\&#xD;&#xA;-dBackgroundColor=&apos;16#ffeebb&apos; \\\&#xD;&#xA;-sOutputFile=~~output~~.png ~~input.eps~~&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;The __-BackgroundColor=&apos;16#ffeebb&apos;__ option sets the fall-back background color in the resulting PNG image to match the background color of the Community Projects site. This is needed by browsers that don&apos;t properly support PNG alpha transparency, (i.e., Internet Explorer), which will otherwise render the image horribly.&#xD;&#xA;&#xD;&#xA;If the page size isn&apos;t specified in the document that you&apos;re converting, you may need to set it manually by adding the options&#xD;&#xA;__-dDEVICEWIDTHPOINTS=~~w~~ -dDEVICEHEIGHTPOINTS=~~h~~__; otherwise, your resulting PNG file may be the size of a default sheet, typically U.S. letter.&#xD;&#xA;If your input document is in EPS format, the __-dEPSCrop__ option will set the correct size automatically.  Otherwise, the correct values for ~~w~~ and ~~h~~ can often be determined from the bounding-box comments in the input document, which can be retrieved as follows:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;gs -dSAFTER -dBATCH -dNOPAUSE -sDEVICE=bbox ~~input.ps~~&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then just pick out the right and bottom coordinates from the output:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;%%BoundingBox: 8 13 __487 499__&#xD;&#xA;%%HiResBoundingBox: 8.424000 13.626000 486.953985 498.559968&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;In this example, ~~w~~=487 and ~~h~~=499.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Ref: http://www.cs.wisc.edu/~ghost/doc/cvs/Devices.htm#PNG&#xD;&#xA;&#xD;&#xA;1.1 Thumbnails of PDF-based presentations&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;gs -dSAFTER -dBATCH -dNOPAUSE -sDEVICE=png16m \\\&#xD;&#xA;-dGraphicsAlphaBits=4 -dTextAlphaBits=4 \\\&#xD;&#xA;-dBackgroundColor=&apos;16#ffeebb&apos; -r45 \\\&#xD;&#xA;-sOutputFile=LectroTestTalk-%02d.png \\\&#xD;&#xA;-dFirstPage=1 -dLastPage=1 ../pgh-pm-talk-lectrotest.pdf&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;The __-r45__ flag tells ghostscript to use a 45-ppi rendering resolution.</s:content>
        <s:mTime>2007-10-03 21:51:41.187</s:mTime>
        <s:cTime>2004-09-09 00:36:38.161</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tech Recipes'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/TR Postscript to PNG'/>
                <rdf:li>
                    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#TR+Postscript+to+PNG'>
                        <s:attachments
                             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tech+Recipes'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#TR+Postscript+to+PNG/'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/space/TR Postscript to PNG'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/TR Postscript to PNG'/>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#pxsl'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#IMDB Movie-Rating Decoder Ring'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#A Coder&apos;s Guide To Coffee'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#start/2004-04-21/1'/>
                <rdf:li rdf:resource='#Talks'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#TR%2bPostscript%2bto%2bPNG'/>
                <rdf:li rdf:resource='#PXSL'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tom&apos;s Perl code'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Talks/Embedding an XHTML-template language into Perl'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Talks/Fun with Numbers ? R and Perl (and IMDB data)'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#TR Joining Postscript and PDF files'/>
                <rdf:li rdf:resource='#RPMs'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#IMDB+Movie-Rating+Decoder+Ring'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL FAQs'/>
                <rdf:li rdf:resource='#faiz'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#TR Postscript to PNG/'/>
                <rdf:li rdf:resource='#snipsnap-copyright'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#tech recipes'/>
                <rdf:li rdf:resource='#Cabal2rpm'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL/FAQs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#tr postscript to png'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Talk - Free Unit Tests In Perl with LectroTest'/>
                <rdf:li rdf:resource='#snipsnap-help'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#imdb movie-rating decoder ring'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#start/'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#RPMs/'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL/'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>
