maartenS
16th November 2008, 13:54
Hi,
I'm trying to save a QDocument as pdf file on a specific location.
QPrinter toPdf;
toPdf.setOutputFormat(QPrinter::PdfFormat);
toPdf.setOutputFileName("test.pdf");
works, but when I'm trying to write a pdf file to a certain directory, i.e. home directory:
QPrinter toPdf;
toPdf.setOutputFormat(QPrinter::PdfFormat);
toPdf.setOutputFileName("~/test.pdf");
it doesn't work and I get this message:
QPainter::begin(): Returned false
Does anyone know how to solve this or if there is another way of doing this?
Thanks!
I'm trying to save a QDocument as pdf file on a specific location.
QPrinter toPdf;
toPdf.setOutputFormat(QPrinter::PdfFormat);
toPdf.setOutputFileName("test.pdf");
works, but when I'm trying to write a pdf file to a certain directory, i.e. home directory:
QPrinter toPdf;
toPdf.setOutputFormat(QPrinter::PdfFormat);
toPdf.setOutputFileName("~/test.pdf");
it doesn't work and I get this message:
QPainter::begin(): Returned false
Does anyone know how to solve this or if there is another way of doing this?
Thanks!