开发者

Is this Adobe Postscript?

I am doing a massive set of file conversions and several of them happen to be ".dat" files. When I open them I see that the first line is "%!PS-Adobe". Here's an example.....

%!PS-Adobe
^M%c$in
^M/c$in {72.0 mul} def
^M%DEFINE MARGINS
^M/C$LMAR .2    c$in def            %LEFT MARGIN
^M/C$RMAR 8.4   c$in def            %RIGHT开发者_如何转开发 MARGIN
^M/C$TMAR 10.8  c$in def            %TOP MARGIN
^M/C$BMAR .2    c$in def            %BOTTOM MARGIN
^M/C$CF /Courier def        %saves /Courier as C$CF

etc...

Am I correct in assuming that these are indeed Adobe Postscript files and ** NOT ** PDFs? How hard is it to convert these to PDF? I was thinking command line perl via ImageMagick or something but right now I'm a little stumped about what's been handed to me.

Thank you SO Much... Janie


You can convert these to PDF using Ghostscript and the pdfwrite device, or for simplicity the ps2pdf script supplied with Ghostscript.


Yup, that's Postscript. A PDF would start with "%PDF". If the text "^M" is literally there like that, then it was created on a Mac and got screwed up being copied to or edited on other platforms. (Maybe it was when the sample was pasted into the S.O. edit box?) It defines some variables with dollar signs in their names, which makes it look funny.


%!PS-Adobe is the signature for conforming Postscript files. (Non-conforming Postscript can get by with %!.) The signature for PDF files is %PDF-.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜