Re: [Interest] PDF to QByteArray

2014-03-01 Thread Marcelo Estanislau Geyer
Thanks for all the answers. My problem is really with the POCO library I'm using, I'll have to check that. The output of qDebug left me confused and in doubt, but I wrote this code confirmed that Qt code was correct from the beginning: QFile file("/home/marcelo/Documents/Test.pdf"); if (!file.op

[Interest] PDF to QByteArray

2014-03-01 Thread Marcelo Estanislau Geyer
It's possible load pdf file to QByteArray? The simple code below is not work: QFile file("/home/marcelo/Documents/test.pdf"); if (!file.open(QIODevice::ReadOnly)) {qDebug() << "file open error"; return;} QByteArray ba_pdf = file.readAll(); qDebug() << ba_pdf; file.close(); The output is

Re: [Interest] PDF to QByteArray

2014-02-28 Thread Marcelo Estanislau Geyer
Thanks for all the answers. My problem is really with the POCO library I'm using, I'll have to check that. The output of qDebug left me confused and in doubt, but I wrote this code confirmed that Qt code was correct from the beginning: QFile file("/home/marcelo/Documents/Test.pdf"); if

Re: [Interest] PDF to QByteArray

2014-02-28 Thread Jason H
) Also as Till Oliver Knoll, points out, you can't trust the output of dDebug() with binary content. (0 value char ends the string) From: Till Oliver Knoll To: Qt Project Sent: Friday, February 28, 2014 9:17 AM Subject: Re: [Interest] PDF to QByte

Re: [Interest] PDF to QByteArray

2014-02-28 Thread Till Oliver Knoll
Am 28.02.2014 um 12:00 schrieb Jan Kundrát : > On Friday, 28 February 2014 11:02:33 CEST, Till Oliver Knoll wrote: >> Or in just one line: >> >> QByteArray::toBase64() > > For the record, this is not enough -- the MIME standard imposes additional > restrictions, ... Off course ;) The point t

Re: [Interest] PDF to QByteArray

2014-02-28 Thread Jan Kundrát
On Friday, 28 February 2014 11:02:33 CEST, Till Oliver Knoll wrote: > Or in just one line: > > QByteArray::toBase64() For the record, this is not enough -- the MIME standard imposes additional restrictions, one of them being line lengths, the other are proper headers, etc. Cheers, Jan -- T

Re: [Interest] PDF to QByteArray

2014-02-28 Thread Till Oliver Knoll
Am 28.02.2014 um 08:48 schrieb Scott Aron Bloom : > However, there are Qt base libraries.. QtExt for instance, that do allow the > attachments from QByteArray, and they do all the computation into Base64 > hidden from the user. Or in just one line: QByteArray::toBase64() (In case the email

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Scott Aron Bloom
@qt-project.org] On Behalf Of Till Oliver Knoll Sent: Thursday, February 27, 2014 11:00 PM To: Qt Project Subject: Re: [Interest] PDF to QByteArray Am 28.02.2014 um 02:58 schrieb Marcelo Estanislau Geyer mailto:estanisge...@hotmail.com>>: So that they can understand, I need to put the co

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Till Oliver Knoll
Am 28.02.2014 um 02:58 schrieb Marcelo Estanislau Geyer : > > So that they can understand, I need to put the contents of a pdf file into a > QByteArray, as this QByteArray is used as an attachment in the email sending > process. What makes you think you can attach any random BLOB to an email

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Jason H
m: Marcelo Estanislau Geyer To: "interest@qt-project.org" Sent: Thursday, February 27, 2014 8:58 PM Subject: Re: [Interest] PDF to QByteArray So that they can understand, I need to put the contents of a pdf file into a QByteArray, as this QByteArray is used as an attachment

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Thiago Macieira
Em sex 28 fev 2014, às 01:58:39, Marcelo Estanislau Geyer escreveu: > So that they can understand, I need to put the contents of a pdf file into a > QByteArray, as this QByteArray is used as an attachment in the email > sending process. > > I did a test with a postscript file (.ps file) and it wor

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Constantin Makshin
If you want to test sending en email, send it an check what happens. Or, at least, print the final (i.e. with all encoding and other things being done, exactly what you'd send to an SMTP server) message. Don't try to print a PDF file contents "as is" — it's not a 100% text-based format and may cont

Re: [Interest] PDF to QByteArray

2014-02-27 Thread Marcelo Estanislau Geyer
So that they can understand, I need to put the contents of a pdf file into a QByteArray, as this QByteArray is used as an attachment in the email sending process. I did a test with a postscript file (.ps file) and it worked perfectly. I only have this problem with pdf files. How can I read and

Re: [Interest] PDF to QByteArray

2014-02-25 Thread Rainer Wiesenfarth
Am 26.02.2014 04:02, schrieb Marcelo Estanislau Geyer: It's possible load pdf file to QByteArray? The simple code below is not work: QFile file("/home/marcelo/Documents/test.pdf"); if (!file.open(QIODevice::ReadOnly)) { qDebug() << "file open error"; return; } QByteArray ba_pdf = file.r

Re: [Interest] PDF to QByteArray

2014-02-25 Thread Guido Seifert
> It's possible load pdf file to QByteArray? The simple code below is not work: But your code works perfectly. You successfully loaded the pdf file into your QByteArray. But I suppose what you really wanted, is that your document is rendered. Sorry, QByteArray is no pdf renderer. Maybe this w

[Interest] PDF to QByteArray

2014-02-25 Thread Marcelo Estanislau Geyer
It's possible load pdf file to QByteArray? The simple code below is not work: QFile file("/home/marcelo/Documents/test.pdf"); if (!file.open(QIODevice::ReadOnly)) {qDebug() << "file open error"; return;} QByteArray ba_pdf = file.readAll(); qDebug() << ba_pdf; file.close(); The output is