cBioPortal / icebox

very low priority issues
0 stars 0 forks source link

Bug downloading PDF from Comparison Page #183

Open n1zea144 opened 3 years ago

n1zea144 commented 3 years ago

A google user has reported an issue downloading a PDF (SVG works) for a comparison they have constructed, https://www.cbioportal.org/comparison?comparisonId=608d8e6ce4b015b63e9e914a.

In fact it does look like there is a an uncaught exception in a promise:

image

zhx828 commented 3 years ago

Another user reported the similar issue on http://www.cbioportal.org/comparison?comparisonId=60af670ae4b0f0abac8b26c1 @alisman could you take a look and assign the ticket? Thanks.

worker000000 commented 3 years ago

Thanks a lot. and I hope the two plot can have seperate download botton. and what is the difference of the two plot, looks the same image

jagnathan commented 2 years ago

The error happens due to bad SVG file . I have attached the bad SVG file and PDF print.

This page contains the following errors: error on line 2366 at column 19: Unescaped '<' not allowed in attributes values Below is a rendering of the page up to the first error.

overlap.pdf overlap.svg.zip

jagnathan commented 2 years ago

The PR https://github.com/cBioPortal/cbioportal-frontend/pull/3812 fixes the incorrect SVG issue. To generate the PDF, two steps are required now. Downloading the SVG after the fix is applied and then converting it to PDF using a different application.

jagnathan commented 2 years ago

Identified the line that causes the PDF error. {this.getGroupIntersectionLines} in file Upset.tsx overlap-11.pdf

jagnathan commented 2 years ago

The "getGroupIntersectionLines" adds lines across the various points in the scattered plot. This causes issues in SVG2PDF package because of the clippath attribute. https://github.com/yWorks/svg2pdf.js/issues/180

The issue occurs if there are lines or no lines. Currently the SVG file is generated as designed. Conversion to PDF is not functional. @jjgao can you please review the issue?

jagnathan commented 2 years ago

Attaching PDF image when the getGroupIntersectionLines is removed. This creates extra characters in the PDF near the X-axis. overlap-11.pdf

worker000000 commented 2 years ago

@jjgao @zhx828 thanks a lot for the continous help, so has it been completed filshed? I downloaded the pdf you uploaded, as you said "This creates extra characters in the PDF near the X-axis" image

jagnathan commented 2 years ago

@worker000000 The SVG, PNG formats work as expected. The PR https://github.com/cBioPortal/cbioportal-frontend/pull/3812 has fixed that issue. The SVG to PDF conversion is dependent on svg2pdf package. Fixing the bug https://github.com/yWorks/svg2pdf.js/issues/180 will solve that issue. As a workaround, downloading the SVG or PNG file and then converting it to PDF manually will help.

worker000000 commented 2 years ago

Thanks a lot @jagnathan i used online tools to convert

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.