ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Corrupt PDF files with LMTX?
Date: Sat, 24 Apr 2021 10:07:04 +0200	[thread overview]
Message-ID: <84d73e8d-d30a-102d-7d4c-b57eb3d56f47@uni-bonn.de> (raw)
In-Reply-To: <CAKyqqaZxjd_HF11ewmV=Dy0FO31pKomdsqqR-UfajBQFMD7wTw@mail.gmail.com>

On 24.04.21 08:03, Jairo A. del Rio wrote:
> Hi, list!
> When I try to convert a PDF generated by ConTeXt LMTX to PNG using
> ImageMagick's convert the following happens:
> 
>     **** Error: stream Length incorrect.
>                 Output may be incorrect.
>     **** Error:  An error occurred while reading an XREF table.
>     **** The file has been damaged.  This may have been caused
>     **** by a problem while converting or transfering the file.
>     **** Ghostscript will attempt to recover the data.
>     **** However, the output may be incorrect.
> Error: /ioerror in --runpdf--
> Operand stack:
>     post_eof_count   4096   --nostringval--   4571
> Execution stack:
>     %interp_exit   .runexec2   --nostringval--   runpdf   --nostringval--
> 2   %stopped_push   --nostringval--   runpdf   runpdf   false   1
> %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop
> 1977   1   3   %oparray_pop   1978   1   3   %oparray_pop   runpdf   runpdf
>    runpdf   runpdf   runpdf   runpdf   runpdf
> Dictionary stack:
>     --dict:735/1123(ro)(G)--   --dict:1/20(G)--   --dict:80/200(L)--
> --dict:80/200(L)--   --dict:135/256(ro)(G)--   --dict:315/325(ro)(G)--
> --dict:28/32(L)--
> Current allocation mode is local
> GPL Ghostscript 9.50: Unrecoverable error, exit code 1
> convert-im6.q16: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET
> -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000
> -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4
> -dGraphicsAlphaBits=4 '-r300x300'
>   '-sOutputFile=/tmp/magick-55690XUwDR8veJQEc%d'
> '-f/tmp/magick-55690zbxNvSPCVCYe' '-f/tmp/magick-55690aVvG11u3p8wd'' (1) @
> error/pdf.c/InvokePDFDelegate/291.
> convert-im6.q16: no images defined `151.png' @
> error/convert.c/ConvertImageCommand/3258.
> 
> I'd blame ImageMagick, except for the fact that 1) other converters fail
> too and 2) it doesn't happen with ConTeXt MkIV (PDF is successfully
> converted).
> 
> Cordially,
> 
> Jairo

Very interesting! I have seen similar behavior these past days (I think 
it's very recent) but thought it was something in my documents. Hans, MWE:

I have two test files, simply with

\starttext

Test

\stoptext

I try to concatenate the resulting pdf files with qpdf:

qpdf test1.pdf --pages test1.pdf test2.pdf -- result.pdf

And I get these warnings (though the resulting file appears to be OK):

WARNING: test1.pdf (xref stream: object 18 0, offset 4154): expected 
endstream
WARNING: test1.pdf (xref stream: object 18 0, offset 4078): attempting 
to recover stream length
WARNING: test1.pdf (xref stream: object 18 0, offset 4078): recovered 
stream length: 64
WARNING: test1.pdf (object 3 0, offset 4179): expected endstream
WARNING: test1.pdf (object 3 0, offset 2982): attempting to recover 
stream length
WARNING: test1.pdf (object 3 0, offset 2982): recovered stream length: 887
WARNING: test2.pdf (xref stream: object 18 0, offset 4215): expected 
endstream
WARNING: test2.pdf (xref stream: object 18 0, offset 4139): attempting 
to recover stream length
WARNING: test2.pdf (xref stream: object 18 0, offset 4139): recovered 
stream length: 65
WARNING: test2.pdf (object 3 0, offset 4241): expected endstream
WARNING: test2.pdf (object 3 0, offset 3050): attempting to recover 
stream length
WARNING: test2.pdf (object 3 0, offset 3050): recovered stream length: 880
qpdf: operation succeeded with warnings; resulting file may have some 
problems



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      parent reply	other threads:[~2021-04-24  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  6:03 Jairo A. del Rio
2021-04-24  6:36 ` Hans Hagen
     [not found]   ` <CAKyqqaY=VqQWCM93Bwcrc2TfQ6_a0CT-EXvrrgjp5ha7x1+33Q@mail.gmail.com>
2021-04-24 13:05     ` Fwd: " Jairo A. del Rio
2021-04-24 16:18       ` Hans Hagen
2021-04-26  0:14         ` Jairo A. del Rio
2021-04-24  8:07 ` Thomas A. Schmitz [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=84d73e8d-d30a-102d-7d4c-b57eb3d56f47@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --cc=ntg-context@ntg.nl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).