10280,8 → 10280,6 |
bool found = false; |
bool alphaM = false; |
bool realCMYK = false; |
bool bitmapFromGS = false; |
bool isEmbeddedPDF = false; |
bool hasGrayProfile = false; |
bool avoidPDFXOutputIntentProf = false; |
QString profInUse = Profil; |
10290,16 → 10288,10 |
int origWidth = 1; |
int origHeight = 1; |
ShIm ImInfo; |
ImInfo.ResNum = 0; |
ImInfo.sxa = 0; |
ImInfo.sya = 0; |
if (Options.RecalcPic) |
ImInfo.reso = Options.PicRes / 72.0; |
else |
ImInfo.reso = Options.Resolution / 72.0; |
ImInfo.Width = 0; |
ImInfo.Height = 0; |
ImInfo.Page = 0; |
ImInfo.xa = x; |
ImInfo.ya = y; |
ImInfo.origXsc = c->imageXScale(); |
10346,7 → 10338,7 |
} |
else |
imageLoaded = PDF_EmbeddedPDF(c, fn, sx, sy, x, y, fromAN, ImInfo, fatalError); |
isEmbeddedPDF = true; |
ImInfo.isEmbeddedPDF = true; |
ImInfo.Page = c->pixm.imgInfo.actualPageNumber; |
} |
if (!imageLoaded && extensionIndicatesPDF(ext) && c->effectsInUse.count() == 0 && Options.embedPDF) |
10364,7 → 10356,7 |
{ |
if ((extensionIndicatesPDF(ext) || extensionIndicatesEPSorPS(ext)) && (c->pixm.imgInfo.type != ImageType7)) |
{ |
bitmapFromGS = true; |
ImInfo.isBitmapFromGS = true; |
if (Options.RecalcPic) |
{ |
afl = qMin(Options.PicRes, Options.Resolution); |
10898,27 → 10890,13 |
ImInfo = SharedImages[fn]; |
ImInfo.sxa *= sx / ImInfo.xa; |
ImInfo.sya *= sy / ImInfo.ya; |
/* |
ImRes = SharedImages[fn].ResNum; |
ImWid = SharedImages[fn].Width; |
ImHei = SharedImages[fn].Height; |
aufl = SharedImages[fn].reso; |
sxn = SharedImages[fn].sxa * sx / SharedImages[fn].xa; |
syn = SharedImages[fn].sya * sy / SharedImages[fn].ya; |
*/ |
} |
QByteArray embedPre; |
if ((bitmapFromGS) || (isEmbeddedPDF)) // compensate gsResolution setting |
if (ImInfo.isBitmapFromGS || ImInfo.isEmbeddedPDF) // compensate gsResolution setting |
{ |
if (isEmbeddedPDF) |
if (ImInfo.isEmbeddedPDF) |
{ |
// #9268 : per specs default color space is grayscale |
/*if (Options.isGrayscale) |
embedPre = "0 g 0 G"; |
else if (Options.UseRGB) |
embedPre = "0 0 0 rg 0 0 0 RG"; |
else |
embedPre = "0 0 0 0 k 0 0 0 0 K";*/ |
embedPre = "0 g 0 G"; |
embedPre += " 1 w 0 J 0 j [] 0 d\n"; // add default graphics stack parameters pdftex relies on them |
} |
10948,7 → 10926,6 |
else |
embedPre += FToStr(ImInfo.Width*ImInfo.sxa)+" 0 0 "+FToStr(ImInfo.Height*ImInfo.sya)+" "+FToStr(x*sx)+" "+FToStr((-ImInfo.Height*ImInfo.sya+y*sy))+" cm\n"; |
*output = embedPre + Pdf::toName(ResNam+"I"+Pdf::toPdf(ImInfo.ResNum)) + " Do\n"; |
// *output = QString(embedPre + FToStr(ImInfo.Width*ImInfo.sxa)+" 0 0 "+FToStr(ImInfo.Height*ImInfo.sya)+" "+FToStr(x*sx)+" "+FToStr((-ImInfo.Height*ImInfo.sya+y*sy))+" cm\n/"+ResNam+"I"+Pdf::toPdf(ImInfo.ResNum)+" Do\n"); |
} |
else if (output) |
*output = QByteArray(""); |