ps2eps/0000755000570200017500000000000011437142075011301 5ustar blessblessps2eps/src/0000755000570200017500000000000011437142075012070 5ustar blessblessps2eps/src/C/0000755000570200017500000000000011437142075012252 5ustar blessblessps2eps/src/C/bbox.c0000644000570200017500000003645511437142075013365 0ustar blessbless/********************************************************************/ /** bbox -- calculates Bounding Box of a pbmraw/ppmraw-picture **/ /** Created: Nov. 1997, revised Feb. 1998, Dec. 1999, June 2009 **/ /** Author: Roland Bless **/ /** Copyright (C) 1998-2009 Roland Bless **/ /** To compile simply use: **/ /** "cc bbox.c -o bbox" or "make bbox" **/ /********************************************************************/ /* * $Id: bbox.c,v 1.18 2009-10-13 15:03:49 bless Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ /* Quoting EPSF Spec: http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: llx lly urx ury The four arguments of the bounding box comment correspond to the lower-left (llx, lly) and upper-right (urx, ury) corners of the bounding box. They are expressed in the default PostScript coordinate system. For an EPS file, the bounding box is the smallest rectangle that encloses all the marks painted on the single page of the EPS file. */ #include #include #include #if defined(_WIN32) && !defined(__CYGWIN__) #include /* needed for _setmode() */ #include #endif /********************** * global variables * **********************/ const char *const version= "$Revision: 1.18 $ $Date: 2009-10-13 15:03:49 $"; const char *const prgname= "bbox"; const double round_precision= 1e-6; unsigned char bitval[8]= { 1 << 7, 1 << 6, 1 << 5, 1 << 4, 1 << 3, 1 << 2, 1 << 1, 1 }; unsigned int minus_one(const unsigned x) { return (x == 0) ? x : x-1; } unsigned int plus_one(const unsigned x) { return (x == (unsigned int) ~0U) ? x : x+1; } /***************************** readppm_and_calcbb *********************** * input: name, resolution, tight * * output: - (stdout) * * * * Reads a RAWPPM or RAWPBM picture file (name or STDIN) and * * calculates its Bounding Box on-the-fly (line-by-line). * * * * Parameters: * * name: name of the PBMRAW file or NULL (input from stdin) * * resolution: Pixel per Inch (DPI) * * tight: boolean value, if false 1 Postscript Point is added to * each Bounding Box parameter, otherwise the BB is tight * * The Bounding Box is given in Postscript Points (72 dots/inch) * * and printed to stdout * ************************************************************************/ /* calculate the bounding box in postscript points, given a resolution in dpi */ void readppm_and_calcbb(const char *name, const unsigned int resolution, const unsigned char tight) { FILE *inputfile; char inputline[1024]; unsigned char magic_found= 0; int x,y,byte_x,i; const double pt_dpi_dbl= 72.0; unsigned int x_min, x_max, y_min, y_max; unsigned int llx, lly, urx, ury; /* bounding box */ double hllx, hlly, hurx, hury; /* hires bounding box */ unsigned char *image_row, /* ImageRow */ *tmpcolumnbytep; unsigned int width,height; /* Image Size */ unsigned int byte_width; unsigned char stepsize; unsigned char colormax= 0; /* max color value */ unsigned int ui_colormax= 0; /* max color value */ if ( name == NULL ) { inputfile = stdin; name = "- STDIN -"; } else { inputfile = fopen(name,"r"); if ( inputfile == NULL ) { fprintf(stderr,"%s: ERROR -- could not open file %s\n", prgname, name); return; } } /** check for magic number **/ do { fgets(inputline, 1024, inputfile); #ifdef DEBUG fprintf(stderr,"read:[%s]\n",inputline); #endif if ( strcmp(inputline,"P4\n") == 0 ) { stepsize= 1; magic_found= 4; } else if ( strcmp(inputline,"P6\n") == 0 ) { stepsize= 3; magic_found= 6; } } while ( !feof(inputfile) && !magic_found ); if ( !magic_found ) { fprintf(stderr,"%s: ERROR -- %s is not in ppmraw or pbmraw format\n", prgname, name); return; } /** skip comments **/ do { fgets(inputline, 1024, inputfile); #ifdef DEBUG fprintf(stderr,"read:[%s]\n",inputline); #endif if (*inputline == '#') continue; else break; } while ( !feof(inputfile) ); /** read picture size: width, height **/ sscanf(inputline,"%u %u",&width,&height); if ( magic_found == 6 ) /* PPM file has maximum color-component value */ { fgets(inputline, 1024, inputfile); sscanf(inputline,"%u",&ui_colormax); colormax = (unsigned char) ui_colormax; /* this is safer */ } #ifdef DEBUG fprintf(stderr,"\nreading picture: %s size X: %u Y: %u\n",name,width,height); #endif x_min= width>0 ? width-1 : 0; x_max= 0; y_min= height>0 ? height-1 : 0; y_max= 0; if ( magic_found == 4 ) /* PBMRAW = Bitmap */ { /** read raw pbmfile **/ byte_width= width / 8; if (width % 8 != 0) byte_width++; } else /** assume ppm raw **/ { byte_width= width * 3; /* we have RGB, i.e. three bytes for each pixel */ } /* * Now read a raster of Width * Height pixels, proceeding through the image in normal English reading order, * i.e., starting from top left then moving right */ /* we allocate only one line */ image_row= malloc(byte_width); if ( image_row ) { #if defined(_WIN32) && !defined(__CYGWIN__) /* this is really braindead stuff for MSVC */ i= _setmode( _fileno(stdin), _O_BINARY); if (i == -1) fprintf(stderr,"%s: ERROR - Cannot set binary mode for STDIN\n"); #endif for (y= 0; y= width ) break; #ifdef DEBUG printf("(row %04d, %04d): \n",y,x); #endif } } /* end for */ } /* end if magic_found 4 */ else { /* assume PPM */ x= byte_x/3; /* we have 3 bytes per pixel */ #ifdef DEBUG printf("(row %04d, col %04d) byte %04d: \n",y,x,byte_x,colormax); #endif } /* update bounding box */ if ( x < x_min ) x_min= x; if ( x > x_max ) x_max= x; if ( y < y_min ) y_min= y; if ( y > y_max ) y_max= y; #ifdef DEBUG printf("ymin,height:(%04d,%04d) xmin,width:(%04d,%04d)\n", y_min,y_max,x_min,x_max); #endif break; } /* if there are pixels not white */ } /* end for byte_x */ if ( byte_x != byte_width ) { /* there was a pixel with no background color */ tmpcolumnbytep= image_row+byte_width-1; /* inspect this line from the right */ for (byte_x= byte_width-1; byte_x >= 0; byte_x--,tmpcolumnbytep--) { if ( *tmpcolumnbytep != colormax ) /* there are pixels not white */ { if ( magic_found == 4 ) { for (i= 0; i<8 ; i++) { if ( *tmpcolumnbytep & bitval[i] ) { x= byte_x*8+i; if (x >= width) break; #ifdef DEBUG printf("(%04d,%04d): \n",y,x); #endif } } /* end for */ } /* end if magic_found 4 */ else { /* assume PPM */ x= byte_x/3; /* we have 3 bytes per pixel */ } /* update bounding box */ if ( x < x_min ) x_min= x; if ( x > x_max ) x_max= x; if ( y < y_min ) y_min= y; if ( y > y_max ) y_max= y; #ifdef DEBUG printf("ymin,height:(%04d,%04d) xmin,width:(%04d,%04d)\n", y_min,y_max,x_min,x_max); #endif break; } /* if there are pixels not white */ } /* end for byte_x */ } /* if line contained not only background color */ } /* end for y */ #ifdef DEBUG_BOX fprintf(stderr,"(%04d,%04d), (%04d,%04d)\n", x_min,height-y_max,x_max,height-y_min); #endif /* distance from the left edge to the leftmost point */ hllx= (x_min*pt_dpi_dbl)/resolution; /* distance from the bottom edge to the bottommost point */ hlly= ((minus_one(height)-y_max)*pt_dpi_dbl)/resolution; /* distance from the left edge to the righmost point */ hurx= (plus_one(x_max)*pt_dpi_dbl)/resolution; /* distance from the bottom edge to the uppermost point */ hury= ((height-y_min)*pt_dpi_dbl)/resolution; if ( !tight ) { /* distance from the left edge to the leftmost point */ llx= minus_one((unsigned int) ((unsigned long) x_min*72UL)/resolution); /* distance from the bottom edge to the bottommost point */ lly= minus_one((unsigned int) ((unsigned long) (minus_one(height)-y_max)*72UL)/resolution); /* distance from the left edge to the righmost point */ urx= plus_one((unsigned int) ((unsigned long) plus_one(x_max)*72UL)/resolution); /* distance from the bottom edge to the uppermost point */ ury= plus_one((unsigned int) ((unsigned long) (height-y_min)*72UL)/resolution); /* also loosen hires BBox by default precision */ if (hllx-round_precision >= 0.0) hllx-= round_precision; if (hlly-round_precision >= 0.0) hlly-= round_precision; hurx+= round_precision; hury+= round_precision; } else /* tight bounding box */ { /* distance from the left edge to the leftmost point */ llx= (unsigned int) ((unsigned long) x_min*72UL)/resolution; /* distance from the bottom edge to the bottommost point */ lly= (unsigned int) ((unsigned long) (minus_one(height)-y_max)*72UL)/resolution; /* distance from the left edge to the righmost point */ urx= (unsigned int) ((unsigned long) plus_one(x_max)*72UL)/resolution; /* round up if we got a remainder */ if ( (((unsigned long) plus_one(x_max)*72UL) % resolution) != 0 ) urx= plus_one(urx); /* distance from the bottom edge to the uppermost point */ ury= (unsigned int) ((unsigned long) (height-y_min)*72UL)/resolution; if ( (((unsigned long) (height-y_min)*72UL) % resolution) != 0 ) ury= plus_one(ury); } /* skip the rest of the file if any data is still present */ while ( !feof(inputfile) ) { fgets(inputline, 1024, inputfile); } /* give out Bounding Box */ printf("%%%%BoundingBox: %d %d %d %d\n", llx, lly, urx, ury); printf("%%%%HiResBoundingBox: %f %f %f %f\n", hllx, hlly, hurx, hury); } else fprintf(stderr,"%s: ERROR -- not enough memory to read in one row of the picture\n",prgname); fclose(inputfile); free(image_row); } int main(int argc, char **argv) { int i; char *filename= NULL; unsigned int resolution= 72; /* use 72 dpi as default resolution */ unsigned char tight= 1; for (i= 1; i control panel -> system -> "advanced" tab -> environment variables and edit the PATHEXT entry accordingly. 3.) then simply typing ps2eps should invoke ps2eps correctly Another option is to call perl directly: perl ps2eps ... The script assumes that you have "gswin32c" as postscript interpreter in your path. Under Windows ps2eps can perform wildcard expansion now on its own. UPDATES ------- Possibly you can find the newest version at the following URL: http://tm.uka.de/~bless/ps2eps ps2eps/bin/0000755000570200017500000000000011437142075012051 5ustar blessblessps2eps/bin/win32/0000755000570200017500000000000010041510704012777 5ustar blessblessps2eps/bin/win32/bbox.exe0000755000570200017500000015000011437135331014444 0ustar blessblessMZ@ !L!This program cannot be run in DOS mode. $E}+.+.+.sv.+.*.+.K.+.$.+.t.+.q.+.Rich+.PEL|L  @F@(H.text2 `.rdata @@.data@DS$LUD$ D$ D$8uIH@@l$$PVWd$UD$XhP @t$T3u@D$Rh@S l$uSh@h|@h@W ][Dÿx@t$T3uD$E D$j#UL$XhQq D$` :uE tߍT$4RD$@PL$\hp@Q \$"u/UT$XhR+ D$LPL$dhl@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wE%=u5}u,e}uef}u EfEfEEEEf=sfMfMNMN fF ff&~M_^[nU@S@3Ƀ`9M Et]} ] x@`9MuEf9M t@VWE } T;t&@4f>r }𥥥MuVu^YY39M u_^M[%@ ,>N\jxγ*8JVlԴ(:Pbrʵֵ"2H^x@@ư>bbox$Revision: 1.18 $ $Date: 2009-10-13 15:03:49 $%s: ERROR -- not enough memory to read in one row of the picture %%%%HiResBoundingBox: %f %f %f %f %%%%BoundingBox: %d %d %d %d R@A%s: WARNING -- fread incomplete - file %s seems to be corrupt %s: ERROR - Cannot set binary mode for STDIN %s: ERROR -- %s is not in ppmraw or pbmraw format %u%u %uP6 %s: ERROR -- could not open file %s rP4 - STDIN -%s: bbox Version %s input is read from standard input. bounding box of the image. If no filename is specified bbox reads a rawppm or rawpbm file and prints out the -h: this help -V: version information -r: resolution of picture in dpi -l: loose bounding box (bbox is expanded by 1 point) usage: %s [-l] [-r resolution] [-V] [filename] %s: Version %s %s: ERROR -- unknown option %s call %s -h for help on usage --help-h--version-V-l%s: ERROR -- Missing resolution after -r -r@@EEE50P (8PX700WP `h````ppxxxx(null)(null)CorExitProcessmscoree.dll*F@.F@e+000?~PAGAIsProcessorFeaturePresentKERNEL32runtime error TLOSS error SING error DOMAIN error R6029 - This application cannot run using the active version of the Microsoft .NET Runtime Please contact the application's support team for more information. R6028 - unable to initialize heap R6027 - not enough space for lowio initialization R6026 - not enough space for stdio initialization R6025 - pure virtual function call R6024 - not enough space for _onexit/atexit table R6019 - unable to open console device R6018 - unexpected heap error R6017 - unexpected multithread lock error R6016 - not enough space for thread data This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. R6009 - not enough space for environment R6008 - not enough space for arguments R6002 - floating point not loaded Microsoft Visual C++ Runtime Library Runtime Error! Program: ...]@]@]@]@ ((((( H h(((( H Hh@i@z@z@GetProcessWindowStationGetUserObjectInformationAGetLastActivePopupGetActiveWindowMessageBoxAuser32.dllProgram: A buffer overrun has been detected which has corrupted the program's internal state. The program cannot safely continue execution and must now be terminated. Buffer overrun detected!A security error of unknown cause has been detected which has corrupted the program's internal state. The program cannot safely continue execution and must now be terminated. Unknown security failure detected!؅@܅@׌@ی@Ԋ@؊@@@1#QNAN1#INF1#IND1#SNAN|@@H@@H^ ƶ ,>N\jxγ*8JVlԴ(:Pbrʵֵ"2H^x HeapFreeHeapAllocwGetModuleHandleAGetCommandLineAGetVersionExA HeapDestroyHeapCreatevVirtualFreesVirtualAllocHeapReAllociGetLastError.CloseHandleReadFileExitProcessGetProcAddressOTerminateProcess:GetCurrentProcessSetHandleCountGetStdHandle^GetFileTypeGetStartupInfoAWriteFileuGetModuleFileNameA`UnhandledExceptionFilterFreeEnvironmentStringsAMGetEnvironmentStringsFreeEnvironmentStringsWWideCharToMultiByteOGetEnvironmentStringsW*SetStdHandleFlushFileBuffersSetFilePointerkMultiByteToWideCharyVirtualProtectGetSystemInfo{VirtualQueryMCreateFileAGetStringTypeAGetStringTypeWGetACPGetOEMCPGetCPInfoHLoadLibraryARtlUnwindInterlockedExchangeQueryPerformanceCounterGetTickCount>GetCurrentThreadId;GetCurrentProcessIdGetSystemTimeAsFileTimeHeapSizeSetEndOfFile:LCMapStringA;LCMapStringWlGetLocaleInfoAKERNEL32.dll:@@k@B@^@@ @@us@r@r@I=@D@4@ Mx@Mx@Mx@Mx@Mx@Mx@@@@ @ P@$@@Ч@@l@D@ @Ԧ@@@x@y@zԥ@Х@@          ! 5A CPR S WY l m pr   )    @@N@.5 @ `y!@~ڣ @ڣ AϢ[@~QQ^ _j21~ @@@@ @P@$@@ @4@N@ p+ŝi@]%O@qוC)@D@<զIx@oGAkU'9p|Bݎ~QCv)/&D(DJzEeǑF e uuvHMXB䧓9;5SM]=];Z] T7aZ%]g']݀nLɛ R`%u?q= ףp= ף?Zd;On?,eX?#GGŧ?@il7?3=BzՔ?aw̫?/L[Mľ?S;uD?g9Eϔ?$#⼺;1az?aUY~S|_?/D?$?9'*?}d|FU>c{#Tw=:zc%C1@@P*@8@%"@@@@@@@@@  ` ` ( ( `( `@@ PtdXX@X@<<Qtd/lib64/ld-linux-x86-64.so.2GNU      fUa9o N }Ai UcF%v!<Gn6"`\"`__gmon_start__libc.so.6fopenputs__stack_chk_failstdinfeoffgetsfclosemallocsscanfstderrfreadatolfprintfstrcmp__libc_start_mainfreeGLIBC_2.4GLIBC_2.2.5ii ui !`"`"`!`!`!`"`"`"`"` "` ("` 0"` 8"` @"` H"`P"`X"`H;H5B %D @%B h%: h%2 h%* h%" h% h% h%  hp% h`% h P% h @% h 0% h % h % h1I^HHPTI@H@H?@'HH HtHÐ= UHt$HHu Hl HHu} ff.UH= HtHt `IAÐUH}}t EEEEEUH}}t EEEEEUHHpHXTPdH%(HE1ƅHR@HƅDžHXuH HHDžX@KHX @HHu)HH=O HX@1 HHH5@uƅƅ#H9@uƅƅHu tu)HH= HX@@* HH<#uH2tHHHs@uAHHyHHy@t DžDžt DžDžu%tҍ^HpHp} Dž4HHpHt)H?H= HX@HpHhDž3Hh:ubDžKHhHx"`!Єt%9sK~9DžVUUUы)‰Љ;s ;v ;s ;v/!Hh;;lHpHHh3Hh:ubDžKHhHx"`!Єt%9sK~9DžVUUUы)‰Љ;s ;v ;s ;v*Hh9HHxH*,HHHH H*f(XYTHHxH*,HHHH H*f(X^+HHxH*,HHHH H*f(XYTHHxH*,HHHH H*f(X^HHxH* ,HHHH H*f(X  Y(THHxH*0,HHHH H*f(X0(^0+HHxH*8,HHHH H*f(X88Y@THHxH*H,HHHH H*f(XH@^HxPHHHHT+HHHHTHHHHTr+HHHHT> f(\f(fWf.s$f(\f( qf(\f(fWf.s$If(\f( %X xXxqHHHHT+HHHHTHHHHTHHHHH‹THHкHHHt+HHHHT+HHHHH‹THHкHHHt+HHwHt؋A@xf(f(f(f(ſ@HH= @oHSHpHUdH3%(tUHH@}HuHEEHEE)EHHHEH8J@uKEE;E}EHHHEH8dEH5H= P@EHHHEH8z@`u EEHHHEH8}@9tEHHHEH8@u)HH5@JEWEHHHEH8@t"EHHHEH8@H7H5@@H5*@@0@R@k@@@@EEHHHEH<-u@H5EHHHEHHH=% I@ E;EHHHEHHEEE;EUuH}EEÐfffff.Hl$L|$H- L= Ld$Ll$Lt$H\$H8L)AIHIcHt1@LLDAHH9uH\$Hl$Ld$Ll$ Lt$(L|$0H8ÐUHSHH Ht1H`HHuH[ÐHCH$Revision: 1.1 $ $Date: 2010-08-31 08:24:59 $@bbox@ư>- STDIN -r%s: ERROR -- could not open file %s P4 P6 %s: ERROR -- %s is not in ppmraw or pbmraw format %u %u%u%s: WARNING -- fread incomplete - file %s seems to be corrupt %%%%BoundingBox: %d %d %d %d %%%%HiResBoundingBox: %f %f %f %f %s: ERROR -- not enough memory to read in one row of the picture -r%s: ERROR -- Missing resolution after -r -l-V--version%s: bbox Version %s -h--help%s: Version %s usage: %s [-l] [-r resolution] [-V] [filename] -l: loose bounding box (bbox is expanded by 1 point) -r: resolution of picture in dpi -V: version information -h: this help bbox reads a rawppm or rawpbm file and prints out the bounding box of the image. If no filename is specified input is read from standard input.%s: ERROR -- unknown option %s call %s -h for help on usage ;<X6hx(zRx $H @# $Dk @# $l @  $?@ zRx P,4H &@ x@ @@@o@@@ !`h@@H o@oor@( `@@@@@@@@&@6@F@V@f@v@@ `@ GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)L@x@ @<@@!o_IO_stdin_usedy@@b6dIintpkS @WK'/build/buildd/glibc-2.7/build-tree/amd64-libc/csu/crti.S/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuGNU AS 2.18.0]P/build/buildd/glibc-2.7/build-tree/amd64-libc/csu/crtn.S/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuGNU AS 2.18.0% $ > $ > $ > 4: ; I?  &IU%U%# init.cO /build/buildd/glibc-2.7/build-tree/amd64-libc/csucrti.S @ Ku=/0K x@K @${O /build/buildd/glibc-2.7/build-tree/amd64-libc/csucrtn.S @K @Klong unsigned intGNU C 4.2.4 (Ubuntu 4.2.4-1ubuntu4)short unsigned intshort int_IO_stdin_usedunsigned charlong int/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuinit.c@@x@@@@@@@@.symtab.strtab.shstrtab.interp.note.ABI-tag.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment.debug_aranges.debug_pubnames.debug_info.debug_abbrev.debug_line.debug_str.debug_ranges@#@ 5@@@1o@(; @C@Kor@r&Xo@0g@Hq@h {x@xv@@@@X@X<@ `  `  ` ( `( !`!!`!`"``" "`""&#@$% e$ &o${&?00';p()I3 $9 <s@@@@@@@r@@ @ @ x@ @ @@@X@@ ` ` `( `!`!``"`"` ! @#. `< `J `W @m"`|p"` @# ` `@ ` `@!` ` `( `# `"`.B @R @Y h | @ @ @!`"`."`A@Q cw H @#h"` @@F"`!@"`x"`/"`C"`J_ k @#h ?@m x@init.cinitfini.ccall_gmon_startcrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST____do_global_dtors_auxcompleted.6183p.6181frame_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_auxbbox.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_startprintf@@GLIBC_2.2.5__libc_csu_fini_start__gmon_start___Jv_RegisterClassesputs@@GLIBC_2.2.5readppm_and_calcbb_finimalloc@@GLIBC_2.2.5fopen@@GLIBC_2.2.5__libc_start_main@@GLIBC_2.2.5fgets@@GLIBC_2.2.5_IO_stdin_usedfree@@GLIBC_2.2.5__data_startstdin@@GLIBC_2.2.5round_precisionatol@@GLIBC_2.2.5sscanf@@GLIBC_2.2.5minus_one__dso_handle__libc_csu_initversionfread@@GLIBC_2.2.5__bss_start__stack_chk_fail@@GLIBC_2.4strcmp@@GLIBC_2.2.5prgnamefeof@@GLIBC_2.2.5_endbitvalfclose@@GLIBC_2.2.5stderr@@GLIBC_2.2.5_edatafprintf@@GLIBC_2.2.5plus_onemain_initps2eps/bin/linux/i386/0000755000570200017500000000000011437141432013675 5ustar blessblessps2eps/bin/linux/i386/bbox0000755000570200017500000002734311437141432014566 0ustar blessblessELF4d!4 (444444tt   DT   HHHDDQtdRtd   /lib/ld-linux.so.2GNUGNUݣ봴9̄"sCܶ    ("K8gUa /`f)[mD?{ܕtPUT__gmon_start__libc.so.6_IO_stdin_usedfopen__isoc99_sscanfputs__stack_chk_failstdinfeoffgetsfclosemallocstderrfreadatolfprintfstrcmp__libc_start_mainfreeGLIBC_2.4GLIBC_2.1GLIBC_2.0GLIBC_2.7ii ii ii ii PT   $ ( , 0 48<US[p*tX[5%%h%h%h% h%h %h(%h0%h8p% h@`%$hHP%(hP@%,hX0%0h` %4hh%8hp%<hx1^PTRh h0QVhfUS=Xu?\9s\\9rX[]Ít&'Utt $ÐU}tEE]U}tEE]USEUtpeE1ƅhݝƅDžtuTDžt(U2D$t$u/ 4Pt\$ L$T$$ D$D$$XD$Y$uƅƅ(D$]$uƅƅ$Hu ou/ dPt\$ L$T$$4# D$D$$<#u$tL$ L$T$$4uMD$D$$L$T$$t Džt Džu%tЉ$nDžD$ D$D$$t/ Pt\$ L$T$$NDž:u_DžHH!Єt%9s4~#VUUU)ȉ;s ;v ;s ;v0#;;Q:u_DžHH!Єt%9s4~#VUUU)ȉ;s ;v ;s ;v+9hl߭h܍E hl߭hݝ$L+hl߭h܍E hl߭hݝ$hl߭h܍E hl߭hݝ+hl߭h܍E hl߭hݝxpKu $B$.+u $ $‰u $+u $ ݅t ݅ݝ ݅t ݅ݝ ݅ݝ ݅xݝx5u $+u $‰u $‰u Ѕt$+u +u Ѕt8$##D$D$$I$t˸ߖT$T$ T$T$$_݅x\$݅\$݅\$ ݅\$$* $PL$T$$($$Ee3t[]UVS8D$$D$ HD$/D$(HD$(E D$f$uPD$(D$(;E}D$(E $sD$  lPL$T$$ZD$(E D$$u D$/D$(E D$$_t D$(E D$$?u+ L$T$$rD$(E D$$t$D$(E D$$ ŗL$T$$;ؗT$$$$ h$D\$fP$D$8$Ș,$ D$(E <-uA5D$(E  $Pt$\$ L$T$$DD$(E D$$D$(D$(;ED$/D$D$ D$D$$$8[^]ÐU]Ít&'UWVSOù/)t$1ED$E D$E$9rރ[^_]Ë$ÐUS t fЋu[]ÐUS[,Y[$Revision: 1.18 $ $Date: 2009-10-13 15:03:49 $bboxư>- STDIN -r%s: ERROR -- could not open file %s P4 P6 %s: ERROR -- %s is not in ppmraw or pbmraw format %u %u%u%s: WARNING -- fread incomplete - file %s seems to be corrupt %%%%BoundingBox: %d %d %d %d %%%%HiResBoundingBox: %f %f %f %f %s: ERROR -- not enough memory to read in one row of the picture -r%s: ERROR -- Missing resolution after -r -l-V--version%s: bbox Version %s -h--help%s: Version %s usage: %s [-l] [-r resolution] [-V] [filename] -l: loose bounding box (bbox is expanded by 1 point) -r: resolution of picture in dpi -V: version information -h: this help bbox reads a rawppm or rawpbm file and prints out the bounding box of the image. If no filename is specified input is read from standard input.%s: ERROR -- unknown option %s call %s -h for help on usage R@ x o(T oooh ΅ޅ.>N^n~@ GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment44#HH 1hh$HDo((,N TT@V^ohh(koPz   xx0ؕpp    L@@ PP 0P #s &p- +_4Hh(Th   x  ؕp  @P (5KXZ\hPtp   @   , @ؕGb u{ܕ@ P t$D1AN0Z^pPT`H P"4=TfYx crtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST____do_global_dtors_auxcompleted.7021dtor_idx.7023frame_dummy__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxbbox.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_start__libc_csu_fini_start__gmon_start___Jv_RegisterClasses_fp_hw__isoc99_sscanf@@GLIBC_2.7readppm_and_calcbb_finifgets@@GLIBC_2.0__libc_start_main@@GLIBC_2.0_IO_stdin_usedfree@@GLIBC_2.0__data_startfclose@@GLIBC_2.1round_precisionstderr@@GLIBC_2.0minus_onefopen@@GLIBC_2.1__dso_handlefeof@@GLIBC_2.0__DTOR_END____libc_csu_initprintf@@GLIBC_2.0atol@@GLIBC_2.0versionfprintf@@GLIBC_2.0__bss_startmalloc@@GLIBC_2.0__stack_chk_fail@@GLIBC_2.4stdin@@GLIBC_2.0prgname_endbitvalputs@@GLIBC_2.0fread@@GLIBC_2.0_edatastrcmp@@GLIBC_2.0plus_one__i686.get_pc_thunk.bxmain_initps2eps/bin/ps2eps0000755000570200017500000010224311437142075013215 0ustar blessblesseval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' # -*-perl-*- if 0; # The expression in the previous line replaces the unix specific line # {#!/usr/bin/perl}. # ps2eps - convert PostScript to EPS (Encapsulated PostScript) files # ------------------------------------------------------------------- # $Id: ps2eps,v 1.68 2010-05-07 19:42:35 bless Exp $ # ------------------------------------------------------- # (C)opyright 1999-2009 Roland Bless # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Author: Roland Bless # Send bug reports to roland bless.de # ------------------------------------------------------------------- # Additional filtering is performed when Windows generated PostScript files # are processed. Some instructions will otherwise lead to bad output # if EPS-file gets embedded into other PostScript files. # # Requirements: # + perl # + gs (ghostscript supporting pbm output) # + bbox (a little C program [ANSI-C - should work on every platform] # for calculation of the actual BoundingBox) use POSIX; #use warnings; #use Getopt package use Getopt::Long; Getopt::Long::Configure("no_ignore_case"); $prgname= "ps2eps"; if (! -d "/usr/bin") { # we assume that we are running under native windows $ghostscriptname = "gswin32c"; $NULLDEV = "nul"; } else { # Unix or cygwin $ghostscriptname = "gs"; $NULLDEV = "/dev/null 2>&1"; } $bboxver=`bbox >$NULLDEV -V`; $bboxname= ($?== -1) ? "" : "bbox"; $version= '$Id: ps2eps,v 1.68 2010-05-07 19:42:35 bless Exp $'; #' $insertPScode= 1; # Insert surrounding Postscript code $infhandle = STDIN; # Standard input is the default input file $outfhandle = STDOUT; # Standard output is default output if STDIN is input $infname= '-'; $outfname= '-'; $forceoverwrite=0; # do not overwrite existing files $ignoreBB= 0; # ignore existing Bounding Box comment $removeDSC= 1; # remove Adobe document structure comments $removeADO= 1; # remove Adobe printer Driver console Output [Page: ...] $ignoreEOFDSC= 0; # ignore %%EOF DSC hint $removePreview= 0; # remove preview $quiet= 0; # write progress to stdout $resolution= 144; # resolution for bounding box calculation is 2x72 dpi $trytofixps= 1; # try to fix postscript code $forcefixps= 0; # fix postscript code unconditionally if eq 1 $filterorientation= 1;# filter Orientation line $looseBB=''; # default: tight bounding box $clip=0; # do not clip $warnings=0; # do not print warnings concerning postscript sanity $debuggs=0; # no debugging of ghostscript call, turn this on if you want to see the gs call $inch=2.54; # one inch is 2.54cm $fullcolors= 1; # use ppm format (24-bit full color) $trailerseen= 0; # Trailer comment seen? $PSversion="2.0"; # default Postscript Version $PSDSCversion="2.0"; # default Postscript DSC Version $translate_x= 0; # translate by x postscript points $translate_y= 0; # translate by y postscript points $allbinary= 0; # treat postscript as binary do not filter or change stuff $alphaopt=""; # rendering option for ghostscript "-dTextAlphaBits=4 -dGraphicsAlphaBits=4" $hiresprecision=0.5; # amount that is changed of HiresBB in case that looseBB was requested $defaultext = '(ps|prn)'; # default extension $defaultoutext = '.eps'; # default output extension $envname_size = 'PS2EPS_SIZE'; $envname_gsbbox = 'PS2EPS_GSBBOX'; $gpar=""; $known_papersizes="11x17|ledger|legal|letter(small)?|arch[A-E]|a([0-9]|10)|isob[0-6]|b[0-5]|c[0-6]|jisb[0-6]|fls(a|e)|halfletter"; $papersize_help="11x17,ledger,legal,letter,lettersmall,archA,archB,archC,archD,archE\ a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,isob0,isob1,isob2,isob3,isob4,isob5,isob6,\ b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5,c6,\ jisb0,jisb1,jisb2,jisb3,jisb4,jisb5,jisb6,flsa,flse,halfletter\n"; $trigger= 0; $notsane= 0; $dummy=""; @ver= split(/ /,$version); # filename for temporary files if ($^O =~ /MSWin32/i or $^O =~ /cygwin/i) { # it is less trouble to use the current directory if working on # cygwin and nevertheless using gswin32c. $tmpfname= "$prgname.$$"; $win=1; } elsif (defined($ENV{'TMP'})) { $tmpdir= $ENV{'TMP'}; $filesep= ($tmpdir =~ /^?\:\\/) ? '\\' : '/'; if ($tmpdir =~ /$filesep$/) { $tmpfname= $tmpdir . "$prgname.$$"; } else { $tmpfname= $tmpdir . "$filesep$prgname.$$"; } $win=1; } else #assume we're on a UNIXBOX { $tmpfname= "/tmp/" . "$prgname.$$"; $win=0; } $licensetxt= "\ This program is free software; you can redistribute it and/or modify\ it under the terms of the GNU General Public License as published by\ the Free Software Foundation; either version 2 of the License, or\ (at your option) any later version.\ \ This program is distributed in the hope that it will be useful,\ but WITHOUT ANY WARRANTY; without even the implied warranty of\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\ GNU General Public License for more details.\ \ You should have received a copy of the GNU General Public License\ along with this program; if not, write to the Free Software\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"; @prgidtxt= ( "$prgname - convert PostScript to EPS (Encapsulated PostScript) files\n", "(C)opyright 1998-2009 Roland Bless\n\n" ); @helptxt= ("Version: $ver[2]\n", "Operation:\n", " Without any argument, $prgname reads from standard input\n", " and writes to standard output.\n", " If filenames are given as arguments they are processed\n", " one by one and output files are written to filenames\n", " with extension '$defaultoutext'. If input filenames have the extension\n", " '.ps' or '.prn', this extension is replaced with '$defaultoutext'.\n", " In all other cases '$defaultoutext' is appended to the input filename.\n", " Please note that PostScript files for input should contain\n", " only one single page.\n\n", " If BoundingBox in output seems to be wrong, please try options --size or --ignoreBB.\n\n" ); @usagetxt= ("Syntax:\n", " $prgname [-f] [-q] [-N] [-O] [-n] [-P] [-c] [-b] [-C] [-m] [-B] [-E] [-s ] [-R +|-|^] [-t ] [-l] [-g] [-d] [-H] [-h|--help] [-g] [-a] [-W] [-L] [-V|--version] [--] [psfile1] [psfile2] [...]\n", "Options:\n", " -f, --force force overwriting existing files\n", " -q, --quiet quiet operation (no output while processing files)\n", " -N, --noinsert do not insert any postscript code\n", " -O, --preserveorientation do not filter Orientation: header comment\n", " -n, --nofix do not try to fix postscript code\n", " -P, --removepreview remove preview image (smaller file, but no preview)\n", " -F, --fixps fix postscript code unconditionally\n", " -c, --comments preserve document structure comments\n", " -b, --binary treat postscript as binary, do not modify characters\n", " -C, --clip insert postscript code for clipping\n", " -m, --mono use black/white bitmap as base for calculation\n", " -s, --size= page size (a0-a10,letter,...) or in format XxY[cm|in] (default:cm), where X and Y are numbers\n", " use --size=list to list pre-defined page sizes\n", " -R, --rotate= rotate resulting EPS. : +=+90 (clockw.),-=-90 (counter-clockw.) ^=180 degrees\n", " -t, --translate specify x,y offset (may be negative) in postscript points (1/72 dpi)\n", " -r, --resolution specify dpi resolution to render with ghostscript (default 144)\n", " -l, --loose expand the original bounding box by one point in each direction\n", " -B, --ignoreBB do not use existing bounding box as page size for rendering\n", " -E, --ignoreEOF do not use %%EOF as hint for end of file\n", " -g, --gsbbox use internal bbox device of ghostscript\n", " -H, --no-hires do not use a HiResBoundingBox\n", " -h, --help help information\n", " -L, --license show licensing information\n", " -V, --version show version information\n", " -d, --debuggs show ghostscript call\n", " -a, --accuracy improve accuracy during rendering (maybe slower)\n", " -W, --warnings show warnings about sanity of generated eps file\n", " -- all following arguments are treated as files\n", " (allows filenames starting with -)\n", "\n", "Arguments:\n", " One or more names of PostScript files for input\n"); ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- argument checking -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #environment variable for papersize if (defined($ENV{"$envname_size"})) { $opt_s= $ENV{"$envname_size"}; } else { $opt_s = ''; # for s-option } if (defined($ENV{"$envname_gsbbox"})) { $bboxname=""; } $opt_t = ''; # for t-option $opt_R = ''; # for R-option $opt_r = ''; # for r-option $stopnow = 0; die "Wrong option(s), please check usage with $prgname --help\n" unless GetOptions('f|force' => \$forceoverwrite, 'q|quiet' => \$quiet, 'm|mono' => sub { $fullcolors = 0 }, 'n|nofix' => sub { $trytofixps = 0 }, 'F|fixps' => \$forcefixps, 'N|noinsert' => sub { $insertPScode = 0 }, 'O|preserveorientation' => sub { $filterorientation= 0 }, 'P|removepreview' => \$removePreview, 'c|comments' => sub { $removeDSC = 0 }, 'b|binary' => sub { $allbinary = 1 }, 'C|clip' => \$clip, 'l|loose' => sub { $looseBB = '-l' }, 'B|ignoreBB' => \$ignoreBB, 'E|ignoreEOF'=> \$ignoreEOFDSC, 's|size=s' => \$opt_s, 't|translate=s' => \$opt_t, 'r|resolution=s' => \$opt_r, 'R|rotate=s' => \$opt_R, 'g|gsbbox' => sub { $bboxname=""; }, 'H|nohires' => \$nohires, 'h|help' => sub { $stopnow = 1; print @prgidtxt,@helptxt,@usagetxt,"\nAuthor: Roland Bless (roland\@bless.de)\n\n"; }, 'L|license' => sub { $stopnow = 1; print @prgidtxt,$licensetxt,"\nAuthor: Roland Bless (roland\@bless.de)\n\n"; }, 'a|accuracy' => sub { $alphaopt = '-dTextAlphaBits=4 -dGraphicsAlphaBits=4' }, 'd|debuggs' => \$debuggs, 'W|warnings' => \$warnings, 'V|version' => sub { $stopnow = 1; print @prgidtxt,"Version: $ver[2]\n"; });exit if ($stopnow); ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- wildcard processing -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## internal wildcard processing for current directory, ## only used for non UNIX-based OSs (which may lack shell wildcard expansion) @filenames = (); foreach $object (@ARGV) { if ($win && $object =~ m/\*/o) # asterisk is present in filename { $wildcard = $object; $wildcard =~ s/\./\\\./g; # replace . in pattern with \. $wildcard =~ s/\*/\(\.\*\)/g; # replace * in pattern with (.*) opendir(DIR,'.') || die 'Unable to open current directory, stopped'; # open current directory print STDERR $wildcard; @fid = grep { /$wildcard(\.$defaultext)?/i } readdir(DIR); foreach (@fid) { push @filenames, $_; } closedir DIR; } else { push @filenames, $object; } } # end foreach $filenames[0]= '-' if (scalar(@filenames) == 0); # no file arguments, use STDIN as input print STDERR "Input files: @filenames\n" if (!$quiet); if ($opt_r ne '') { $resolution=$opt_r; } # papersize stuff if ($opt_s ne '') { # if explicit size is given, ignore existing BoundingBox always $ignoreBB = 1; $pagedimension = $opt_s; if ($opt_s eq "list") { print STDERR "Available paper sizes: $papersize_help"; exit 0; } #explicit format XxY[cm|in] if ($pagedimension =~ /(\d*\.?\d+)x(\d*\.?\d+)/) { ($x_dim, $dummy, $y_dim, $unit)= split(/(x|cm|in)/,$pagedimension); if ( $x_dim !~ /^\d*\.?\d+$/ ) { die "$x_dim in $arg is not a valid number, stopped"; } if ( $y_dim !~ /^\d*\.?\d+$/ ) { die "$y_dim in $arg is not a valid number, stopped"; } #print STDERR "xdim: $x_dim ydim: $y_dim unit:$unit\n" ; if (!defined($unit) ) { $unit='cm'; $opt_s=$opt_s . $unit; } if ( $unit ne 'in' ) # assume centimeters { # calculate dimension in pixels (remember: resolution is in dpi) $xpixels= int(($x_dim * $resolution) / $inch)+1; $ypixels= int(($y_dim * $resolution) / $inch)+1; $gpar= "-g${xpixels}x${ypixels}"; } else { $xpixels= int($x_dim * $resolution)+1; $ypixels= int($y_dim * $resolution)+1; $gpar= "-g${xpixels}x${ypixels}"; } } #endif XxY in opt_s else { if ($opt_s =~ /$known_papersizes/) { $gpar="-sPAPERSIZE=$opt_s"; } else { print STDERR "Error: Unknown paper size: $opt_s\n Acceptable papersizes are:$papersize_help\n"; exit 1; } } } #translate option if ($opt_t ne '') { ($translate_x,$translate_y)= split(/\,/,$opt_t); } #rotate $rotright='-90 rotate'; $rotleft='90 rotate'; $rotupsidedown='180 rotate'; $rotate=''; if ($opt_R ne '') { if ($opt_R eq '+') { $rotate=$rotright; } elsif ($opt_R eq '-') { $rotate=$rotleft; } elsif ($opt_R eq '^') { $rotate=$rotupsidedown; } else { die "Wrong parameter for option -R: Valid are only +,-,^\n"; }; } $device= $fullcolors ? "ppmraw" : "pbmraw"; ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- iterate over different input files -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROCESSFILE: while ($infname= (shift @filenames)) { # reset filter definitions for each file undef $linefilter; undef $rangefilter_begin; undef $rangefilter_end; $fixthisps= $trytofixps; $fixmsgprinted= 0; if (!$quiet) { print STDERR "Processing: $infname\n"; } unless (open($infhandle,"<$infname")) { # skip over this file print STDERR "$prgname: Can't open $infname: $!\n"; next PROCESSFILE; } # buffer input from stdin into temporary file, because it has to be read twice # one time for ghostscript processing, the second time for generating output if ($infname eq '-') # input is stdin { $tmpfhandle=''; open($tmpfhandle,">$tmpfname") or die "Cannot open temporary file $tmpfname for writing: $!\n"; } else # input is not stdin { undef $tmpfhandle; #if filename ends with $defaultext usually .ps or .prn, replace the extension with $defaultoutext if ($infname =~ /\.$defaultext$/i) { $outfname= $infname; $outfname =~ s/\.$defaultext$/$defaultoutext/i; } else # otherwise simply append the extension $defaultoutext { $outfname= $infname . "$defaultoutext"; } } #end else input is not stdin ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- process input file -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $linefilter= '^$'; #'# filter empty lines by default while (<$infhandle>) { # get postscript and DSC version if (/%!PS-Adobe-(\S+).*EPSF-(\S+)/) { $PSversion=$1; $PSDSCversion=$2; if (! ($PSversion =~ /\d+\.\d+/)) { $PSDSCversion="2.0"; } if (! ($PSDSCversion =~ /\d+\.\d+/)) { $PSDSCversion="2.0"; } } # check for existing BoundingBox parameters if ( /^%%\s*BoundingBox:\s*(.*)/ && !defined($eBBllx) ) { $BBarg= $1; # accept even negative and fractional BBs if ( $BBarg =~ /(\-?\d+\.?\d*\s+){3,}\d+/ ) # ignore %% BoundingBox: (atend) comments { ($eBBllx,$eBBlly,$eBBurx,$eBBury,$dummy)= split /\s/,$BBarg; #print STDERR "Existing BB: $eBBllx,$eBBlly,$eBBurx,$eBBury\n"; if (int($eBBllx) < 0) { $translate_x= - int($eBBllx-0.5); } if (int($eBBlly) < 0) { $translate_y= - int($eBBlly-0.5); } $xpixels= int((($eBBurx-$eBBllx) * $resolution)/72 + 0.5); $ypixels= int((($eBBury-$eBBlly) * $resolution)/72 + 0.5); if (!$ignoreBB) { $gpar= "-g${xpixels}x${ypixels}"; # check for meaningful values if (($xpixels <= 1) || ($ypixels <= 1)) { $gpar=""; undef $eBBllx; undef $eBBlly; } else { if (!$quiet) { print STDERR "Rendering with existing $_"; if (int($eBBllx) < 0 || int($eBBlly) < 0) { print STDERR "WARNING: existing Bounding Box shows negative values - shifting\n"; } } } } #endif !$ignoreBB } #endif $BBarg =~ } if ($fixthisps) # try to fix bad postscript code { # check for Windows 3.x output if ( /^Win.*Dict/ ) { if (!$quiet && !$fixmsgprinted) { print STDERR "Windows 3.5 generated Postscript file detected, fixing\n"; } $linefilter= '^(EJ|RS)'; $rangefilter_begin= '^statusdict'; $rangefilter_end= 'cvx\ settransfer$'; #' $fixmsgprinted= 1; # stop printing message } else { if ( /^%%Creator:\s*Wind.U\s*Xprinter/ ) { if (!$quiet && !$fixmsgprinted) { print STDERR "Star/OpenOffice generated Postscript file detected, fixing\n"; } $linefilter= '^rs'; $fixmsgprinted= 1; # stop printing message } else { if ( $forcefixps || /^\/NTPS/ || /Creator:\s*(AdobePS|Pscript|.*Windows)/i ) #check for NT generated output { if (!$quiet && !$fixmsgprinted) { if ($forcefixps) { print STDERR "Postscript filtering requested, fixing\n"; } else { print STDERR "Windows generated Postscript file detected, fixing\n"; } } $rangefilter_begin= '^((\[\{)|(featurebegin\{))$'; #' $rangefilter_end= '^(\} stopped cleartomark|\}featurecleanup)'; $exclude_rangefilter_begin= '^(?i)%%BeginNonPPDFeature'; #' $exclude_rangefilter_end= '^(?i)%%EndNonPPDFeature'; #$triggered_rangefilter_begin= ''; #' #$triggered_rangefilter_end= ''; #' $fixsearchpat='(^|\s)(initmatrix|initclip|initgraphics)(\s|$)'; $fixreplacepat=' '; $fixmsgprinted= 1; # stop printing message } # end if NTPS } #end else } } #end if trytofixps if (defined($tmpfhandle)) { print $tmpfhandle $_ or die "$prgname: Failure during writing to temporary file $tmpfname"; } if (/^%%EOF\s*$/) { $totalEOFDSC++ } } #end while <$infhandle> if (defined($tmpfhandle)) { close($tmpfhandle); } else { $tmpfhandle= $infhandle; $tmpfname= $infname; } ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- calculate the bounding box -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if ($translate_x!=0 || $translate_y!=0) { $translation="$translate_x $translate_y translate"; $translatecmd="-c \'$translation\'"; } else { $translation=""; $translatecmd=""; } if (!$quiet) { print STDERR "Calculating Bounding Box..."; if ($opt_s) { print STDERR "using page size $opt_s..."; } } $rotatecmd=''; if ($rotate ne '') { $rotatecmd="-c \"$rotate\"" } if ($bboxname ne '') { $cmdline="$ghostscriptname -dSAFER -dNOPAUSE $alphaopt -q $gpar -r$resolution -sDEVICE=$device -sOutputFile=- $translatecmd -f \"$tmpfname\" -c showpage -c quit | $bboxname -r $resolution"; } else { if (!$quiet) { print STDERR "...using bbox device of $ghostscriptname..."; } $cmdline = "$ghostscriptname -dSAFER -dBATCH -dNOPAUSE -q $gpar -r$resolution -sDEVICE=bbox -sOutputFile=- -c \"/setpagedevice {pop} def\" $translatecmd -f \"$tmpfname\" -c quit 2>&1"; } if ($debuggs) { print STDERR "\nCalling: $cmdline\n"; } # actual ghostscript call $boundingbox=`$cmdline`; if ($debuggs) { print STDERR "Call result: $boundingbox"; } # check result of gs call if ($boundingbox !~ /^%%BoundingBox/m) { die "Error: Could not determine bounding box!\n", "I suppose $ghostscriptname had some trouble interpreting the postscript-file $infname. Exiting now.\n"; } $boundingbox =~ /^%%HiResBoundingBox:\s*(.*)/m; if (defined($1)) # HiResBoundingBox given { ($hcBBllx,$hcBBlly,$hcBBurx,$hcBBury,$dummy)= split(/\s/,$1); $hiresboundingbox="%%HiResBoundingBox: $hcBBllx $hcBBlly $hcBBurx $hcBBury\n"; $cBBllx = floor($hcBBllx); $cBBlly = floor($hcBBlly); $cBBurx = ceil($hcBBurx); $cBBury = ceil($hcBBury); } else { #use normal BoundingBox $boundingbox =~ /^%%.*BoundingBox:\s*(.*)/; ($cBBllx,$cBBlly,$cBBurx,$cBBury,$dummy)= split(/\s/,$1); } # if loose BB is requested # apply changes to resulting bounding box if needed if ($looseBB ne '') { if ($cBBllx > 0) { $cBBllx--; } if ($cBBlly > 0) { $cBBlly--; } $cBBurx++; $cBBury++; if ($hcBBllx-$hiresprecision >= 0.0) { $hcBBllx-= $hiresprecision; } if ($hcBBlly-$hiresprecision >= 0.0) { $hcBBlly-= $hiresprecision; } $hcBBurx+= $hiresprecision; $hcBBury+= $hiresprecision; $hiresboundingbox="%%HiResBoundingBox: $hcBBllx $hcBBlly $hcBBurx $hcBBury\n"; } if ($cBBllx < 0 || $cBBlly < 0) { if (!$quiet) { print STDERR "WARNING! Your drawing had a negative Bounding Box which is deprecated and may cause problems!. I'll shift it.\n"; } $translate_x= -int($cBBllx); $translate_y= -int($cBBlly); $cBBllx=0; $cBBurx= $cBBurx + $translate_x; $cBBlly=0; $cBBury= $cBBury + $translate_y; $hcBBurx= $hcBBurx + $hcBBllx; $hcBBury= $hcBBury + $hcBBlly; $hcBBllx= 0; $hcBBlly= 0; $hiresboundingbox="%%HiResBoundingBox: $hcBBllx $hcBBlly $hcBBurx $hcBBury\n"; $translation="$translate_x $translate_y translate"; $translatecmd="-c \'$translation\'"; } $boundingbox = "%%BoundingBox: $cBBllx $cBBlly $cBBurx $cBBury\n"; if (!$quiet) { print STDERR "ready. $boundingbox" }; $before_startps= 1; $inserted_prolog= 0; $prolog_passed= 0; ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## -- Create output file -- ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (!$quiet) { print STDERR "Creating output file $outfname ... "; } if (!$forceoverwrite and -s "$outfname") { die "$prgname: Sorry, file named $outfname already exists,", " will not overwrite it.\n", " You will have to use the -f option, delete it or rename it", " before running $prgname again.\n"; } else { open($outfhandle,">$outfname") or die "Can't open file $outfname for writing: $!\n"; } open($tmpfhandle,"<$tmpfname") or die "Cannot open file $tmpfname for reading"; CREATEOUTPUT: while (<$tmpfhandle>) { # check whether we are in a binary section $binarysection=$allbinary || (/^(%%Begin(Binary|Data))|(beginimage)\r?\n?$/ ... /^(%%End(Binary|Data))|^(endimage)/) || (/^(doNimage)|(doclutimage)\r?\n?$/ ... /(^|~> )Z\r?\n?$/) || # Pscript_Win_Dib_L2 5.0 0 (/^beginjpeg / ... /~> endjpeg\r?\n?$/) || # Pscript_Win_Dib_L2 5.0 0 (/^pdfIm/ ... /^%-EOD-/); if ( !$binarysection ) { s/\r?\n?$//; # remove CR and/or LF at end of line if not in binary section } # check where magic Postscript header starts - skip leading binary stuff, e.g., HP PCL/PJL code if ($before_startps) { if ( /%!/ ) # This is usually the smallest magic sequence { # Note: Adobe Photoshop generated a binary heading, so ^ is not applicable # %! may be part of a binary sequence, but then control characters follow # so skip %! if non alphanumeric characters follow if ( ! /%!.*[^\w]{2,}/ ) { # some heading without two control characters found $before_startps= 0; if (! /%!PS-Adobe.*/i) # some strange programs use other magics { print STDERR "** Warning **: Weird heading line -- ",$_," -- "; } } } next CREATEOUTPUT; } else # we are hopefully in regular postscript code now { # count %%EOFs as we want to know when we got the last EOF if ( /^%%EOF\s*$/ ) { $seenEOF++; } # We should insert our own prologue including the newly calculated BoundingBox if (! $inserted_prolog) { print $outfhandle "%!PS-Adobe-$PSversion EPSF-$PSDSCversion\n"; # check if we need to rotate $transrotcmd=''; if ($rotatecmd) { if ($rotate eq $rotright) { $transrotcmd="-$cBBlly $cBBurx translate"; $boundingbox='%%BoundingBox: 0 0 ' . ($cBBury-$cBBlly) . ' ' . ($cBBurx-$cBBllx) . "\n"; if ($hiresboundingbox ne "") { $hiresboundingbox='%%HiResBoundingBox: 0 0 ' . ($hcBBury-$hcBBlly) . ' ' . ($hcBBurx-$hcBBllx) . "\n"; } } elsif ($rotate eq $rotleft) { $transrotcmd="$cBBury -$cBBllx translate"; $boundingbox='%%BoundingBox: 0 0 ' . ($cBBury-$cBBlly) . ' ' . ($cBBurx-$cBBllx) . "\n"; if ($hiresboundingbox ne "") { $hiresboundingbox= '%%HiResBoundingBox: 0 0 ' . ($hcBBury-$hcBBlly) . ' ' . ($hcBBurx-$hcBBllx) . "\n"; } } elsif ($rotate eq $rotupsidedown) { $transrotcmd="$cBBurx $cBBury translate"; $boundingbox='%%BoundingBox: 0 0 ' . ($cBBurx-$cBBllx) . ' ' . ($cBBury-$cBBlly) . "\n"; if ($hiresboundingbox ne "") { $hiresboundingbox='%%HiResBoundingBox: 0 0 ' . ($hcBBurx-$hcBBllx) . ' ' . ($hcBBury-$hcBBlly) . "\n"; } } } print $outfhandle $boundingbox; if (!defined($hiresboundingbox)) { $nohires=1; } if (defined($hiresboundingbox) && !defined($nohires)) { print $outfhandle $hiresboundingbox; } $inserted_prolog= 1; redo CREATEOUTPUT; } else # already inserted_prolog { if (! $prolog_passed) { #ignore the following lines in the prologue if ( /^%%(HiRes)?BoundingBox/ || /^%%Pages/ || /^%%BeginProlog/ || /^%%EndProlog/ || ($filterorientation && /^%%Orientation/) || ($removeDSC && /^%%.*: \(atend\)/) || ($removePreview && (/^%%BeginPreview/ ... /^%%EndPreview/)) ) { next CREATEOUTPUT; } else { if ( /^[^%].*/ || /^%%EndComments/ ) # line is not a comment { #output postscript code for proper EPS file if ($insertPScode) { print $outfhandle "%%EndComments\n", "% EPSF created by ps2eps $ver[2]\n", "%%BeginProlog\n"; } # Insert own postscript code for clipping if ($clip) { if (!defined($nohires)) { printf $outfhandle "newpath %f %f moveto %f %f lineto %f %f lineto %f %f lineto closepath clip\n",$hcBBllx,$hcBBlly,$hcBBurx,$hcBBlly,$hcBBurx,$hcBBury,$hcBBllx,$hcBBury; } else { printf $outfhandle "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto closepath clip\n",$cBBllx,$cBBlly,$cBBurx,$cBBlly,$cBBurx,$cBBury,$cBBllx,$cBBury; } } #endif clip if ($rotate ne '') { print $outfhandle "$transrotcmd\n"; print $outfhandle "$rotate\n"; } if ($translation ne '') { print $outfhandle "$translation\n"; } #insert surrounding postscript code if ($insertPScode) { print $outfhandle "save\n", "countdictstack\n", "mark\n", "newpath\n", "/showpage {} def\n", "/setpagedevice {pop} def\n", "%%EndProlog\n", "%%Page 1 1\n"; } $prolog_passed= 1; if (/^%%EndComments/) { next CREATEOUTPUT; } } #endif line is not a comment } #end else } #endif (we are in the prologue section) else #we are in the main part of postscript file { #end of postscript file reached? #Usually the DSC %%EOF signifies the end if ( eof($tmpfhandle) || ($ignoreEOFDSC == 0 && /^%%EOF\s*$/ && $seenEOF == $totalEOFDSC) || ( $trailerseen && /^II\*\000.*/ ) ) { #do not forget to print last line if not terminated by LF if ( eof($tmpfhandle) && !/^$/ && !/^%%EOF\s*$/ ) # do not insert %%EOF twice { print $outfhandle $_,"\n"; } #add appropriate trailer if ($insertPScode) { print $outfhandle "%%Trailer\n", "cleartomark\n", "countdictstack\n", "exch sub { end } repeat\n", "restore\n", "%%EOF\n"; } last CREATEOUTPUT; } # stop output # Trailer comment seen? if ( /^%%Trailer\s*$/ ) { $trailerseen=1; } else { if (!/^\s*$/) #non empty lines follow { $trailerseen=0; } } # check for trigger if (defined($triggerstring) && /^$triggerstring$/) { $trigger= 1; }; # remove complete lines if one of the expression matches if ( !$binarysection # only when not in binary section && ( ($removePreview && (/^%%BeginPreview/ ... /^%%EndPreview/)) || # no preview (defined($rangefilter_begin) && (/$rangefilter_begin/ ... /$rangefilter_end/) && (!(/$exclude_rangefilter_begin/ ... /$exclude_rangefilter_end/)) ) || (defined($triggered_rangefilter_begin) && defined($triggered_rangefilter_end) && $trigger && (/$triggered_rangefilter_begin/ ... /$triggered_rangefilter_end/) ) || /$linefilter/ # lines by linefilter || ($removeDSC && (/^%( |!)(\w )+/ || /^%%([A-Za-z]+\s)/)) # any type of structured comment || ($removeADO && (/^statusdict begin.*ProductName.*print product print.*flush end\r?\n?$/ || /^\(%%\[\s*(Page:.*|LastPage)\s*\]%%\)\s*=\s*\w*\s*\r?\n?/ )) || /^$/ # empty lines ) ) { next CREATEOUTPUT; } # replacement if ( defined($fixsearchpat) ) { #if (/$fixsearchpat/) { print STDERR "**filter** before:",$_,"\n"; } #if (s/$fixsearchpat/$fixreplacepat/) { print STDERR "**filter** after:",$_,"\n";} s/$fixsearchpat/$fixreplacepat/; } # sanity check for potential dangerous commands if ( /(^|\s)(clear|erasepage|initmatrix|initclip|initgraphics|startjob|cleardictstack|setmatrix|setpagedevice|copypage|grestoreall|exitserver|quit)(\s|$)/ ) { $notsane= 1; #print STDERR "Warning: dangerous command in line: ",$_,"\n"; } } # end else (this is main part) # Output the postscript line to result file print $outfhandle $_; if (!$binarysection) { print $outfhandle "\n"; # terminate line with LF } } # end else prolog_passed } # end else inserted_prolog } # end while CREATEOUTPUT close($tmpfhandle); if ($tmpfname ne $infname) { unlink "$tmpfname"; } #remove temporary file close ($outfhandle); # print warning if magic sequence not found if ( $before_startps ) { print STDERR "\n ** Error!! **: could not identify begin of postscript code in file $infname, please check header line!\n First line should start with %!. No output generated.\n"; } if (!$quiet) { print STDERR "ready.\n"; } if ($warnings and $notsane and !$quiet) { print STDERR "** Warning **: EPS-output for $infname is not sane, at least one\n", "of the following commands was still present:\n", "clear erasepage initmatrix initclip initgraphics startjob\n", "cleardictstack setmatrix setpagedevice copypage grestoreall\n", "exitserver quit\n"; } } #end while PROCESSFILE # ---- end of perl-script ------- ps2eps/LICENSE.txt0000644000570200017500000004312711437142075013133 0ustar blessbless GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ps2eps/doc/0000755000570200017500000000000011437142075012046 5ustar blessblessps2eps/doc/man/0000755000570200017500000000000011437142075012621 5ustar blessblessps2eps/doc/man/man1/0000755000570200017500000000000011437142075013455 5ustar blessblessps2eps/doc/man/man1/ps2eps.10000644000570200017500000004072011437142075014756 0ustar blessbless.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "PS2EPS" "1" "31 August 2010" "" "" .SH NAME ps2eps \- convert PostScript to EPS (Encapsulated PostScript) files .SH SYNOPSIS \fBps2eps\fR [ \fB-f\fR ] [ \fB-q\fR ] [ \fB-N\fR ] [ \fB-O\fR ] [ \fB-n\fR ] [ \fB-P\fR ] [ \fB-c\fR ] [ \fB-C\fR ] [ \fB-m\fR ] [ \fB-B\fR ] [ \fB-E\fR ] [ \fB-s \fIpagedim\fB\fR ] [ \fB-t \fIoffset\fB\fR ] [ \fB-r \fIresolution\fB\fR ] [ \fB-R \fI+|-|^\fB\fR ] [ \fB-l\fR ] [ \fB-g\fR ] [ \fB-H\fR ] [ \fB-d\fR ] [ \fB-h|--help\fR ] [ \fB-a\fR ] [ \fB-W\fR ] [ \fB-L\fR ] [ \fB-V|--version\fR ] [ \fB--\fR ] [ \fB\fIpsfile1\fB\fR ] [ \fB\fIpsfile2\fB\fR ] [ \fB\fI\&...\fB\fR ] .SH "DESCRIPTION" .PP This manual page documents \fBps2eps\fR version 1.68. .PP \fBps2eps\fR is a tool (written in Perl) to produce Encapsulated PostScript Files (EPS/EPSF) from usual one-paged Postscript documents. It calculates correct Bounding Boxes for those EPS files and filters some special postscript command sequences that can produce erroneous results on printers. EPS files are often needed for including (scalable) graphics of high quality into TeX/LaTeX (or even Word) documents. .PP Without any argument, ps2eps reads from standard input and writes to standard output. If filenames are given as arguments they are processed one by one and output files are written to filenames with extension \fI\&.eps\fR\&. If input filenames have the extension \fI\&.ps\fR or \fI\&.prn\fR, this extension is replaced with \fI\&.eps\fR\&. In all other cases \fI\&.eps\fR is appended to the input filename. Please note that PostScript files for input should contain only one single page (you can possibly use the \fBpsselect\fR from the psutils package to extract a single page from a document that contains multiple pages). .PP If BoundingBox in output seems to be wrong, please try options \fB--size\fR or \fB--ignoreBB\fR\&. See also section TROUBLESHOOTING. .SH "OPTIONS" .PP \fBps2eps\fR follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB-h, --help \fR Show summary of options. .TP \fB-V, --version \fR Show version of program. .TP \fB-f, --force \fR Force overwriting existing files. \fBps2eps\fR will not overwrite files by default to avoid deleting original EPS files accidently. .TP \fB-q, --quiet \fR quiet operation (no output while processing files, except errors). .TP \fB-N, --noinsert \fR do not insert any postscript code. Normally a few postscript instructions are added around the original postscript code by \fBps2eps\fR which can be turned off by this option. .TP \fB-O, --preserveorientation \fR do not filter %%Orientation: header comment. .TP \fB-n, --nofix \fR do not try to fix postscript code by filtering some instructions. .TP \fB-P, --removepreview \fR remove preview image (smaller file, but no preview anymore). .TP \fB-F, --fixps \fR fix postscript code unconditionally. Otherwise, filtering is usually triggered by detection of certain drivers only. .TP \fB-c, --comments \fR preserve document structure comments. .TP \fB-C, --clip \fR insert postscript code for clipping. Unless \fB--nohires\fR is specified, the HiResBoundingBox (enlarged by 0.1 points) is used for clipping. .TP \fB-m, --mono \fR use black/white bitmap as base for calculation (default: off). .TP \fB-s, --size=pagedim \fR where pagedim is a pre-defined standard page size (e.g., a4,a0,b0,letter,...) or explicitly specified in a format pagedim:=\fIX\fRx\fIY\fR[cm|in], where \fIX\fR and \fIY\fR are numbers (floating points are accepted) followed by units centimeter (cm) or inch (in), (default: cm). Use \fB--size=list\fR to list pre-defined pagesizes. See also environment variable PS2EPS_SIZE\&. .TP \fB-t, --translate=x,y \fR specify an x,y offset (may be negative) in postscript points (1/72 dpi) for drawing. This option may be required if your drawing has negative coordinates which usually lets ghostscript cut the negative part of your picture, because it starts to render at positive coordinates. The resulting output will also be shifted. .TP \fB-r, --resolution=dpi \fR specify a resolution in dpi (dots per inch) for drawing under ghostscript. Default resolution is 144 dpi which is the double of the typical 72 dpi. This option may help if there is a hardware dependent resolution encoded in the postscript, e.g., 600dpi. Example: \fBps2eps -l -r 600 test.ps\fR .TP \fB-R, --rotate=direction \fR This option rotates the resulting EPS output. The parameter direction determines the direction of rotation: + means +90 degrees (clockwise),- means -90 degrees (counter-clockwise), and ^ means 180 degrees (up-side down). .TP \fB-l, --loose \fR expand the original tight bounding box by one point in each direction. .TP \fB-B, --ignoreBB \fR do not use existing bounding box as page size for rendering. .TP \fB-E, --ignoreEOF \fR do not use %%EOF as hint for end of file. Otherwise, \fBps2eps\fR assumes that postscript code ends after the last %%EOF comment, because some drivers add trailing binary ``garbage'' code which gets deleted by \fBps2eps\fR by default. .TP \fB-g, --gsbbox \fR use internal bbox device of ghostscript instead of the external C program \fBbbox\fR\&. The internal bbox device of ghostscript generates different values (sometimes even incorrect), so using the provided \fBbbox\fR should be more robust. See also environment variable PS2EPS_GSBBOX\&. .TP \fB-H, --nohires \fR do not generate a %%HiResBoundingBox comment for output. .TP \fB-a, --accuracy \fR increase the accuracy by turning subsample antialiasing on (may be slower) .TP \fB-L, --license \fR show licensing information. .TP \fB-d, --debuggs \fR show ghostscript call. This may be helpful for solving problems that occur during a ghostscript call. .TP \fB-W, --warnings \fR show warnings about sanity of generated EPS file. Certain postscript commands should not be contained in an EPS file. With this option set \fBps2eps\fR will issue a warning if it detects at least one of them. .SH "TROUBLESHOOTING" .PP Based on the given postscript source code (in most cases generated by some postscript printer driver) there are many potential obstacles or problems that may occur when trying to create proper EPS files. Please read this section carefully to be aware of common pitfalls. .SS "INCOMPLETE/CLIPPED IMAGES" .PP or how to determine the right size for ghostscript. .PP If you have documents that are larger than your ghostscript default (usually A4 or US letter), you have to specify the page dimensions explicitly using the \fB-s\fR option. Otherwise your EPS might be cut off during rasterizing by ghostscript resulting in a wrongly calculated bounding box. You can pass all pre-defined page sizes to \fB-s\fR that ghostscript understands. These are currently: 11x17, ledger, legal, letter, lettersmall, archA, archB, archC, archD, archE a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, isob0, isob1, isob2, isob3, isob4, isob5, isob6, b0, b1, b2, b3, b4, b5, c0, c1, c2, c3, c4, c5, c6, jisb0, jisb1, jisb2, jisb3, jisb4, jisb5, jisb6, flsa, flse, halfletter. Unfortunately, all sizes are currently only available in portrait orientation (not landscape). .PP By default, \fBps2eps\fR uses an already given %%BoundingBox from the source file, which often corresponds to the size of the physical page format for which the document was printed. However, you should be aware that this already specified bounding box may be not correct, thus resulting in a wrongly cropped (or even no usable) \fI\&.eps\fR-file. \fBps2eps\fR can only do as good as ghostscript does in rendering the original postscript file (though \fBps2eps\fR even works with negative and fractional values are contained in the original bounding box by using automatic translation). Therefore, if the given bounding box is to small or incorrect anyway, you can ignore the existing bounding box with the \fB-B\fR option, which will cause ghostscript to use its internal default size (or use \fB-s\fR). However, if the BoundingBox has negative coordinates, which is not allowed by the specification, \fBps2eps\fR will shift the output to positive values. .PP Hint: to avoid rotating the picture if you have the original drawing in landscape format, you may use the ``Encapsulated Postscript'' option in the printer driver which should generate an EPS file (but with a bounding box of the sheet size!). But some Windows printer drivers are drawing the image with an offset from the bottom of the portrait page, so that a part of it is drawn outside the landscape oriented page. In this case, you'll have to specify a square size of the page using the maximum length, e.g., 29.7cm x 29.7cm for an A4 page. .SS "CLIPPING" .PP or why gets some of my text deleted above the included \fI\&.eps\fR file? .PP Some postscript drivers draw a white rectangle from the top left corner of the page to the right lower corner of the object. This may erase some or even all text above your imported/included EPS file, which is very annoying. In order to prevent this, most programs have a clipping option for imported \fI\&.eps\fR files (within LaTeX you can use \\includegraphics*{}) for this purpose. If this is unfortunately not the case, you can use the \fB-C\fR option of \fBps2eps\fR which will (hopefully) do it for you. Unfortunately, PScript.dll 5.2 (Windows XP) introduced new very badly behaving Postscript code (initclip) which will even override the outer clipping! Thus, a new filter had to be installed in \fBps2eps\fR which will fix it. .PP However, because most programs clip directly on the bounding box, you still may loose some pixels of your image, because the bounding box is described in the coarse resolution of postscript points, i.e. 72 dpi. In order to prevent this, you can use the \fB-l\fR option or \fB-C\fR option (for the latter, clipping by the importing program should be disabled then) to allow for a 1 point larger bounding box. \fB-C\fR clips around a 1 point enlarged bounding box and \fB-l\fR enlarges the bounding box values by 1 point (you can also combine both options). .SS "INCLUDED FILTERS" .PP Some postscript sequences, e.g., for using specific printer features (featurebegin ...), are not working well within an \fI\&.eps\fR file, so \fBps2eps\fR tries to filter them out. But please note that filters for postscript code may not work properly for your printer driver (\fBps2eps\fR was mainly tested with HP and Adobe printer drivers, although it may work for all printers using the PScript.dll). In this case you can try to turn of filtering by using option \fB-n\fR, or try to find the bad sequence in the postscript code and adapt the filter rule in the \fBps2eps\fR script (variables $linefilter, $rangefilter_begin, $rangefilter_end; linefilter is an expression for filtering single lines, rangefilter_... are expressions that filter all lines between a pattern matching $rangefilter_begin and $rangefilter_end; drop me an e-mail with your modifications). However, things may change as the printer drivers (e.g., PScript.dll) or postscript language evolve. .PP Some applications or drivers generate postscript code with leading or trailing binary code, which often confuses older postscript interpreters. \fBps2eps\fR tries to remove such code, but it may sometimes make a wrong guess about start and end of the real postscript code (drop me an e-mail with a zipped postscript source, see section BUGS). .PP Comment lines or even blank lines are removed (which is the default to make .eps files smaller), which may corrupt your output. Please check the next section how to fix this. \fBps2eps\fR removes blank lines and also (carriage ceturn ``\\r'') at the end of lines. However, nicely formatted postscript code gives a hint by using ``%%BeginBinary'' ``%%EndBinary'' comments. When \fBps2eps\fR detects these comments it will refrain from any filtering action within the marked binary sections. .PP \fBps2eps\fR filters also %%Orientation: comments by default (you can use option \fB-O\fR to turn off filtering), because ghostscript may ``automagically'' rotate images when generating PDF images, which is not desired in most cases. Hint: you can turn off that feature in ghostscript unconditionally by specifying -dAutoRotatePages=/None. .SS "CORRUPTED OUTPUT" .PP Some postscript code may get corrupted when comment lines or even blank lines are removed (which is the default to make .eps files smaller), because those files may contain encoded images which also have a % as first character in a line or use a special comment as end of image delimiter. If this is the case, use the \fB-c\fR option to prevent filtering comments. .SS "COLOR AND MEMORY" .PP \fBps2eps\fR supports colored postscript, consequently letting ghostscript consume more resources for drawing its bitmap (roughly 6MBytes for an A4 page). \fBbbox\fR is reading the bitmap line by line so it consumes only minimal memory. If you experience problems with memory consumption of ghostscript, you may use the \fB-m\fR option for using a monochrome image. But this will probably result in wrongly determined bounding boxes with colored images, because ghostscript has to do black/white dithering and may thus suppress objects drawn in light colors. .PP Another option in case of memory problems and too long run times is to use the much more memory efficient internal ghostscript bbox by using the \fB-g\fR option. .SH "ENVIRONMENT VARIABLES" .PP Please note that a command line option always takes precedence over the related environment variable. .PP The environment variable PS2EPS_SIZE can be used to specify a default page size and take any argument that \fB--size\fR accepts. Examples: \fBexport PS2EPS_SIZE=a0\fR (bash-like syntax) or \fBsetenv PS2EPS_SIZE letter\fR (csh syntax). .PP If the environment variable PS2EPS_GSBBOX is set the internal bbox device of ghostscript will be used instead of the external command \fBbbox\fR\&. Examples: \fBexport PS2EPS_GSBBOX=true\fR (bash-like syntax) or \fBsetenv PS2EPS_GSBBOX 1\fR (csh syntax). .SH "EXAMPLES" .PP The usual call is simply: \fBps2eps -l \fIfile\fB\fR .PP A relatively failsafe call would be (if your postscript is smaller than iso b0 [100cm x 141.4cm] and you have a fast computer with enough memory): \fBps2eps -l -B -s b0 -c -n \fIfile\fB\fR .PP If output is not correct try: \fBps2eps -l -B -s b0 -F \fIfile\fB\fR .SH "AUTHOR" .PP \fBps2eps\fR was written by Roland Bless. .SS "WHY?" .PP Other programs like \fBps2epsi\fR do not calculate the bounding box always correctly (because the values are put on the postscript stack which may get corrupted by bad postscript code) or rounded it off so that clipping the EPS cut off some part of the image. \fBps2eps\fR uses a double precision resolution of 144 dpi and appropriate rounding to get a proper bounding box. The internal bbox device of ghostscript generates different values (sometimes even incorrect), so using the provided \fBbbox\fR should be more robust. However, because normal clipping has only a resolution of 1/72dpi (postscript point), the clipping process may still erase parts of your EPS image. In this case please use the \fB-l\fR option to add an additional point of white space around the tight bounding box. .SS "ACKNOWLEDGMENTS" .PP Some people contributed code or suggestions to improve \fBps2eps\fR\&. Here are at least some names (sorry if I forgot your name): Christophe Druet, Hans Ecke, Berend Hasselman, Erik Joergensen, Koji Nakamaru, Hans Fredrik Nordhaug, Michael Sharpe. Special thanks goes to Michael Sharpe from UCSD who suggested a lot of useful features for ps2eps and who fixed bbox to become more precise and robust. .PP An earlier version of this manual page was originally written by Rafael Laboissiere for the Debian system. Thank you Rafael! .PP Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. .SH "BUGS" .PP If you experience problems, please check carefully all hints in the section TROUBLESHOOTING first. Otherwise, check for an updated version at or send a gzipped file of relevant postscript source code with your error description and \fBps2eps\fR version number to (please allow some time to reply). .SH "SEE ALSO" .PP bbox (1), gs (1), ps2epsi (1) ps2eps/doc/man/man1/bbox.10000644000570200017500000000441511437142075014475 0ustar blessbless.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "BBOX" "1" "31 August 2010" "" "" .SH NAME bbox \- prints out the bounding box of a rawppm or rawpbm image .SH SYNOPSIS \fBbbox\fR [ \fB-l\fR ] [ \fB-r\fR ] [ \fB-h\fR ] [ \fB-V\fR ] [ \fB\fIrawpbmfile\fB\fR ] .SH "DESCRIPTION" .PP \fBbbox\fR reads a rawppm or rawpbm file and prints out the bounding box of the image (as postscript comment and in postscript points, i.e. 1/72dpi) as well as the high resolution bounding box. Input is read from standard input if no filename is specified. Example output: .nf %%BoundingBox: 12 253 829 837 %%HiResBoundingBox: 12.500000 253.000000 828.500000 837.00000 .fi .PP \fBbbox\fR has only very limited memory requirements as it reads the input line by line and thus needs to store only one picture line in memory. .SH "OPTIONS" .TP \fB-h | --help \fR Show summary of options. .TP \fB-V \fR Show version of program. .TP \fB-r \fR resolution of picture in dpi .TP \fB-l \fR loose bounding box (integer bounding box is expanded by 1 point, hires bounding box is expanded by 0.5 points) .SH "SEE ALSO" .PP ps2eps (1) .SH "AUTHOR" .PP \fBbbox\fR was written by Roland Bless. .SS "ACKNOWLEDGMENTS" .PP Special thanks goes to Michael Sharpe from UCSD who suggested a lot of improvements for bbox to become more precise and robust, especially for small drawings. .PP An earlier version of this manual page was originally written by Rafael Laboissiere for the Debian system. Thank you Rafael! Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. .SH "BUGS" .PP Though the code is quite small and the probability for bugs is now small, there may be some left somewhere between the lines. In case you find one, please send a short description with \fBbbox\fR version number to (please allow some time to reply). ps2eps/doc/html/0000755000570200017500000000000011437142075013012 5ustar blessblessps2eps/doc/html/bbox.html0000644000570200017500000000716111437142075014637 0ustar blessbless bbox

bbox

Name

bbox --  prints out the bounding box of a rawppm or rawpbm image

Synopsis

bbox [-l] [-r] [-h] [-V] [rawpbmfile]

DESCRIPTION

bbox reads a rawppm or rawpbm file and prints out the bounding box of the image (as postscript comment and in postscript points, i.e. 1/72dpi) as well as the high resolution bounding box. Input is read from standard input if no filename is specified. Example output:

	  %%BoundingBox: 12 253 829 837
	  %%HiResBoundingBox: 12.500000 253.000000 828.500000 837.00000
	  

bbox has only very limited memory requirements as it reads the input line by line and thus needs to store only one picture line in memory.

OPTIONS

-h | --help

Show summary of options.

-V

Show version of program.

-r

resolution of picture in dpi

-l

loose bounding box (integer bounding box is expanded by 1 point, hires bounding box is expanded by 0.5 points)

SEE ALSO

ps2eps (1)

AUTHOR

bbox was written by Roland Bless.

ACKNOWLEDGMENTS

Special thanks goes to Michael Sharpe from UCSD who suggested a lot of improvements for bbox to become more precise and robust, especially for small drawings.

An earlier version of this manual page was originally written by Rafael Laboissiere for the Debian system. Thank you Rafael! Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.

BUGS

Though the code is quite small and the probability for bugs is now small, there may be some left somewhere between the lines. In case you find one, please send a short description with bbox version number to (please allow some time to reply).

ps2eps/doc/html/ps2eps.html0000644000570200017500000005733311437142075015127 0ustar blessbless ps2eps

ps2eps

Name

ps2eps --  convert PostScript to EPS (Encapsulated PostScript) files

Synopsis

ps2eps [-f] [-q] [-N] [-O] [-n] [-P] [-c] [-C] [-m] [-B] [-E] [-s pagedim] [-t offset] [-r resolution] [-R +|-|^] [-l] [-g] [-H] [-d] [-h|--help] [-a] [-W] [-L] [-V|--version] [--] [psfile1] [psfile2] [...]

DESCRIPTION

This manual page documents ps2eps version 1.68.

ps2eps is a tool (written in Perl) to produce Encapsulated PostScript Files (EPS/EPSF) from usual one-paged Postscript documents. It calculates correct Bounding Boxes for those EPS files and filters some special postscript command sequences that can produce erroneous results on printers. EPS files are often needed for including (scalable) graphics of high quality into TeX/LaTeX (or even Word) documents.

Without any argument, ps2eps reads from standard input and writes to standard output. If filenames are given as arguments they are processed one by one and output files are written to filenames with extension .eps. If input filenames have the extension .ps or .prn, this extension is replaced with .eps. In all other cases .eps is appended to the input filename. Please note that PostScript files for input should contain only one single page (you can possibly use the psselect from the psutils package to extract a single page from a document that contains multiple pages).

If BoundingBox in output seems to be wrong, please try options --size or --ignoreBB. See also section TROUBLESHOOTING.

OPTIONS

ps2eps follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below.

-h, --help

Show summary of options.

-V, --version

Show version of program.

-f, --force

Force overwriting existing files. ps2eps will not overwrite files by default to avoid deleting original EPS files accidently.

-q, --quiet

quiet operation (no output while processing files, except errors).

-N, --noinsert

do not insert any postscript code. Normally a few postscript instructions are added around the original postscript code by ps2eps which can be turned off by this option.

-O, --preserveorientation

do not filter %%Orientation: header comment.

-n, --nofix

do not try to fix postscript code by filtering some instructions.

-P, --removepreview

remove preview image (smaller file, but no preview anymore).

-F, --fixps

fix postscript code unconditionally. Otherwise, filtering is usually triggered by detection of certain drivers only.

-c, --comments

preserve document structure comments.

-C, --clip

insert postscript code for clipping. Unless --nohires is specified, the HiResBoundingBox (enlarged by 0.1 points) is used for clipping.

-m, --mono

use black/white bitmap as base for calculation (default: off).

-s, --size=pagedim

where pagedim is a pre-defined standard page size (e.g., a4,a0,b0,letter,...) or explicitly specified in a format pagedim:=XxY[cm|in], where X and Y are numbers (floating points are accepted) followed by units centimeter (cm) or inch (in), (default: cm). Use --size=list to list pre-defined pagesizes. See also environment variable PS2EPS_SIZE.

-t, --translate=x,y

specify an x,y offset (may be negative) in postscript points (1/72 dpi) for drawing. This option may be required if your drawing has negative coordinates which usually lets ghostscript cut the negative part of your picture, because it starts to render at positive coordinates. The resulting output will also be shifted.

-r, --resolution=dpi

specify a resolution in dpi (dots per inch) for drawing under ghostscript. Default resolution is 144 dpi which is the double of the typical 72 dpi. This option may help if there is a hardware dependent resolution encoded in the postscript, e.g., 600dpi. Example: ps2eps -l -r 600 test.ps

-R, --rotate=direction

This option rotates the resulting EPS output. The parameter direction determines the direction of rotation: + means +90 degrees (clockwise),- means -90 degrees (counter-clockwise), and ^ means 180 degrees (up-side down).

-l, --loose

expand the original tight bounding box by one point in each direction.

-B, --ignoreBB

do not use existing bounding box as page size for rendering.

-E, --ignoreEOF

do not use %%EOF as hint for end of file. Otherwise, ps2eps assumes that postscript code ends after the last %%EOF comment, because some drivers add trailing binary "garbage" code which gets deleted by ps2eps by default.

-g, --gsbbox

use internal bbox device of ghostscript instead of the external C program bbox. The internal bbox device of ghostscript generates different values (sometimes even incorrect), so using the provided bbox should be more robust. See also environment variable PS2EPS_GSBBOX.

-H, --nohires

do not generate a %%HiResBoundingBox comment for output.

-a, --accuracy

increase the accuracy by turning subsample antialiasing on (may be slower)

-L, --license

show licensing information.

-d, --debuggs

show ghostscript call. This may be helpful for solving problems that occur during a ghostscript call.

-W, --warnings

show warnings about sanity of generated EPS file. Certain postscript commands should not be contained in an EPS file. With this option set ps2eps will issue a warning if it detects at least one of them.

TROUBLESHOOTING

Based on the given postscript source code (in most cases generated by some postscript printer driver) there are many potential obstacles or problems that may occur when trying to create proper EPS files. Please read this section carefully to be aware of common pitfalls.

Incomplete/Clipped Images

or how to determine the right size for ghostscript.

If you have documents that are larger than your ghostscript default (usually A4 or US letter), you have to specify the page dimensions explicitly using the -s option. Otherwise your EPS might be cut off during rasterizing by ghostscript resulting in a wrongly calculated bounding box. You can pass all pre-defined page sizes to -s that ghostscript understands. These are currently: 11x17, ledger, legal, letter, lettersmall, archA, archB, archC, archD, archE a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, isob0, isob1, isob2, isob3, isob4, isob5, isob6, b0, b1, b2, b3, b4, b5, c0, c1, c2, c3, c4, c5, c6, jisb0, jisb1, jisb2, jisb3, jisb4, jisb5, jisb6, flsa, flse, halfletter. Unfortunately, all sizes are currently only available in portrait orientation (not landscape).

By default, ps2eps uses an already given %%BoundingBox from the source file, which often corresponds to the size of the physical page format for which the document was printed. However, you should be aware that this already specified bounding box may be not correct, thus resulting in a wrongly cropped (or even no usable) .eps-file. ps2eps can only do as good as ghostscript does in rendering the original postscript file (though ps2eps even works with negative and fractional values are contained in the original bounding box by using automatic translation). Therefore, if the given bounding box is to small or incorrect anyway, you can ignore the existing bounding box with the -B option, which will cause ghostscript to use its internal default size (or use -s). However, if the BoundingBox has negative coordinates, which is not allowed by the specification, ps2eps will shift the output to positive values.

Hint: to avoid rotating the picture if you have the original drawing in landscape format, you may use the "Encapsulated Postscript" option in the printer driver which should generate an EPS file (but with a bounding box of the sheet size!). But some Windows printer drivers are drawing the image with an offset from the bottom of the portrait page, so that a part of it is drawn outside the landscape oriented page. In this case, you'll have to specify a square size of the page using the maximum length, e.g., 29.7cm x 29.7cm for an A4 page.

Clipping

or why gets some of my text deleted above the included .eps file?

Some postscript drivers draw a white rectangle from the top left corner of the page to the right lower corner of the object. This may erase some or even all text above your imported/included EPS file, which is very annoying. In order to prevent this, most programs have a clipping option for imported .eps files (within LaTeX you can use \includegraphics*{}) for this purpose. If this is unfortunately not the case, you can use the -C option of ps2eps which will (hopefully) do it for you. Unfortunately, PScript.dll 5.2 (Windows XP) introduced new very badly behaving Postscript code (initclip) which will even override the outer clipping! Thus, a new filter had to be installed in ps2eps which will fix it.

However, because most programs clip directly on the bounding box, you still may loose some pixels of your image, because the bounding box is described in the coarse resolution of postscript points, i.e. 72 dpi. In order to prevent this, you can use the -l option or -C option (for the latter, clipping by the importing program should be disabled then) to allow for a 1 point larger bounding box. -C clips around a 1 point enlarged bounding box and -l enlarges the bounding box values by 1 point (you can also combine both options).

Included Filters

Some postscript sequences, e.g., for using specific printer features (featurebegin ...), are not working well within an .eps file, so ps2eps tries to filter them out. But please note that filters for postscript code may not work properly for your printer driver (ps2eps was mainly tested with HP and Adobe printer drivers, although it may work for all printers using the PScript.dll). In this case you can try to turn of filtering by using option -n, or try to find the bad sequence in the postscript code and adapt the filter rule in the ps2eps script (variables $linefilter, $rangefilter_begin, $rangefilter_end; linefilter is an expression for filtering single lines, rangefilter_... are expressions that filter all lines between a pattern matching $rangefilter_begin and $rangefilter_end; drop me an e-mail with your modifications). However, things may change as the printer drivers (e.g., PScript.dll) or postscript language evolve.

Some applications or drivers generate postscript code with leading or trailing binary code, which often confuses older postscript interpreters. ps2eps tries to remove such code, but it may sometimes make a wrong guess about start and end of the real postscript code (drop me an e-mail with a zipped postscript source, see section BUGS).

Comment lines or even blank lines are removed (which is the default to make .eps files smaller), which may corrupt your output. Please check the next section how to fix this. ps2eps removes blank lines and also <CR> (carriage ceturn "\r") at the end of lines. However, nicely formatted postscript code gives a hint by using "%%BeginBinary" "%%EndBinary" comments. When ps2eps detects these comments it will refrain from any filtering action within the marked binary sections.

ps2eps filters also %%Orientation: comments by default (you can use option -O to turn off filtering), because ghostscript may "automagically" rotate images when generating PDF images, which is not desired in most cases. Hint: you can turn off that feature in ghostscript unconditionally by specifying -dAutoRotatePages=/None.

Corrupted Output

Some postscript code may get corrupted when comment lines or even blank lines are removed (which is the default to make .eps files smaller), because those files may contain encoded images which also have a % as first character in a line or use a special comment as end of image delimiter. If this is the case, use the -c option to prevent filtering comments.

Color and memory

ps2eps supports colored postscript, consequently letting ghostscript consume more resources for drawing its bitmap (roughly 6MBytes for an A4 page). bbox is reading the bitmap line by line so it consumes only minimal memory. If you experience problems with memory consumption of ghostscript, you may use the -m option for using a monochrome image. But this will probably result in wrongly determined bounding boxes with colored images, because ghostscript has to do black/white dithering and may thus suppress objects drawn in light colors.

Another option in case of memory problems and too long run times is to use the much more memory efficient internal ghostscript bbox by using the -g option.

ENVIRONMENT VARIABLES

Please note that a command line option always takes precedence over the related environment variable.

The environment variable PS2EPS_SIZE can be used to specify a default page size and take any argument that --size accepts. Examples: export PS2EPS_SIZE=a0 (bash-like syntax) or setenv PS2EPS_SIZE letter (csh syntax).

If the environment variable PS2EPS_GSBBOX is set the internal bbox device of ghostscript will be used instead of the external command bbox. Examples: export PS2EPS_GSBBOX=true (bash-like syntax) or setenv PS2EPS_GSBBOX 1 (csh syntax).

EXAMPLES

The usual call is simply: ps2eps -l file

A relatively failsafe call would be (if your postscript is smaller than iso b0 [100cm x 141.4cm] and you have a fast computer with enough memory): ps2eps -l -B -s b0 -c -n file

If output is not correct try: ps2eps -l -B -s b0 -F file

AUTHOR

ps2eps was written by Roland Bless.

WHY?

Other programs like ps2epsi do not calculate the bounding box always correctly (because the values are put on the postscript stack which may get corrupted by bad postscript code) or rounded it off so that clipping the EPS cut off some part of the image. ps2eps uses a double precision resolution of 144 dpi and appropriate rounding to get a proper bounding box. The internal bbox device of ghostscript generates different values (sometimes even incorrect), so using the provided bbox should be more robust. However, because normal clipping has only a resolution of 1/72dpi (postscript point), the clipping process may still erase parts of your EPS image. In this case please use the -l option to add an additional point of white space around the tight bounding box.

ACKNOWLEDGMENTS

Some people contributed code or suggestions to improve ps2eps. Here are at least some names (sorry if I forgot your name): Christophe Druet, Hans Ecke, Berend Hasselman, Erik Joergensen, Koji Nakamaru, Hans Fredrik Nordhaug, Michael Sharpe. Special thanks goes to Michael Sharpe from UCSD who suggested a lot of useful features for ps2eps and who fixed bbox to become more precise and robust.

An earlier version of this manual page was originally written by Rafael Laboissiere for the Debian system. Thank you Rafael!

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.

BUGS

If you experience problems, please check carefully all hints in the section TROUBLESHOOTING first. Otherwise, check for an updated version at http://www.tm.uka.de/~bless/ps2eps or send a gzipped file of relevant postscript source code with your error description and ps2eps version number to (please allow some time to reply).

SEE ALSO

bbox (1), gs (1), ps2epsi (1)

ps2eps/doc/pdf/0000755000570200017500000000000011437142075012617 5ustar blessblessps2eps/doc/pdf/ps2eps.pdf0000644000570200017500000005052511437142075014535 0ustar blessbless%PDF-1.4 %쏢 5 0 obj <> stream xYr}W̋`"¸_uRIYvRZC PKʟ_?`0ղʵ%.soϾu{}pLȷ`:,Xv̏C;H̺.nn?Y3~-}6wlp)4$D?bgշa>vY,Ϭ^ЫcNGecy]ܐBN#'?$MMvyS: &OEgv_f_ pJJCv ";֪*ەaoNWԳC7>1Rۍ#7V~\׎R&,p5_t5N 8=N '·p( GsO@FJÓ)$Hz' }7&' SHN2wCRE:BbRT>e=iHv}mR,&jZ4;^̀jy7ecz휖ʍ:ezq6`Eh\ .<}WԪ =03$;f~< Kϩp7xkU9} Z!f 'q<}h*aMwX%@I"@_ /w|4r@ѩ@&G_ sgg$C7-,CG; FΏځ;hҮqydiyP҃^侁G9iX E*~-ȋs[,w/oWkP`MѲmV5g:oyOkl:s߆"H4w#CFU+~sm/a2(غ~}j+*vÛv}لe h[7{j-۷䡺{NJJ qPPf˳2PM󎽫ղYMqj#7VuúMr!IZzYS(@h `_^o=r`v xe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IKim}E>=zz9l}syA~`*jֿl%.@svƠ㲀8"Cy%<  -*q&h/]44Tg{)ܨCJtsZ w-Y9 Bkg= JttVٵ%Y³DU$"62>mо N;9{8J]zGmhØɉpnp;Ϟ5r?%>x|B Qjy4ӥo7endstream endobj 30 0 obj 1892 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 28 0 obj <> /Contents 29 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R 28 0 R ] /Count 5 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 31 0 obj <> endobj 32 0 obj <> endobj 8 0 obj <> endobj 33 0 obj <> endobj 10 0 obj <> endobj 34 0 obj <> endobj 9 0 obj <> endobj 35 0 obj <> endobj 36 0 obj <>stream 2010-08-31T10:55:12+02:00 2010-08-31T10:55:12+02:00 groff version 1.20.1 Untitled endstream endobj 2 0 obj <>endobj xref 0 37 0000000000 65535 f 0000017414 00000 n 0000019773 00000 n 0000017327 00000 n 0000016519 00000 n 0000000015 00000 n 0000003087 00000 n 0000017479 00000 n 0000017909 00000 n 0000018238 00000 n 0000018084 00000 n 0000017520 00000 n 0000017550 00000 n 0000016679 00000 n 0000003107 00000 n 0000005903 00000 n 0000017600 00000 n 0000017630 00000 n 0000016841 00000 n 0000005924 00000 n 0000010612 00000 n 0000017680 00000 n 0000017710 00000 n 0000017003 00000 n 0000010633 00000 n 0000014513 00000 n 0000017760 00000 n 0000017790 00000 n 0000017165 00000 n 0000014534 00000 n 0000016498 00000 n 0000017840 00000 n 0000017870 00000 n 0000017991 00000 n 0000018168 00000 n 0000018319 00000 n 0000018375 00000 n trailer << /Size 37 /Root 1 0 R /Info 2 0 R /ID [<56A4BF44E4D0BADAB329FA30FF5CF346><56A4BF44E4D0BADAB329FA30FF5CF346>] >> startxref 19927 %%EOF ps2eps/doc/pdf/bbox.pdf0000644000570200017500000001152511437142075014250 0ustar blessbless%PDF-1.4 %쏢 5 0 obj <> stream xWr}WL\plmd^%&) 9"004Ū|% t)9U"=_0>MLf;|pt˒aQwX84Iɼxgg&FLj"w_k~z'!uW!zےvBoU^ w$#M6=%ly)x&֟??.f]h| ڥ3iÙiEqAխ{[ i"K~akF>ovP?or@31 uJ)Xe5e ~ȅ恞|JS'Z5@IDx醇@q#' fP  ׇm,#[>AdX7srz9~\6x P3FDˁ7M,#=d00ˎu83|hUFg2r@ТF);cazu=/MEͻWY 1v4f =+@wCZYqz/7*l5rۀrmkeP 3RI@,!a_~JEr Б::[gMeTA_UdԱF/Pi;n ^()Z6%|%'aɨK54E¾1VDeM ];`<Җv4*j :S0%a$Y|W֣(-axlscXE~jॵpAú_Vjg͔8ok)v>"uy<`zcḆdԅ01ODQE TS{ԵB0l@9vHAE?mS:#:(zmEw9f l[[WFWaC4D ]0 \Zۻm -zifV/󥪌:!MՉ/>ʦY<P1CpDGÓD{Oz]ـbw c޺o]v702í ߆g xuFZ3< fGaAɠdZq8⿤i>wb6SO+sp?˖?<>N 5ݦ_xӎÀs\cz q gÝU> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 10 0 obj <> endobj 14 0 obj <> endobj 9 0 obj <> endobj 15 0 obj <>stream 2010-08-31T10:55:12+02:00 2010-08-31T10:55:12+02:00 groff version 1.20.1 Untitled endstream endobj 2 0 obj <>endobj xref 0 16 0000000000 65535 f 0000002385 00000 n 0000004322 00000 n 0000002326 00000 n 0000002166 00000 n 0000000015 00000 n 0000002146 00000 n 0000002450 00000 n 0000002571 00000 n 0000002859 00000 n 0000002719 00000 n 0000002491 00000 n 0000002521 00000 n 0000002653 00000 n 0000002803 00000 n 0000002924 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R /ID [<125AC5F58ED9FA752D48471346C5B920><125AC5F58ED9FA752D48471346C5B920>] >> startxref 4476 %%EOF ps2eps/Latest_is_1.680000644000570200017500000000000011437142075013615 0ustar blessblessps2eps/README.txt0000644000570200017500000000306211437142075013000 0ustar blessblessDOCUMENTATION ============= Please see documentation in the manpage or doc/ sub directory. Note that the manpage may have an older version number in it, which is nothing to worry about since there may have been minor changes incorporated into ps2eps not requiring any update of the documentation. INSTALLATION ============ Please see instructions in separate text file INSTALL.txt UPDATES ======= Possibly you can find the newest version at the following URL: http://www.ipv6.tm.uka.de/~bless/ps2eps Contact information: Roland Bless, roland bless.de If you have problems, please send a gzipped file of relevant postscript code with your error description and ps2eps version number. License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------- End of README.txt --------------------------------------------------------------------------- ps2eps/Changes.txt0000644000570200017500000002757611437142075013433 0ustar blessbless---------------------------- Detailed Change Log: ---------------------------- revision 1.68 date: 2010-05-07 21:42:35 +0200; author: bless; state: Exp; lines: +3 -3; - quoted translate command string ---------------------------- revision 1.67 date: 2009-12-05 23:44:19 +0100; author: bless; state: Exp; lines: +39 -33; - quote of tmpfname for coping with spaces in filenames - added -a option - changed handling of hiresBB (now rounded to hiresprecision, by default 0.5pt) ---------------------------- revision 1.66 date: 2007-10-30 12:04:24 +0100; author: bless; state: Exp; lines: +9 -5; - added %%BeginData %%EndData as indicators for Binary Section - added new option -b (treat as binary) to prevent filtering CR/LF stuff ---------------------------- revision 1.65 date: 2007-01-24 14:19:42 +0100; author: bless; state: Exp; lines: +3 -3; - fixed help/usage formatting output ---------------------------- revision 1.64 date: 2007-01-24 13:32:59 +0100; author: bless; state: Exp; lines: +4 -4; - Year (C) update ---------------------------- revision 1.63 date: 2007-01-24 13:29:37 +0100; author: bless; state: Exp; lines: +3 -3; - Tried to make DSCfilter command more robust ---------------------------- revision 1.62 (not released) date: 2007-01-06 23:27:47 +0100; author: bless; state: Exp; lines: +11 -5; - better detection for files that have a binary heading stuff containing even %! as character sequence ---------------------------- revision 1.61 date: 2006-12-28 17:34:06 +0100; author: bless; state: Exp; lines: +5 -5; - changed year in comment and info printout only ---------------------------- revision 1.60 (not released) date: 2006-12-28 17:31:39 +0100; author: bless; state: Exp; lines: +9 -13; - incorporated changes for Windows/Cygwin detection by Karl Berry ---------------------------- revision 1.59 (not released) date: 2006-04-04 11:04:47 +0200; author: bless; state: Exp; lines: +4 -4; - removed surrounding ticks '' for -c $translation in $translatecmd (hint by Thomas Riedle) - removed useless/unsupported 2>&1 in $bboxver for Windows ---------------------------- revision 1.58 date: 2005/01/19 08:23:12; author: bless; state: Exp; lines: +8 -5 - fix for two negative offsets in translation (reported by Hans Ecke) ---------------------------- revision 1.57 date: 2005/01/19 07:59:52; author: bless; state: Exp; lines: +10 -3 - more Windows friendly checking for bbox existence ---------------------------- revision 1.56 date: 2005/01/17 12:32:54; author: bless; state: Exp; lines: +11 -3 - added -r option to specify a resolution ---------------------------- revision 1.55 date: 2005/01/14 15:28:09; author: bless; state: Exp; lines: +6 -4 - minor fixes to the -g option (thanks to Koji Nakamaru): * suppress info output if quiet option is active * more robust parsing of gs call result ---------------------------- revision 1.54 date: 2004/04/23 07:56:54; author: bless; state: Exp; lines: +4 -3 - added ^pdfIm ^%-EOD- as indicator for binary section ---------------------------- revision 1.53 date: 2004/04/01 19:28:02; author: bless; state: Exp; lines: +6 -2 - Clipping code used always hiresBB, which gave wrong results when bbox returned no hiresBB ---------------------------- revision 1.52 date: 2004/02/19 20:20:57; author: bless; state: Exp; lines: +90 -10 - added rotate option -R - changed translate in order to avoid negative BB coordinates ---------------------------- revision 1.51 date: 2004/01/25 22:02:04; author: bless; state: Exp; lines: +18 -9 - removed ^ in parsing for %! heading, because Adobe Photoshop generated a binary heading where ^%! did not work - added clipping along %%HiResBoundingBox +0.1 points - added option --nohires ---------------------------- revision 1.50 date: 2004/01/25 10:04:56; author: bless; state: Exp; lines: +158 -41 - ps2eps can now use the bbox device of ghostscript (either by option, environment variable or command line) - new environment variable PS2EPS_GSBBOX for specifying a default behavior - uses implicitly the ghostscript bbox device if external bbox command cannot be found - Added %%HiResBoundingBox output - now uses gswin32c as default for MSWin32 or cygwin platforms - added handling/passing of predefined paper sizes of ghostscript (including validity check and help) - added new environment variable PS2EPS_SIZE for default paper size - improved format checking for numerically given size - shows used page size if given while processing - shows whether it uses the bbox device of ghostscript - added use POSIX and check for OS - moved ps2eps header comment now after %%EndComments - removed looseBB option from call of bbox ---------------------------- revision 1.49 date: 2003/11/19 15:08:52; author: bless; state: Exp; lines: +83 -47 - Added -t|--translate option which allows to specify an offset for drawings - Existing Bounding Box will now be detected even if negative and fractional values are contained - Translation will happen automatically if a Bounding Box comment exists with negative offsets - Warning(s) are printed if Bounding Boxes with negative coordinates are detected - Built-in wildcard processing is only effective for non-Unix platforms ---------------------------- revision 1.48 date: 2003/11/09 17:47:47; author: bless; state: Exp; lines: +5 -5 - print help, license and version to stdout instead of stderr (incorporated patch from Rafael Laboissiere ) ---------------------------- revision 1.47 date: 2003/07/09 - different informational message for -F flag ---------------------------- revision 1.46 date: 2003/07/09 - now using Getopt::Long::Configure(), because the other way caused problems with module exports - fixsearchpat/fixreplacepat now filters initmatrix initclip initgraphics which is more generic and will hopefully fix more bad postscript code - binary section detection had missing CRLFs - binary section detection now includes PScript 4 doNimage end marker - improved pattern for ADO detection ---------------------------- revision 1.45 date: 2003/07/04 - improved processing of images for Pscript_Win_Dib_L2: comment filtering will not occur within doNimage,doclutimage,beginjpeg etc. ---------------------------- revision 1.44 date: 2003/07/03 - looseBB was not initialized - disabled use warnings since it may confuse users ---------------------------- revision 1.43 (not released) date: 2003/07/02 - deactivated triggered filter and replaced it with search/replace filter - new $filtersearchpat,$filterreplacepat combo to filter "initclip" for PScript5.dll Version 5.2 - sanity check never worked, fixed it - new option -W --warnings to allow optional sanity check - added various comments and reformatted source a little bit - changed output within option processing, --help, --version, etc. - added use warnings; - refined filter expression in $rangefilter_begin - added $exclude_rangefilter_begin and $..._end pair to preserve non PPD feature code (although DSCs are possibly removed) (this feature was integrated from my filterfeatures script) ---------------------------- revision 1.42 (not released) date: 2003/04/14 - provided more robustness if Postscript headerline is malformed ---------------------------- revision 1.41 (not released) date: 2003/03/21 - converted option processing to Getopt::Long package (based on code from Christophe Druet) - rudimentary internal wildcard support (based on code from Christophe Druet) (currently only within current directory) ---------------------------- revision 1.40 (not released) date: 2003/01/30 - added filter for Orientation: comment in header, see new option -O ---------------------------- revision 1.39 date: 2002/07/10 - changed new XP filter to triggered filter - improved processing of binary files with beginimage endimage ---------------------------- revision 1.38 (not released) date: 2002/07/09 - changed comment filtering in order to prevent image distortion - new filter for Windows XP PScript5.dll Version 5.2: Bad lines are: 0 GpPBeg NP 129 400 m 4629 400 l 4629 6400 l 129 6400 l CP eoclip 1 1 1 SC NP 128 400 m 4629 400 l 4629 6400 l 128 6400 l CP AF GSE To avoid the white rectangle deleting all the text above, it is sufficient to delete "1 1 1 SC" to "AF", however, I used eoclip as indicator for the whole sequence. ---------------------------- revision 1.37 (not released) date: 2001/10/10 - added "/setpagedevice {pop} def" to prolog in order to fix problems with pdf creation, pstricks and nested dvips output (thanks to Hans Fredrik Nordhaug for suggesting this addition) ---------------------------- revision 1.36 (not released) date: 2001/08/30 Added filter for Staroffice 5.2 Linux revision 1.35 ------------- date: 2001/08/20 13:32:36 - Improved removeADO (tolerates more spaces) ---------------------------- revision 1.34 (not released) ------------- date: 2001/08/20 12:38:22 - Improved processing of files with leading or trailing binary code - Improved processing of files with embedded binary coded images - Removes gabby diagnostic output from Adobe Printer Driver (see variable removeADO) ---------------------------- revision 1.33 (not released) ------------- date: 2001/04/25 22:42:10 - Corrected %%EOF handling (regex) once again, because of braindead Win-files with _CR_LF - Corrected handling of existing %%BoundingBox comments. Now it takes the last one seen. Should esp. work with %%BoundingBox: (atend) usage... ---------------------------- revision 1.32 (not released) ------------- date: 2001/04/06 22:31:27 - Fixed case sensitiveness when checking for suffix replacement (thanks to Erik Jrgensen) ---------------------------- revision 1.31 ------------- date: 2001/02/27 19:45:19 - Heuristic added for finding end of file by counting %%EOF comments. Now correctly treats already embedded EPS, too. Usually only trailing garbage (e.g., PCL control sequences) follows last %%EOF. However, sometimes the last %%EOF may be missing. Therefore, the behavior is switchable by new -E option. ---------------------------- revision 1.30 (not released) ------------- date: 2001/02/09 16:55:32 Just forgot the new options in usage line, corrected year in copyright ---------------------------- revision 1.29 ------------- date: 2001/02/09 15:43:28 - New first line of code for getting rid of the #! comment - EOF handling corrected, allowing better handling of already embedded eps files - New -P option to allow selective removal of embedded preview images (was previously default) - Preview images were not filtered in the prolog section (now corrected with -P) - New -N option to prevent inclusion of any surrounding postscript code ---------------------------- revision 1.28 ------------- date: 2000/10/13 09:51:55 \n was missing at altered clipping bounding box ---------------------------- revision 1.27 (not released) date: 2000/10/13 09:39:07 Clip option should now also print the enlarged BoundingBox in the Postscript header, so it is not cut off if it gets clipped again. ---------------------------- revision 1.26 - just fixed the E-Mail address, because it will not change so often in the future ---------------------------- revision 1.25 (not released) - new -C option clipping added - fixed page bounding box search message - bbox 1.10 now fixed scanf() which might cause crashes ---------------------------- revision 1.24 date: 2000/07/24 18:52:36; - just forgot the new options in usage txt, now fixed ---------------------------- revision 1.23 date: 2000/07/24 18:34:52; - ps2eps now uses existing Bounding Box for GS rendering (can be switched off with -B option) - Original Postscript version from first header line should now be retained in output file - provide --help and --version with usual meaning for GNU programs ---------------------------- revision 1.22 date: 2000/02/23 14:15:31; author: bless; state: Exp; lines: +12 -6 ps2eps now draws in color (ppm) by default. Monochrome option added. Fixing message was not printed for each file. ---------------------------- not released before...