bugGNU Octave - Bugs: bug #60100, SVG graphics can crash Adobe...

 
 

bug #60100: SVG graphics can crash Adobe Reader in some cases

Submitter:  Bill Eaton <wpeaton>
Submitted:  Mon 22 Feb 2021 08:56:40 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Bill Eaton Open/Closed:  * Closed
Release:  * 6.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 23 Feb 2021 11:44:09 PM UTC, comment #9: 

Hah! I found a workaround. It seems that LibreOffice/Adobe combo doesn't like transparent polylines. And by default, major and minor gridlines have alpha 0.25. These values look OK for grid lines:

    set(gca, 'gridalpha', 1);            % default is 0.25
    set(gca, 'minorgridalpha', 1);       % default is 0.25
    set(gca, 'minorgridlinestyle', '-'); % default is :
    set(gca, 'gridcolor', [.8 .8 .8]);
    set(gca, 'minorgridcolor', [.9 .9 .9]);

Bill Eaton <wpeaton>
Tue 23 Feb 2021 03:51:04 AM UTC, comment #8: 

A proper program should be able to handle any input w/o crashing. It may display garbage, or it may tell you there is an error, but it should not crash. So octave may create suboptimal svgs, libreoffice may create bad pdfs, but so far we know for sure is that acrobat has a bug.

Anyway, since you are creating html, you can display it in a browser and then print it to a pdf file.

If it has to be libreoiffice somewhere in the chain (e.g. you want to add some text, prior to the final conversion), you can try printing to postscript and then convert to pdf using ghostscript utilities (where you can experiment with different pdf optimizations).

Etc, etc,

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Tue 23 Feb 2021 01:12:43 AM UTC, comment #7: 

I made another fake report using the demo picture from the home page of the GL2PS project. Some version of this engine is used in Octave. The SVG from there works just fine when I go from LibreOffice to PDF.

Bill Eaton <wpeaton>
Tue 23 Feb 2021 12:28:20 AM UTC, comment #6: 

Please, @dasergatskov, more suggestions on making output digestible would be welcome. I'd be happy to report results here. Sadly, changing font to Arial ( set(0, 'defaulttextfontname', 'Arial'); set(gca, 'FontName', Arial) ) did not help.

It's worth noting that Adobe may not be the culprit. It could also be LibreOffice. In the script I attached with original report, I generate an HTML file. This is a quick way to make a fake report with tons of pictures. If I open that HTML file in a browser and then print to PDF, the resulting PDF will open in Adobe.

I've been trying to compare the output from Octave to that from Matplotlib to see if there are any obvious tags that could be changed, but after extensive manual editing of Octave SVG output, I couldn't get a file that would eventually open in Adobe.


Bill Eaton <wpeaton>
Mon 22 Feb 2021 11:29:43 PM UTC, comment #5: 

This is an upstream bug in Adobe.  I'm going to close the report, but it remains reachable by search so someone in the future using "SVG Adobe" can find this report.

I would probably try the workarounds like going directly to PDF from Octave, or using a stronger SVG editor such as Inkscape.

Rik <rik5>
Group administrator
Mon 22 Feb 2021 09:23:34 PM UTC, comment #4: 

There are many things one can do to make it more digestible to
acrobat. I would try to change font to arial.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 22 Feb 2021 09:09:38 PM UTC, comment #3: 

Agreed, this isn't an Octave bug but an Adobe one. Wouldn't be the first time.

Btw, you don't need LibreOffice to convert SVG to PDF. Octave can write PDFs natively. You can also merge multiple PDFs together programmatically with something like pdfsam.

Anonymous
Mon 22 Feb 2021 09:05:37 PM UTC, comment #2: 

I think we all know how responsive Adobe will be to something like this.

Even if a decision is made to do nothing, I'd like to have this in the record so another person who encounters this behavior knows to try to solve it a different way. I expect most people would give up and go to PNG.

Bill Eaton <wpeaton>
Mon 22 Feb 2021 09:01:01 PM UTC, comment #1: 

I think you need to rport it to adobe. A proper program should not crash.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 22 Feb 2021 08:56:40 PM UTC, original submission:  

Forgive me if this is too much of an edge case.

1. make a lot of SVG files from Octave
2. import SVG files into LibreOffice
3. export to PDF
4. if the number of SVG images in LibreOffice
   is high enough (> 40), resulting PDF will
   cause Adobe Acrobat Reader DC1 to crash.
   lower number of images can cause Adobe to
   be laggy.
5. other PDF readers (Firefox, Foxit Reader)
   do not crash. Only Adobe.

For one report, I ended up rewriting my Octave script in Python/Matplotlib and the resulting PDF file opened fine
in Adobe Acrobat Reader.

Bill Eaton <wpeaton>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #50908:  svg_bug.m added by wpeaton (582B - application/octet-stream - this script will create 40 svg files and an html file. open html file with LibreOffice and export to pdf.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by wpeaton (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-22 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2021-02-22 wpeaton Attached File- Added svg_bug.m, #50908

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code