Sander Marechal wrote:
Hello,

I have a problem generating PDFs from Lyx. I want to make reports
using Lyx but I cannot get my images right. The graphs that go in the
reports are PNGs (converted from SVGs). When I use the dvipdfm or
ps2pdf method to generate the pdf reports, I get ugly compression
artifacts on my graphs. I presume this is because those two methods
convert my PNG to jpeg/eps before embedding it in the PDF.

So, I want to use the pdflatex function which is able to use the PNG
directly and embed it without compression artifacts. Problem: All
PNGs embedde by pdflatex have an ugly black border on the right and
bottom of the image. I have no idea what causes this or how to fix
it. Any idea's?

Here are the three PDF's I created: http://www.jejik.com/sander/lyx/dvipdfm.pdf http://www.jejik.com/sander/lyx/pdflatex.pdf http://www.jejik.com/sander/lyx/ps2pdf.pdf

And here is the lyx + image: http://www.jejik.com/sander/lyx/report.lyx http://www.jejik.com/sander/lyx/graph.png

Can anyone help me get rid of the unsightly black right and bottom
border in pdflatex? If not, can anyone suggest a way to get the graph
in the pdf without compression artifacts using dvipdfm or ps2pdf?

Kind regards,


The PNG contains a black border on the right and bottom.  I had to open
it in IrfanView and expand the blank canvas around it to distinguish the
border from the edge of the window, but it's there.

So the long-term solution is to fix the way you're generating the
PNGs from the SVGs or, as suggested elsewhere, find a way to go straight from SVG to PDF.

Meanwhile, a work-around is to select "Clip to bounding box" in the LyX graphics dialog, get the bounding box from the file if necessary, then increase the bottom y by 1 bp and decrease the right x by 1 bp to crop out the lines.

HTH,
Paul

Reply via email to