swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Exporting images from Draw #924

Closed statkclee closed 9 years ago

statkclee commented 9 years ago

I am developing a new lessons for novices, who do not have any experiences on computer science. Computer science unplugged (http://csunplugged.orge) materials seem to be appropriate. Therefore, before conducting software carpentry workshop, we are going to open "computer science unplugged" to novices as sort of flipped learning. We translated csunplugged materials into Korean and we are working on building a website forking software carpentry.

However, there are some issues. one of them is "svg" image associated with white space background.

When I export images to make svg files, I have always big chunk of white space. You might see my problems in our website, which utilizes the same web framework of software carpentry. http://statkclee.github.io/csunplugged-md/csunplugged/01-binary-numbers.html (there are a lot of white spaces in almost all images) However, when I look at .odg and .svg in the img directory, they seems all right. Is there someone who can share experties? Thank you in advance !!!

rgaiacs commented 9 years ago

When I export images to make svg files, I have always big chunk of white space.

This happens because the *.svg is the exactly representation of the paper that you are using to draw (maybe think of a PDF). Since your figure is in the center of the paper the *.svg preserve the margins.

However, when I look at .odg and .svg in the img directory, they seems all right.

If you download https://raw.githubusercontent.com/statkclee/csunplugged-md/gh-pages/csunplugged/img/ch01-binary/01-binary-02-five-cards.svg and open it with you image viewer you will see the margins.

When I checked the SVG code I noticed

<image x="1916" y="12903" width="17167" height="3891" xlink:href="data:image/png;base64,

The SVG images aren't true vector images since it include a bitmap image. I would suggest, in this case, that you just use the PNG images instead of the SVG.

gvwilson commented 9 years ago

There's a known bug in LibreOffice Draw - "export selection" doesn't size the drawing area properly. I export from LibreOffice with a full page as the size, then use Inkscape to resize to fit the visible elements. It's annoying, but it works.