Graphics, Figures & TablesPDFLaTeX loses Arcs on a Figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
smmkko
Posts: 5
Joined: Wed Feb 29, 2012 2:17 pm

PDFLaTeX loses Arcs on a Figure

Post by smmkko »

Hi all,

Can you help me with this?

I am preparing a book with a figure containing arc-shaped arrows. Somehow these arcs get lost when running PDFLaTeX and seeing the result with TeXworks PDF viewer. Adobe Reader shows the arcs correctly. Why come?

When I add the preamble pages to my book (in PDF) with Ghostscript, the arcs are gone. If I use Adobe Acrobat for combining the PDF documents together, the arcs are preserved. How come? Probably this is an Ghostscript issue?

See the pruned example files in the attached ZIP archive:
  • Test-arcs.svg: Figure created with Inkscape. Has arcs.
  • Test-arcs.pdf: Figure saved as PDF with Inkscape. Has arcs.
  • Test-svg.tex: Document to contain the figure.
  • Test-svg.pdf: Resulting PDF after PDFLaTeX. Has arcs if viewed with Acrobat Reader.
  • Doc1.pdf: Empty page created with MS Word.
  • Result.pdf: Resulting PDF after combining the two pages with gswin32. Arcs missing!
The actual gswin32 command was

Code: Select all

gswin32 -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -sOUTPUTFILE=Result.pdf Test-svg.pdf Doc1.pdf
Anyone able to help me with this?
Attachments
Test.zip
(119.77 KiB) Downloaded 242 times
Last edited by localghost on Wed Feb 29, 2012 11:45 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: PDFLaTeX loses Arcs on a Figure

Post by coachbennett1981 »

I opened the file test-svg.tex and it worked fine for me (arrows and all). I am using TeXShop and the preview feature with my mac. I am assuming you have done as well, the problem comes from putting this code in the book. For your book, may I suggest making a MWE with just that pic and build the file with packages around it until you see the error? Did you make the figure in PStricks? What software did you use to create it?

could you send a template of your book with this chapter so we can look at it? I changed report to book class and still got the arcs to show up.


Nick
smmkko
Posts: 5
Joined: Wed Feb 29, 2012 2:17 pm

Re: PDFLaTeX loses Arcs on a Figure

Post by smmkko »

As I told in my example, Test-arcs.pdf does show the arcs if viewed with, e.g., Adobe Acrobat Reader. With the pdf (?) viewer in TeXWorks, the arcs do not show. After combining the two pdfs (Test-arcs.pdf and Doc1.pdf) with Ghostscript, the arcs do not show any more even with Acrobat. As far as I can do, this is already a MWE.

The figure was created with Inkscape, as told in the post.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

PDFLaTeX loses Arcs on a Figure

Post by Stefan Kottwitz »

If one PDF viewer shows the arc and another one does not, it's obviously a viewer problem. Since Adobe developed PDF, their viewer should be the reference, while the TeXworks viewer could be considered as a previewer with less capabilities.

Is it an option to use TikZ? This would be my choice for diagrams with arrows. Have a look at the Diagram examples in the TikZ example gallery.

Inkscape documents and SVG documents, respectively, can be converted to TikZ pictures, which can be further edited. A complex example: Map of India.

Stefan
LaTeX.org admin
smmkko
Posts: 5
Joined: Wed Feb 29, 2012 2:17 pm

PDFLaTeX loses Arcs on a Figure

Post by smmkko »

Stefan_K wrote:If one PDF viewer shows the arc and another one does not, it's obviously a viewer problem. Since Adobe developed PDF, their viewer should be the reference, while the TeXworks viewer could be considered as a previewer with less capabilities.
Printed paper should be the reference, and also that has no arcs...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

PDFLaTeX loses Arcs on a Figure

Post by Stefan Kottwitz »

smmkko wrote:Printed paper should be the reference, and also that has no arcs...
Sure, if the final result is a printed book and not an electronically published document.
smmkko wrote:Adobe Reader shows the arcs correctly.
The I wonder why your print doesn't show the arcs. Did you print with the Adobe Reader, or with the PDF viewer that did not show the arcs?

If the arcs are only lost in the last step of combining with gswin32, then it's a ghostscript issue. There are further tools for combining PDF documents, such as pdftk. With pdfLaTeX, you could use pdfpages.

Stefan
LaTeX.org admin
smmkko
Posts: 5
Joined: Wed Feb 29, 2012 2:17 pm

PDFLaTeX loses Arcs on a Figure

Post by smmkko »

Stefan_K wrote:
smmkko wrote:Printed paper should be the reference, and also that has no arcs...
Sure, if the final result is a printed book and not an electronically published document.
smmkko wrote:Adobe Reader shows the arcs correctly.
The I wonder why your print doesn't show the arcs. Did you print with the Adobe Reader, or with the PDF viewer that did not show the arcs?

If the arcs are only lost in the last step of combining with gswin32, then it's a ghostscript issue. There are further tools for combining PDF documents, such as pdftk. With pdfLaTeX, you could use pdfpages.

Stefan
The final result will be both electronic and printed.

The Adobe Reader shows the arcs only if viewed before joining the two pdfs together with ghostscript (see for yourself). I would post this to a ghostscript forum if I found one (mailing lists not so good).

I will try pdftk when I have time upon a computer I can fully control (installation).
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

PDFLaTeX loses Arcs on a Figure

Post by shadgrind »

What's weird is that by using ePDFView the arcs are visible in the combined document! But since Acrobat Reader can't show those arcs then I'd agree that it's a ghostscript issue when combining the two PDFs. When trying to use MuPDF to view the combined PDF I got these error messages:

Code: Select all

+ pdf/pdf_interpret.c:1390: pdf_run_Do(): cannot find XObject dictionary when looking for: 'R14'
\ pdf/pdf_interpret.c:2029: pdf_run_keyword(): cannot draw xobject/image
+ pdf/pdf_interpret.c:1390: pdf_run_Do(): cannot find XObject dictionary when looking for: 'R19'
\ pdf/pdf_interpret.c:2029: pdf_run_keyword(): cannot draw xobject/image
+ pdf/pdf_interpret.c:1390: pdf_run_Do(): cannot find XObject dictionary when looking for: 'R22'
\ pdf/pdf_interpret.c:2029: pdf_run_keyword(): cannot draw xobject/image
+ pdf/pdf_interpret.c:1390: pdf_run_Do(): cannot find XObject dictionary when looking for: 'R25'
\ pdf/pdf_interpret.c:2029: pdf_run_keyword(): cannot draw xobject/image
+ pdf/pdf_interpret.c:1390: pdf_run_Do(): cannot find XObject dictionary when looking for: 'R28'
\ pdf/pdf_interpret.c:2029: pdf_run_keyword(): cannot draw xobject/image
It seems like some internal objects weren't defined correctly by ghostscript when merging the PDFs.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
smmkko
Posts: 5
Joined: Wed Feb 29, 2012 2:17 pm

PDFLaTeX loses Arcs on a Figure

Post by smmkko »

shadgrind wrote: It seems like some internal objects weren't defined correctly by ghostscript when merging the PDFs.
I have submitted this problem as the Bug 692958 http://bugs.ghostscript.com/show_bug.cgi?id=692958 at bugs.ghostscript.com.
Post Reply