All of lore.kernel.org
 help / color / mirror / Atom feed
From: Till Kamppeter <till.kamppeter@gmail.com>
To: Koji Otani <sho@bbr.jp>
Cc: toratani.yasumasa@canon.co.jp,
	printing-architecture@lists.linux-foundation.org
Subject: Re: [Printing-architecture] PDF CUPS filter packages
Date: Fri, 06 Jun 2008 00:07:22 +0200	[thread overview]
Message-ID: <4848639A.3010100@gmail.com> (raw)
In-Reply-To: <20080605.193227.233691471.sho@bbr.jp>

Koji Otani wrote:
> This is more complicated. GS doesn't check this, Adobe Reader 8 seems
> to use a trick.
> Following code is embeded in output PS:
> ----------------------
> %ADOBeginClientInjection: DocumentSetup Start "No Re-Distill"
> %% Removing the following eleven lines is illegal, subject to the
> Digital Copyright Act of 1998.
> mark currentfile eexec
> 54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600
> .....
> ----------------------
> 
> So, this will not be a matter of GS.
> 
> ---------------
> Koji Oatni
> 

Below is my talk with Ralph Giles (rillian), leader of Ghostscript (IRC: 
#ghostscript on Freenode) about the problem of DRMes PDF files. WDYT 
should we do?

    Till

---------------------------------------------------------------------

<tkamppeter> rillian, hi
<rillian> hi till. what's up?
<tkamppeter> I have a problem with the PDF printing workflow.
<tkamppeter> I want to do all page processing in a pdftopdf CUPS filter 
instead of pstops, to improve reliability for these operations.
<tkamppeter> So I replace PostScript by PDF as print job format.
<tkamppeter> Now there is the Adobe Reader, closed-source, so cannot be 
patched to output PDF instead of PS when printing.
<rillian> ok...
<tkamppeter> Seems to be no problem for CUPS. CUPS starts with a pstopdf 
filter, based on Ghostscript to get PDF out of the PS coming from Adobe 
Reader
<tkamppeter> works perfectly with unencrypted PDFs.
<tkamppeter> Now I have an encrypted PDF, allowed is only PRINTING the file.
<tkamppeter> In this case the Ghostscript called by the pstopdf filter 
does not convert the file backk to PDF, giving the following error:
<tkamppeter> This PostScript file was created from an encrypted PDF file.
<tkamppeter> Redistilling encrypted PDF is not permitted.
<tkamppeter> ERROR: /undefined in --get--
<rillian> like they say, DRM can't enforce copyright law accurately
<rillian> (although it shouldn't say /undefined in --get--; feel free to 
file a bug on that
<tkamppeter> The error seems to be generated by the following piece of 
code inserted in the PS:
<tkamppeter> %ADOBeginClientInjection: DocumentSetup Start "No Re-Distill"
<tkamppeter> %% Removing the following eleven lines is illegal, subject 
to the
<tkamppeter> Digital Copyright Act of 1998.
<tkamppeter> mark currentfile eexec
<tkamppeter> 54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600
<tkamppeter> .....
<tkamppeter> Something needs to be changed in Ghostscript so that one 
can print this file ...
<rillian> I'm not sure what you want
<rillian> a flag that says "no really, I'm being called as a component 
of a print chain"?
<rillian> can you not just print such files as postscript directly?
<rillian> do you really need to be adding special support for 
proprietary software in the CUPS workflow?
<tkamppeter> I want to replace PostScript by PDF as standard print job 
format, probably you have been on one of my Printing Summits where we 
have talked about that.
<rillian> tkamppeter: I'm aware of that
<tkamppeter> Especially I want to make the page management (N-Up, 
selected pages, booklets, ...) reliably working,
<tkamppeter> but also nice things as smaller jobs, transparency, high 
color depths, ...
<tkamppeter> Now I once let free apps output PDF instead of PostScript 
(this needs only some small bits changed in Qt and GTK)
<rillian> tkamppeter: the document contains code that prevents 
redistillation. I don't think it's our place to help with that.
<tkamppeter> so I need to add an exception to the CUPS workflow for this 
one proprietary app?
<rillian> that's what you're asking for
<rillian> at least, if you want such DRM'd documents to print
<rillian> if it wasn't clear, I sounds like the DRM in question is *in 
the postscript file*
<rillian> it's not ghostscript enforcing it, it's the file itself
<tkamppeter> As if GS would convert it happily back to PDF there would 
be no exception, all jobs run through pdftopdf and no exception in the 
CUPS filtering is needed.
<rillian> so we'd have to actively detect and circumvent the DRM code
<rillian> if it really is just a set of lines, it might be easier to 
have your pstopdf script do that before feeding it to ghostscript
<tkamppeter> Does this DRM code detect whether the output device is 
"pdfwrite" and then stops and otherwise lets the interpreter continue?
<rillian> I don't know how it works
<rillian> can you post the document somewhere?
<rillian> (I expect it's more general that checking for 'pdfwrite' since 
that's ghostscript specific. It probably looks to see if some distiller 
parameters are being respected.)
<tkamppeter> rillian, you mean that the pstopdf script filters out the 
added lines and to make the DRM guys happy to make pstopdf only 
executable by "lp" (the CUPS system user).
* behdad has quit ("Leaving.")
<rillian> tkamppeter: that would make it safer to ship under the DMCA, 
since you could claim it's only used when printing
<rillian> as long as it didn't do anything when the DRM said 'no 
printing' of course...
<tkamppeter> rillian, do you have encrypted PDFs in your regression 
testing repos? Try to convert them to PostScript with the printing 
function of Adobe Reader. Then look into the PostScript code.
<rillian> tkamppeter: personally I wouldn't try to handle this. Tell the 
user their (proprietary) software is adding DRM to the documents it 
prints, which the printing subsystem is not allowed to handle
<tkamppeter> What I can also do with these files is to define a new CUPS 
mime detecting this DRM code and in this case pass it through pstops. 
Assuming that such PostScript comes only from Adobe it will probably 
smoothly do page management with pstops.
* hawk_pdm has quit ("Leaving.")
<tkamppeter> Problem here is that pstops can not be dropped from later 
CUPS releases as long as Adobe does not adopt the PDF printing workflow.
<rillian> or drops their DRM :)
<rillian> but the former is more likely
* KaL_out has quit ("That's not a bug, but a feature")
<tkamppeter> My big problem is that when I switch a distro over to the 
PDF workflow many users will complain that the PDFs which they are 
allowed to print do not print any more.
<tkamppeter> Users will not switch to Linux when they cannot print 
downloaded PDFs which print under Windows.
<rillian> does the file not print from evince?
<tkamppeter> Koji Otani from OpenPrinting Japan has done the tests when 
he was packaging the CUPS filters.
<tkamppeter> rillian, I asked Otani-san now to try to print it from 
Evince. I can imaging that this will work with a later version of 
Evince/GTK which outputs the print data as PDF.
<rillian> it should work, certainly
<rillian> ok, the only restricted pdf I had handy also doesn't allow 
printing, so I don't have the ps output to look at
<rillian> however, evince was happy to print it, so I don't imagine it 
would have qualms about printing a PDF that did allow printing
<rillian> So in addition to my suggestion that you declare this 
Acrobat's problem, I'd offer that there is a work around of not using 
Acrobat

      parent reply	other threads:[~2008-06-05 22:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03  6:43 [Printing-architecture] PDF CUPS filter packages TORATANI Yasumasa
2008-06-03 13:06 ` Till Kamppeter
     [not found]   ` <20080604.105602.104056266.sho@bbr.jp>
2008-06-04  9:07     ` Till Kamppeter
     [not found]       ` <20080604.181746.02274177.sho@bbr.jp>
2008-06-04 11:59         ` Till Kamppeter
2008-06-04 23:16           ` Olaf Meeuwissen
     [not found]             ` <20080605.181530.212681540.sho@bbr.jp>
2008-06-05 23:35               ` Olaf Meeuwissen
     [not found]           ` <20080605.153828.28801505.sho@bbr.jp>
2008-06-05  7:25             ` Till Kamppeter
     [not found]               ` <20080605.193227.233691471.sho@bbr.jp>
2008-06-05 10:53                 ` Till Kamppeter
     [not found]                   ` <20080606.145117.189705417.sho@bbr.jp>
2008-06-06  6:55                     ` Till Kamppeter
2008-06-05 21:34                 ` Till Kamppeter
2008-06-05 21:46                 ` Till Kamppeter
2008-06-05 22:07                 ` Till Kamppeter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4848639A.3010100@gmail.com \
    --to=till.kamppeter@gmail.com \
    --cc=printing-architecture@lists.linux-foundation.org \
    --cc=sho@bbr.jp \
    --cc=toratani.yasumasa@canon.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.