Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/02/22)20170223 
icyjug could someone help with postscript? i have an array that i want to sort "naturally", i.e. like the command "ls -v"07:02.19 
camelopard icyjug: Ghostscript has a bubble sort procedure in gs_init.ps.07:53.02 
  icyjug: % <array> <lt-proc> .sort <array>07:53.27 
icyjug camelopard the problem with that is, if say there is a file named A9 and another A20, A20 gets listed before A9..07:54.41 
  the "natural" sort, as in ls -v, doesnt do that07:55.23 
kens You can write your own less than procedure07:55.24 
icyjug kens complicated or easy? :S07:56.02 
kens Depends what you want to do. I imagine most people would think it complicated07:56.19 
  But I have not had time yet to read the logs07:56.35 
icyjug yeah i guess the sorting algorithm behind ls -v should be pretty complicated07:56.57 
  kens is it possible to mix bash and postscript?07:57.31 
  i have another bash script that sorts the filenames naturally in an array07:58.10 
kens mix in what sense ? You can do processing in each interpreter and have it pass its results to the otheer via files for example. There is no interpreter that will handle both PostScript and bash scripting07:58.26 
camelopard icyjug: Ghostscript can read and write files; the files can be named pipes.08:02.07 
icyjug please have a look http://pastebin.com/ziB1f8sS http://pastebin.com/3iP8NXFc08:03.19 
  camelopard i just dont know how to declare files in postscript08:07.48 
  let alone process them08:08.00 
kens the file operator takes a filename, an access flag and returns a file object08:08.14 
  You can then use readstring and readline to read from the file object08:08.32 
icyjug readstring uses space as delimiter?08:09.10 
kens But its probably easier to write the data as a PostScript file you can then 'run' from PostScript08:09.11 
  No, readstrsing has no delimiters08:09.20 
  It fills the string up to the decalred string size or until it runs out of data08:09.37 
  See the PostScript Language Reference Manual08:09.51 
  icyjug : I assume this is still down to creating bookmarks. I would suggest that you write a bash script which sorts the files into the order you want, then runs Ghostscritp with each file to determine the number of pages in each. Then write a *PostScript* program containing each pdfmark, using the number of pages at each point for the destination.08:13.44 
  Then have the same script invoke GS to process each PDF file in turn, feeding the files in the order you determined earlier. Finally send the PostScript program containing all the pdfmarks.08:14.25 
  I expect that will be easier for you than trying to program this in PostScript.08:14.39 
camelopard icyjug: gs -dBATCH -dNODISPLAY -sLIST=<(ls) -c "LIST (r) file 10000 string readstring pop =="08:20.38 
Robin_Watts tkamppeter: Do you have a tool for converting cups rasters to some more standard image format?17:10.55 
camelopard Robin_Watts: The tool was attached to one of the cups bugs. I used it.17:23.52 
Robin_Watts camelopard: yeah, doesn't work for me :(17:24.03 
  If you mean readcups.c17:24.14 
chrisl There is a viewer, if that would help17:24.26 
Robin_Watts chrisl: ooh, that'd be ideal.17:24.36 
chrisl http://www.msweet.org/projects.php?Z717:24.42 
Robin_Watts I've just hacked a simple cups -> pbm converter.17:29.09 
chrisl TBH, I thought bmpcmp already handled cups rasters17:31.02 
Robin_Watts bmpcmp does :)17:39.49 
_johndoe well it's more crowded than i expected18:56.42 
  hello the children of earth18:56.52 
  it seems like it's as quiet as it's crowded19:00.25 
tkamppeter Robin_Watts, you should be able to convert CUPS Raster with any rasterto... filter of cups-filters and there is also rasterview to dispay files on the screen.21:10.56 
  http://www.msweet.org/projects.php?Z721:11.31 
 Forward 1 day (to 2017/02/24)>>> 
ghostscript.com
Search: