The generated PNG file is in PT_PER_IN resolution: 72 DPI! But when I change PT_PER_IN to "dpi", the generated temporary PNG looks good (at least for me), but the PDF contains zoomed-in picture - looks like it doesn't use the PNG's DPI (600), but forces it to use 72 DPI again (I don't know how to check the size of the picture in the PDF to verify this), so the resulting PNG's size in PDF is 8 times (600/72) bigger than the page.
After some investigation I discovered the intermediate PNG file has wrong resolution. It is problem in src/ui/ dialogs/ print.cpp in draw_page() method:
sp_export_ png_file( junk->_ doc, tmp_png.c_str(), 0.0, 0.0, width, height, (unsigned long)(width * PT_PER_IN / PX_PER_IN), (unsigned long)(height * PT_PER_IN / PX_PER_IN), dpi, dpi, bgcolor, NULL, NULL, true, NULL);
The generated PNG file is in PT_PER_IN resolution: 72 DPI! But when I change PT_PER_IN to "dpi", the generated temporary PNG looks good (at least for me), but the PDF contains zoomed-in picture - looks like it doesn't use the PNG's DPI (600), but forces it to use 72 DPI again (I don't know how to check the size of the picture in the PDF to verify this), so the resulting PNG's size in PDF is 8 times (600/72) bigger than the page.
Some hints?