[trunk] SVG images 'printed' twice on PDF 1st page and never on following pages
Context: rev. 5316, latest Qt SDK (Qt lib 4.7.4) under Win XP and Ubuntu 11.10
Steps:
1) load or create a score with an embedded SVG image in the first page AND in one of the following pages (a small sample score is attached)
2) export the score to PDF
Results:
A) the image in the first page is 'printed' twice, once regularly and once as a very (very!!) small raster image near the top left corner of the previous occurrence; this raster image appears no larger than a dot, but by appropriate zooming appears as a second copy of the SVG image;
B) SVG images on pages after the first are not 'printed'.
A sample PDF generated from the sample score is also attached.
Analysis:
Issue A) occurs because in SvgImage::draw()
(file libmscore/image.cpp, line 252) canvasPos()
is used instead of pagePos()
: as each page is generated, the x coord of canvasPos()
increases and on following pages image as generated 'off page'.
Issue B) occurs because, after 'printing' the SVG image in lines 252-254, execution continues at line 267, where the image is printed again as a raster image.
The attached patch corrects both points; a sample PDF generated after applying the patch is also attached.
Thanks,
M.
Attachment | Size |
---|---|
trunk_svg2pdf_multipage.mscz | 24.23 KB |
trunk_svg2pdf_multipage_before.pdf | 21.4 KB |
trunk_svg2pdf_multipage_after.pdf | 18.13 KB |
trunk-svg_on_multipage-image_cpp.patch | 786 bytes |
Comments
patch is applied in r5320
La exportación de fragmentos musicales a Word, por ejemplo, -y sin perder la calidad- es muy importante para los autores musicales.
Automatically closed -- issue fixed for 2 weeks with no activity.