pdf_hummus_renderer.cpp (TeXmacs-2.1.1-src) | : | pdf_hummus_renderer.cpp (TeXmacs-2.1.2-src) | ||
---|---|---|---|---|
skipping to change at line 1713 | skipping to change at line 1713 | |||
void | void | |||
pdf_image_rep::flush (PDFWriter& pdfw) | pdf_image_rep::flush (PDFWriter& pdfw) | |||
{ | { | |||
url name= resolve (u); | url name= resolve (u); | |||
if (is_none (name)) | if (is_none (name)) | |||
name= "$TEXMACS_PATH/misc/pixmaps/unknown.ps"; | name= "$TEXMACS_PATH/misc/pixmaps/unknown.ps"; | |||
url temp; | url temp; | |||
string s= suffix (name); | string s= suffix (name); | |||
// debug_convert << "flushing :" << fname << LF; | //debug_convert << "flushing :" << name << LF; | |||
if (s == "pdf") { | if (s == "pdf") { | |||
// double v= as_double (pdf_version (name)); | // double v= as_double (pdf_version (name)); | |||
// if (10 * v > ((double) ePDFVersion)) | // if (10 * v > ((double) ePDFVersion)) | |||
// convert_warning << "\"" << concretize (name) << "\" has version " | // convert_warning << "\"" << concretize (name) << "\" has version " | |||
// << v << "." << LF | // << v << "." << LF | |||
// << "But current PDF version has been set to " << (( double) ePDFVersion)/10 | // << "But current PDF version has been set to " << (( double) ePDFVersion)/10 | |||
// << " (see the preference menu)." << LF; | // << " (see the preference menu)." << LF; | |||
if (get_preference ("texmacs->pdf:distill inclusion") == "on") { | if (get_preference ("texmacs->pdf:distill inclusion") == "on") { | |||
temp= url_temp (".pdf"); | temp= url_temp (".pdf"); | |||
if (!gs_PDF_EmbedAllFonts (name, temp)) { | if (!gs_PDF_EmbedAllFonts (name, temp)) { | |||
skipping to change at line 1769 | skipping to change at line 1769 | |||
if(copyingContext) { | if(copyingContext) { | |||
PDFPageInput pageInput(copyingContext->GetSourceDocumentParser(), | PDFPageInput pageInput(copyingContext->GetSourceDocumentParser(), | |||
copyingContext->GetSourceDocumentParser()->ParsePage(0 )); | copyingContext->GetSourceDocumentParser()->ParsePage(0 )); | |||
EPDFVersion version= (EPDFVersion)(int)(copyingContext->GetSourceDocumentPar ser()->GetPDFLevel() * 10); | EPDFVersion version= (EPDFVersion)(int)(copyingContext->GetSourceDocumentPar ser()->GetPDFLevel() * 10); | |||
if (version > ePDFVersion) | if (version > ePDFVersion) | |||
convert_warning << "\"" << _temp << "\" has version " << ((double) version )/10 << "." << LF | convert_warning << "\"" << _temp << "\" has version " << ((double) version )/10 << "." << LF | |||
<< "But current PDF version has been set to " << ((double) ePDFVersion)/10 | << "But current PDF version has been set to " << ((double) ePDFVersion)/10 | |||
<< " (see the preference menu)." << LF; | << " (see the preference menu)." << LF; | |||
double tMat[6] ={ 1,0, 0, 1, 0, 0} ; | double tMat[6] ={ 1,0, 0, 1, 0, 0} ; | |||
PDFRectangle cropBox (0,0,0,0); | PDFRectangle cropBox (0,0,0,0); | |||
pdf_image_info (temp, w, h, cropBox, tMat, pageInput); | int neww,newh; | |||
pdf_image_info (temp, neww, newh, cropBox, tMat, pageInput); | ||||
//debug_convert << "new w,h :" << neww << " "<< newh << LF; | ||||
if ((neww != w) && (neww !=0)) { | ||||
//image size changed, resize it to what we wanted | ||||
double r = w/(double)neww; | ||||
int j; | ||||
for (j= 0; j < 6; j++) tMat[j] *= r; | ||||
} | ||||
PDFFormXObject *form = dc.StartFormXObject(cropBox, id, tMat, true); | PDFFormXObject *form = dc.StartFormXObject(cropBox, id, tMat, true); | |||
status = copyingContext->MergePDFPageToFormXObject(form,0); | status = copyingContext->MergePDFPageToFormXObject(form,0); | |||
if(status == eSuccess) pdfw.EndFormXObjectAndRelease(form); | if(status == eSuccess) pdfw.EndFormXObjectAndRelease(form); | |||
delete copyingContext; | delete copyingContext; | |||
} | } | |||
if(!is_none(name)) remove (temp); | if(!is_none(name)) remove (temp); | |||
if (status == PDFHummus::eFailure) { | if (status == PDFHummus::eFailure) { | |||
convert_error << "pdf_hummus, failed to include image file: " | convert_error << "pdf_hummus, failed to include image file: " | |||
<< temp << LF; | << temp << LF; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 10 lines changed or added |