Bug#657817: ghostscript: Provide ps2pdfa

2012-01-29 Thread Liam Morland
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

2012-01-28 23:57-0500 Jonathan Nieder  wrote:
>Sounds sensible.  Could you request inclusion at 
> and send us the bug number so we can 
>track it?

Bug report created:
http://bugs.ghostscript.com/show_bug.cgi?id=692822

- -- 
Liam Morland Canadian Scout Camps Directory
http://Liam.Morland.ca/ http://ScoutDocs.ca/Camps/

PGP Public Key: http://liam.morland.ca/pgp-public-key.asc

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8lVZ8ACgkQgtUMElSxnjegCQCgivS2+i48m7AhVBOTlnie9qP/
9AYAoMatNfse5LJuKywk8coSXenm6ZOz
=c8N4
-END PGP SIGNATURE-



-- 
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120129142015.ga2...@burns.dyndns.org



Bug#657817: ghostscript: Provide ps2pdfa

2012-01-28 Thread Jonathan Nieder
tags 657817 + upstream
quit

Hi,

Liam K Morland wrote:

> Along with the other ps2pdf* scripts, it would be very helpful to have a 
> script to create PDF/A. Attached is an attempt at creating such a 
> script.

Sounds sensible.  Could you request inclusion at 
and send us the bug number so we can track it?

Thanks much,
Jonathan



-- 
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120129045740.GB16404@burratino



Bug#657817: ghostscript: Provide ps2pdfa

2012-01-28 Thread Liam K Morland
Package: ghostscript
Version: 9.04~dfsg-3
Severity: wishlist
Tags: patch

Dear Maintainer,

Along with the other ps2pdf* scripts, it would be very helpful to have a 
script to create PDF/A. Attached is an attempt at creating such a 
script.

Attachments:

1. ps2pdfa script, modelled on the others.

2. A patch file that makes minor changes to ps2pdfwr to allow ps2pdfa to 
provide an additional input file. It needs this in order to provide a 
PDFA_def file.

3. Two PDFA_def files: one for each of DeviceGrey and DeviceCMYK, based 
on /usr/share/ghostscript/9.04/lib/PDFA_def.ps. The only difference is 
that the /ICCProfile is set to one of 
/usr/share/ghostscript/9.04/iccprofiles/default_(grey|cmyk).icc

I have not done much sh programming, so there may be improvements that 
can be made.

It works, except for an error message which seems to be related to file 
permissions, but I can't figure out what is wrong. It works if I comment 
out the line in the PDFA_def file:

[{icc_PDFA} ICCProfile (r) file /PUT pdfmark

But with that line gone, I don't think it creates a valid PDF/A 
document.

Besides fixing this issue, there is one other todo. The title is 
supposed to be set in the PDFA_def file. I think doing this is beyond 
what I am comfortable doing in sh. Should I generate a tmpfile 
containing a customized PDFA_def with the title?

I would appreciate your assistance with this or your referral to a 
better forum to present this feature request.

Thank you,
Liam Morland

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ghostscript depends on:
ii  debconf [debconf-2.0]  1.5.41
ii  debianutils4.1
ii  gsfonts1:8.11+urwcyr1.0.7~pre44-4.2
ii  libc6  2.13-24
ii  libgs9 9.04~dfsg-3

ghostscript recommends no packages.

Versions of packages ghostscript suggests:
pn  ghostscript-cups  9.04~dfsg-3
pn  ghostscript-x 9.04~dfsg-3
pn  hpijs 

-- no debconf information
#!/bin/sh
# $Id$
# Convert PostScript to PDF/A.
ps2pdfwr="`dirname \"$0\"`/ps2pdfwr"
if test ! -x "$ps2pdfwr"; then
	ps2pdfwr="ps2pdfwr"
fi

# Command line switch to select grey output
if [ $# -gt 0 ] && [ `expr $1 : -grey` -eq 5 ]; then
	color="Grey"
	shift
else
	color="CMYK"
fi

exec "$ps2pdfwr" -dPDFA -dNOOUTERSAVE -sProcessColorModel=Device$color -in=PDFA_def-$color.ps "$@"
# @todo: Title should be set in the PDFA_def file.
diff -u a/ps2pdfwr b/ps2pdfwr
--- a/ps2pdfwr	2012-01-28 22:43:23.0 -0500
+++ b/ps2pdfwr	2012-01-28 22:46:54.0 -0500
@@ -12,9 +12,11 @@
 GS_EXECUTABLE="$gs"
 
 OPTIONS="-P- -dSAFER"
+pre_infile=""
 while true
 do
 	case "$1" in
+	-in=*) pre_infile="$pre_infile `expr substr "$1" 5 `";;
 	-?*) OPTIONS="$OPTIONS $1" ;;
 	*)  break ;;
 	esac
@@ -42,4 +44,4 @@
 
 # We have to include the options twice because -I only takes effect if it
 # appears before other options.
-exec "$GS_EXECUTABLE" $OPTIONS -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr "-sOutputFile=$outfile" $OPTIONS -c .setpdfwrite -f "$infile"
+exec "$GS_EXECUTABLE" $OPTIONS -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr "-sOutputFile=$outfile" $OPTIONS -c .setpdfwrite -f "$pre_infile" "$infile"


PDFA_def-CMYK.ps
Description: PostScript document


PDFA_def-Grey.ps
Description: PostScript document