Problem in converting a .ps in .pdf with multiple images of the same pixmap
Hello,
this is the very simple program I wrote:
Code:
QPixmap sigmaPixmap
("Immagini/sigma.xpm");
for(int i
=1;i<
5;i
++) paint.
drawPixmap(QPointF(10*i,
10),sigmaPixmap
);
If I use this code to print on screen, I have no problem.
if I use it to print on .ps,no problem.
The problem arises when I try to convert the ps to pdf usint "gs",this is the error I get:
convert: Delegate failed `"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -sDEVICE="pdfwrite" -sOutputFile="%o" -f"%i"'.
Please,don't tell me to print directly in pdf! :) I need to print first on ps...
I also tryed to create a Vector of pixmap like this:
Code:
QVector<QPixmap> pix(5,sigmaPixmap);
for(int i
=1;i<
5;i
++) paint2.
drawPixmap(QPointF(10*i,
10),pix
[i
]);
but the result is the same.
What do you think?
thanks!
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
Quote:
Originally Posted by vratojr
The problem arises when I try to convert the ps to pdf usint "gs",this is the error I get:
convert: Delegate failed `"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -sDEVICE="pdfwrite" -sOutputFile="%o" -f"%i"'.
The problem seems the string -sOutputFile="%o" -f"%i"'.
Check the argument passed to QProcess.
Bye
1 Attachment(s)
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
Here it is the generated ps image.
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
Why are you using QProcess???
I thought QT 4 (I'm using 4.1.1 snapshot but this feature is present in QT 4.1.0) had the ability to convert document to .pdf format.
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
I have to print in .ps because I qant to include the .ps file in a latex documet.
Any hint?
Thanks.
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
I don't undertsand how this is a Qt problem. The code you've shown us has nothing to do with converting PostScript to PDF.
I guess the program you're using to convert PDF to PostScript is called with wrong parameters. But you don't show us how the program is called...
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
I think it has something to do with Qt, I suppose that the problem arises not from the converter but from the code I wrote, maybe there is a problem there.
For the converter, I simpy use gv and call it the same way I call it to convert a .ps to .pdf that is: "convert img.ps img.pdf" and I don't thnk the problem lies here since as I told:
If i draw a single pixmap in the ps file I can convert it without problems, I i draw multiple pixmap (the same pixmap) I cannot convert it.
I'm not sure it's a Qt problem but I think so... I asked youbecause I wanted to know...
Thanks!
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
As I said: you don't show us how the program is called...
You're probably not calling convert from Qt the same way it is called from the command line.
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
Oh, I now understand the problem. Qt generates the PostScript image you had posted. Then convert fails to convert the PostScript to PDF, whether you call it from Qt or not. So you suspect the PostScript file generated by Qt is broken.
OK, I will try to have a look at the PostScript file... but I'm no specialist of PostScript.
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
This works for me:
Code:
convert fava.ps fava.pdf
I guess convert or gs are broken on your system?
Re: Problem in converting a .ps in .pdf with multiple images of the same pixmap
Quote:
Originally Posted by dimitri
This works for me:
Code:
convert fava.ps fava.pdf
I guess
convert or
gs are broken on your system?
Arrrrrrrrrgh!
Ok thank you! I'll try to see to fit it... It's quite strange since I get en error only with this kind of files.
Thank you!