Hi ChrisW67

Thanks for your help..

the implementation Code for the Function LoadPDF

Qt Code:
  1. extern inline QPixmap LoadPDF(QString fn, int Page, int w )
  2. {
  3. QString tmp, cmd1, cmd2;
  4. const QString pdfFile = PathConvert(fn);
  5. const QString tmpFile = PathConvert(QDir::homePath()+"/sctodaytmps.png");
  6. const QString qttmpFile = QDir::homePath()+"/sctodaytmps.png";
  7. QPixmap pm;
  8. tmp.setNum(Page);
  9. int ret = -1;
  10. tmp.setNum(Page);
  11. args.append("-sDEVICE=png16m");
  12. args.append("-r72");
  13. args.append("-dGraphicsAlphaBits=4");
  14. args.append("-o");
  15. args.append(tmpFile);
  16. args.append("-dFirstPage="+tmp);
  17. args.append("-dLastPage="+tmp);
  18. args.append(pdfFile);
  19. ret = callGS(args);
  20. ////////qDebug() << "### ret " << ret;
  21. if (ret == 0)
  22. {
  23. QPixmap tmpimage(qttmpFile);
  24. QPixmap penna = tmpimage.scaledToWidth(w);
  25. tmpimage.detach();
  26. QFile lastaction(qttmpFile);
  27. lastaction.remove();
  28. p.begin(&penna);
  29. p.setBrush(Qt::NoBrush);
  30. p.setPen(QPen(QBrush(Qt::black),2,Qt::SolidLine));
  31. p.drawRect(0, 0, penna.width(), penna.height());
  32. p.end();
  33. return penna;
  34. }
  35. return pm;
  36. }
To copy to clipboard, switch view to plain text mode 



I have tested the way you suggested with this code

Qt Code:
  1. pdfFile = LoadPDF( fixurl.absoluteFilePath() ,page,large);
  2.  
  3. if (pdfFile.isNull())
  4. QMessageBox::warning(0,"pdfFile.isNull() = True ","pdfFile.isNull() = True");
  5.  
  6. QImage tImage = pdfFile.toImage();
  7. if (tImage.isNull())
  8. QMessageBox::warning(0,"tImage.isNull() = True ","tImage.isNull() = True");
To copy to clipboard, switch view to plain text mode 

I'm getting both of the messages .. that mean it's not loading and converting to QPixmap

I think I will miss with the function more tomorrow..

Best Regards