[gs-devel] -dPermissions ignored

Russell Lang gsview at ghostgum.com.au
Tue May 5 00:50:00 PDT 2009


Have a look at
  http://casper.ghostscript.com/~ghostgum/pdftips.htm

On 4 May 2009 at 14:24, Ludovic Aelbrecht wrote:

> Hi Russel,
> 
> Could you please go into more detail about the "-c" parameter? I read
> http://pages.cs.wisc.edu/~ghost/doc/cvs/Use.htm , which doesn't say it
> should be put after all options - but it does use "-f", which seems to
> be a terminator for "-c". My understanding was that if I use "-f"
> after the parameters passed to "-c" (e.g. "setvmthreshold"), then "-c"
> can be put anywhere I want (i.e. not after all options)?
> 
> The reason I'm asking is I want to increase the performance of my
> PDF/A conversion. As such I read Use.htm, which recommends adding "-c
> 30000000 setvmthreshold -f" to my parameters.
> 
> If I add the "-c" things, however, no output file gets created, while
> it does get created without the "-c", as you can see here:
> 
> ------------------------------------------------------------------
> laelbrec at laelbrec-be /cygdrive/c/temp $ rm bench_test.pdf
> rm: remove regular file `bench_test.pdf'? y
> removed `bench_test.pdf'
> 
> laelbrec at laelbrec-be /cygdrive/c/temp $ time
> /cygdrive/d/Applications/gs/gs8.64/bin/gswin32c.exe -q  -c 30000000
> setvmthreshold -f -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFA
> -dUseCIEColor -sProcessColorModel=DeviceCMYK -sOutputFile=be
> nch_test.pdf PDFA_def.ps ZS_107846941.ps
> %%[ ProductName: GPL Ghostscript ]%%
> %%[Page: 1]%%
> %%[Page: 2]%%
> %%[LastPage]%%
> 
> real    0m0.523s
> user    0m0.046s
> sys     0m0.000s
> 
> laelbrec at laelbrec-be /cygdrive/c/temp $ ls bench_test.pdf
> ls: cannot access bench_test.pdf: No such file or directory
> 
> laelbrec at laelbrec-be /cygdrive/c/temp $ time
> /cygdrive/d/Applications/gs/gs8.64/bin/gswin32c.exe -q -dBATCH
> -dNOPAUSE -sDEVICE=pdfwrite -dPDFA -dUseCIEColor
> -sProcessColorModel=DeviceCMYK -sOutputFile=bench_test.pdf PDFA_def.ps
> ZS_1078
> 46941.ps
> %%[ ProductName: GPL Ghostscript ]%%
> %%[Page: 1]%%
> %%[Page: 2]%%
> %%[LastPage]%%
> 
> real    0m0.892s
> user    0m0.031s
> sys     0m0.000s
> 
> laelbrec at laelbrec-be /cygdrive/c/temp $ ls bench_test.pdf
> bench_test.pdf*
> ------------------------------------------------------------------
> 
> Also, the "-c" part makes a window show up containing the contents of
> the input file (but it does close the window after "converting" the
> file (I put the word between quotes as there's no output file).
> 
> So I did as you suggested, and put "-c" right before the 2 input files
> (i.e. the pdf/a definition file, as I'm using -dPDFA, and the PS file
> to convert):
> 
> ------------------------------------------------------------------
> time /cygdrive/d/Applications/gs/gs8.64/bin/gswin32c.exe -q -dBATCH
> -dNOPAUSE -sDEVICE=pdfwrite -dPDFA -dUseCIEColor
> -sProcessColorModel=DeviceCMYK -sOutputFile=bench_test.pdf -c 30000000
> setvmthreshold -f PDFA_def.ps ZS_107846941.ps
> %%[ ProductName: GPL Ghostscript ]%%
> %%[Page: 1]%%
> %%[Page: 2]%%
> %%[LastPage]%%
> 
> real    0m0.868s
> user    0m0.015s
> sys     0m0.015s
> 
> laelbrec at laelbrec-be /cygdrive/c/temp $ ls bench_test.pdf
> bench_test.pdf*
> ------------------------------------------------------------------
> 
> This works perfectly (it even hides the window which showed up before).
> 
> What's going on here? I thought the "-f" terminated the "-c". If not,
> shouldn't it be added to Use.htm that "-c" must be set at the end of
> the command line? Or did I just not see this?
> 
> 
> Also, are there other options to improve performance? Like using
> something else than "setvmtreshold" (which, if I understand correctly,
> has something to do with the type of GC being used)?
> The reason I'm asking is that "-c" doesn't help much (though,
> admittedly, I'm not using a font with a large character set, AFAIK),
> and I'm not using XWindows so dMaxBitmap won't help either.
> 
> I've also tried using:
> * "-dNOBIND", as I saw it mentioned somewhere for performance
> improvements, but that gives me an error ("Error: /undefined in
> /.forceput")
> * dNOGC (as it was also mentioned somewhere for performance
> improvements), but that didn't seem to have any effect.
> * a " -c 30000000 -f" (so without a "setvmtreshold"), both with and
> without NOGC, but that didn't change anything either.
> * a " -c setvmtreshold -f" (so without a "30000000 "), both with and
> without NOGC, but that gave me an error ("Error: /stackunderflow in
> --setvmthreshold--")
> 
> Is there anything else which can be done to improve PS to PDF/A conversion?
> 
> I'm also going to let GS convert a great number of Postscript files
> (in batches of around 60 000, IIRC) to PDF/A files. Is there something
> which can be done to speed this up, i.e. instead of starting
> ghostscript again and again for each file, could a text file
> containing the list of files be passed to ghostscript? Or would
> something like xargs help (would this even be possible, since the
> output filename has to change as well)? Or is there a way to pass many
> files to the ghostscript command line without using something like
> xargs?
> 
> I know these are many questions, but performance tuning seems to have
> limited documentation (which I understand fully - writing docs is a
> quite tedious task), so I hope someone can help me out here.
> 
> Thanks a lot and best regards,
> 
> Ludovic
> 
> 
> 
> On Thu, Apr 30, 2009 at 23:17, Russell Lang <gsview at ghostgum.com.au> wrote:
> > All the options must be put before the "-c .setpdfwrite", and before the first input
> > filename.
> >
> > On 30 Apr 2009 at 14:15, HAENEL Florian FDEP-G (AREVA NP GmbH) wrote:
> >
> >> Hello,
> >> I want to restrict printing on some of my documents and I am using the following commandline:
> >>
> >> 126 ¬   gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \\
> >> 127 ¬   -sOutputFile=$tempname.pdf -dPDFA -c .setpdfwrite \\
> >> 128 ¬   -sOwnerPassword=owner -dEncryptionR=3 -dKeyLength=128 -dPermissions=-3904\\
> >> 129 ¬   -dCompatibilityLevel=1.5 -r600 \\
> >> 130 ¬   -dEmbedAllFonts=true -dSubsetFonts=true -dMaxSubsetPct=100 \\
> >> 131 ¬   -dAutoFilterColorImages=false -dAutoFilterGrayImages=false \\
> >> 132 ¬   -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/CCITTFaxEncode \\
> >> 133 ¬   -dEncodeColorImages=true -dEncodeGrayImages=true -dEncodeMonoImages=true \\
> >> 134 ¬   -dDownsampleGrayImages=false -dDownsampleMonoImages=false \\
> >> 135 ¬   -dProcessColorModel=/DeviceCMYK -dUseCIEColor
> >>
> >> I assume the problem lies in conflicting options like PDFA not supporting encryption, but since gs does not complain,
> >> I come here to ask, what the problem might be.
> >>
> >
> >
> > Russell Lang                   gsview at ghostgum.com.au
> > Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/
> >
> > _______________________________________________
> > gs-devel mailing list
> > gs-devel at ghostscript.com
> > http://www.ghostscript.com/mailman/listinfo/gs-devel
> >
> _______________________________________________
> gs-devel mailing list
> gs-devel at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel


Russell Lang                   gsview at ghostgum.com.au
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/



More information about the gs-devel mailing list