'GPL Ghostscript 9.50: Annotation set to non-printing, not permitted in PDF/A, reverting to normal PDF output'. While converting PDF to PDFA (linux)) - node.js

I'm using the latest version of Ghostscript "GPL Ghostscript 9.50 (2019-10-15)" but still I'm unable to convert PDF to PDF/A. The command which I used for conversion gs -dPDFA -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sOutputFile=output_filename.pdf input_filename.pdf it is saying that GPL Ghostscript 9.50: Annotation set to non-printing, not permitted in PDF/A, reverting to normal PDF output. Is there any problem with my command, if there so please let me know with a proper solution.
Thanks & Regards.

Related

ERROR -12 closing pdfwrite device in ghost script

In our module we are using the ghost script to compress PDF of higher size to lower size use the command
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-sOutputFile=output.pdf input.pdf
while converting this we are getting an error as shown below
GPL Ghostscript 9.10: Unrecoverable error, exit code 1GPL Ghostscript 9.10: ERROR -12 closing pdfwrite device. See gs/psi/ierrors.h for code explanation
More Information:
we are using Ubuntu 14.04 OS.
Thanks, Praveen Ravipati
Thanks KenS, I found the cause of the issue. I verified the tmp directory while compressing the PDF . it taking the huge space and at some point of time tmp space is not enough to compress. So this is throwing io error. So to fix this i added extra space for tmp directory. then I checked again.It is fine

eps files render badly

When I open or convert eps files created with gnuplot, some of the lines don't come out properly. I am using Debian squeeze. Strangely when I view them on a windows PC they look fine.
See attatched example
This was converted with the command:
gs -r400 -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=png16m -sOutputFile=output.png -dBATCH -dNOPAUSE input.eps
the results are the same when viewed on the screen. Notice on the aerofoil lower surface, some of the line segments are actually triangles.
Thanks

Repair apparently damaged pdf and reduce file size

I have a PDF file (4.6MB) which was made by combining 6 different PDFs (containing both text and bitmap graphics) using pdftk in Ubuntu 12.04. I wish to compress this file to something close to 2MB without affecting its quality.
I have tried pdftk's "compress" option (couldn't compress it to 2 MB), also tried converting it to ps first and than back to pdf, it gives the following warning:
****Warning: considering '0000000000 XXXXX n' as a free entry.
and then hangs. qpdf also failed saying that the file is damaged.
Could someone help me out?
What result does Ghostscript give you? Try this command:
gs \
-o output.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/screen \
input.pdf
has this pdf file reserved infos? If it has no confidential data it would be interesting to see
anyway many times where qpdf fails, Multivalent works
you can try to use its Compress tool (it also attempts to repair pdf file)
Multivalent
https://rg.to/file/c6bd7f31bf8885bcaa69b50ffab7e355/Multivalent20060102.jar.html
(latest free version with tools included, current has no tools in itself)
java -cp path....to/Multivalent.jar tool.pdf.Compress file.pdf
This works for me to repair the damaged PDF
sudo apt-get install mupdf-tools
mutool clean input.pdf output.pdf

ghostscript fonts

I'm trying to get ghostscript to render a pdf file from a Windows box. The pdf file uses the ComicSansMS font. I've copied the comic.ttf file from my Windows7 box into my /usr/share/ghostscript/fonts directory, and I've created a Fontmap file in that same directory containing this line:
/ComicSansMS (comic.ttf) ;
As nearly as I can tell, the font is not being found despite this. The text comes out very poorly, and some of the smaller font sizes are rendered half the size they should be. Access times and strace show that the Fontmap file is being read, but the font file (comic.ttf) is not being accessed at all. There are no error messages:
hope 78$ gs cards-01.pdf
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
>>showpage, press <return> to continue<<
If I use -dFAPIDEBUG on the gs command line, I see the following:
hope 74$ gs -dFAPIDEBUG -I/usr/share/ghostscript/fonts cards-01.pdf
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
FAPIhook --nostringval--
Trying to render the font Font --nostringval-- ( aliased from ComicSansMS ) with FAPI...
Font --nostringval-- ( aliased from ComicSansMS ) is being rendered with FAPI=FreeType
FAPIhook --nostringval--
Font --nostringval-- ( aliased from ComicSansMS ) is mapped to FAPI=FreeType
FAPIhook RVJCAL+SymbolMT
Trying to render the font Font RVJCAL+SymbolMT with FAPI...
Font RVJCAL+SymbolMT is being rendered with FAPI=FreeType
FAPIhook RVJCAL+SymbolMT
Font RVJCAL+SymbolMT is mapped to FAPI=FreeType
FAPIhook HYLUQF+ComicSansMS
Trying to render the font Font HYLUQF+ComicSansMS with FAPI...
Font HYLUQF+ComicSansMS is being rendered with FAPI=FreeType
FAPIhook HYLUQF+ComicSansMS
Font HYLUQF+ComicSansMS is mapped to FAPI=FreeType
>>showpage, press <return> to continue<<
Naturally, the line from the above that most concerns me is this one:
Font --nostringval-- ( aliased from ComicSansMS ) is being rendered with FAPI=FreeType
"gs -h" shows that the font directory is, indeed, in the search path:
hope 77$ gs -h
GPL Ghostscript 9.00 (2010-09-14)
[ ... ]
Search path:
/usr/share/ghostscript/9.00/Resource/Init :
/usr/share/ghostscript/9.00/lib :
/usr/share/ghostscript/9.00/Resource/Font :
/usr/share/ghostscript/fonts : /usr/share/fonts/Type1 : /usr/share/fonts
I've tried several permutations of formatting in the Fontmap file, including:
(Comic Sans MS) (comic.ttf) ;
(ComicSansMS) (comic.ttf) ;
/Comic Sans MS (comic.ttf) ;
/ComicSansMS /comic.ttf ;
I'm fairly sure my original one is the correct one, but I was getting desperate. :-P
Any help would be greatly appreciated. Thanks in advance.
I assume that PDF does not have the ComicSansMS font embedded?
You should consider 2 other possibilities as well:
Your PDF file card-01.pdf is somehow corrupted. (Are other PDF viewers rendering that file without a problem? Does it display OK in Acrobat Reader on Widnows?)
Your fontfile comic.ttf is somehow corrupted. (Which method did you use to transfer it from Windows to Linux?)
You could try to positively proof that both these components are getting along well enough with each other by using Ghostscript+comic.ttf to create a PDF (with comic.ttf embedded):
gs \
-sFONTPATH=/usr/share/ghostscript/fonts \
-o comic-ttf.pdf \
-sDEVICE=pdfwrite \
-g5950x8420 \
-c "200 700 moveto" \
-c "/ComicSansMS findfont 60 scalefont setfont" \
-c "(comic.ttf) show showpage"
On Windows, use this variation of above command:
gswin32c.exe ^
-o comic-ttf.pdf ^
-sDEVICE=pdfwrite ^
-sFONTPATH=c:/windows/fonts ^
-g5950x8420 ^
-c "200 700 moveto" ^
-c "/ComicSansMS findfont 60 scalefont setfont" ^
-c "(comic.ttf) show showpage"
When I do this, I see:
gswin32c.exe ^
-o comic-ttf.pdf ^
-sDEVICE=pdfwrite ^
-sFONTPATH=c:/windows/fonts ^
-dHaveTrueTypes=true ^
-g5950x8420 ^
-c "200 700 moveto" ^
-c "/ComicSansMS findfont 60 scalefont setfont" ^
-c "(comic.ttf) show showpage"
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Scanning c:/windows/fonts for fonts... 423 files, 255 scanned, 240 new fonts.
Loading ComicSansMS font from c:/windows/fonts/comic.ttf... 3343720 1813337 2926116 1611207 1 done.
and my output PDF comic-ttf.pdf looks OK and does have the comic.ttf font embedded.
If this does also work for you, then your Ghostscript and your comic.ttf are OK, but your PDF file cards-01.pdf is not.
I came back to this problem after a delay. Upon further investigation with a magnifying glass, the problem is different from what I initially thought.
Text is definitely being rendered incorrectly in parts of the document. Each letter is far too small, though the spacing is oddly correct. However, the individual letters are the correct shape for the font.
The font on disk is not being accessed, but that's because the fonts are all embedded within the document. This fact would probably have been obvious to a Ghostscript expert from the output I posted in the original question (I'm guessing the "HYLUQF+" prefix is the smoking gun there), but I don't work with Ghostscript much. My fonts were installed correctly, and other documents were able to access them without trouble.
Of course, this still leaves the question of why my embedded fonts are being rendered incorrectly, but I will investigate that separately and/or post a different question. I maintain that the PDF file is uncorrupted (I have several other PDFs which exhibit the same problem), but I still don't know what's wrong.
#pipitas: Thanks very much for trying. You certainly did help verify that my installed fonts are not the problem. Actually, now that I look again, you even gently suggested the font might be embedded, but I either didn't see it, didn't believe it, or didn't know how to check.

Problems with linux Imagemagick converting PDFs to JPGs

The system I'm using uses the linux utility convert to convert pdfs to jpgs. My box gives me the following error.
>$ convert Badge-1114044091.pdf Badge-1114044091.jpg
convert: Postscript delegate failed `Badge-1114044091.pdf'.
convert: missing an image filename `Badge-1114044091.jpg'.
But the production machine does not. According to
>$ convert -version
my version is the same as the prodution machine. I'm not sure exactly how to check if postscript needs to be updated. Not really a huge linux guru.
EDIT: Upon suggestion, I checked Ghostscript. The following was already installed.
>$ gs -version
ESP Ghostscript 8.15.3 (2006-08-25)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
Install GhostScript.
http://www.ghostscript.com/
ImageMagick (the 'convert' utility) doesn't actually convert PDFs; it invokes GhostScript using an arcane command like
gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -r<OUTPUT RESOLUTION> -sOutputFile=<OUTPUT>.jpg <INPUT>.pdf 2>&1
You might want to try that command directly if you want more control.

Resources