Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 21253 → Rev 21254

/trunk/Scribus/scribus/pdflib_core.cpp
9682,11 → 9682,11
BookMinUse = true;
}
 
bool PDFLibCore::PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, const QString& Profil, bool Embedded, int Intent, ShIm& imgInfo, QByteArray* output)
bool PDFLibCore::PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, ShIm& imgInfo, bool &fatalError)
{
if (!Options.embedPDF)
return false;
 
fatalError = false;
#ifdef HAVE_PODOFO
// Try to catch potential pdf parsing exceptions early
9986,9 → 9986,9
}
catch(PoDoFo::PdfError& e)
{
fatalError = true;
qDebug() << "PoDoFo error!";
e.PrintErrorMsg();
assert (false);
return false;
}
#endif
10163,6 → 10163,8
|| (ImInfo2.Page != c->pixm.imgInfo.actualPageNumber))
{
bool imageLoaded = false;
bool fatalError = false;
QString pdfFile = fn;
if ((extensionIndicatesPDF(ext) || ((extensionIndicatesEPSorPS(ext)) && (c->pixm.imgInfo.type != ImageType7))) && c->effectsInUse.count() == 0)
{
if (extensionIndicatesEPSorPS(ext))
10181,17 → 10183,25
opts.append( "-sProcessColorModel=/DeviceCMYK" ); */
if (convertPS2PDF(fn, tmpFile, opts) == 0)
{
imageLoaded = PDF_EmbeddedPDF(c, tmpFile, sx, sy, x, y, fromAN, Profil, Embedded, Intent, ImInfo, output);
imageLoaded = PDF_EmbeddedPDF(c, tmpFile, sx, sy, x, y, fromAN, ImInfo, fatalError);
QFile::remove(tmpFile);
}
pdfFile = tmpFile;
}
else
imageLoaded = PDF_EmbeddedPDF(c, fn, sx, sy, x, y, fromAN, Profil, Embedded, Intent, ImInfo, output);
imageLoaded = PDF_EmbeddedPDF(c, fn, sx, sy, x, y, fromAN, ImInfo, fatalError);
isEmbeddedPDF = true;
ImInfo.Page = c->pixm.imgInfo.actualPageNumber;
}
if (!imageLoaded && extensionIndicatesPDF(ext) && c->effectsInUse.count() == 0 && Options.embedPDF)
{
if (fatalError)
{
PDF_Error( tr("Failed to embed the PDF file : %1").arg(pdfFile) );
return false;
}
qDebug() << "Failed to embed the PDF file";
}
// no embedded PDF:
if (!imageLoaded)
{
/trunk/Scribus/scribus/pdflib_core.h
219,7 → 219,7
void PDF_Form(const QByteArray& im);
void PDF_xForm(uint objNr, double w, double h, QByteArray im);
bool PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = NULL);
bool PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, const QString& Profil, bool Embedded, int Intent, ShIm& imgInfo, QByteArray* output = NULL);
bool PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, ShIm& imgInfo, bool &fatalError);
#if HAVE_PODOFO
void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
void copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);