Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1475 → Rev 1476

/branches/Version13x/Scribus/scribus/fileloader.cpp
851,6 → 851,7
doc->PDF_Optionen.Resolution = QStoInt(pg.attribute("Resolution"));
doc->PDF_Optionen.Binding = QStoInt(pg.attribute("Binding"));
doc->PDF_Optionen.Datei = "";
doc->PDF_Optionen.isGrayscale = static_cast<bool>(QStoInt(pg.attribute("Grayscale","0")));
doc->PDF_Optionen.UseRGB = static_cast<bool>(QStoInt(pg.attribute("RGBMode","0")));
doc->PDF_Optionen.UseProfiles = static_cast<bool>(QStoInt(pg.attribute("UseProfiles","0")));
doc->PDF_Optionen.UseProfiles2 = static_cast<bool>(QStoInt(pg.attribute("UseProfiles2","0")));
/branches/Version13x/Scribus/scribus/util.cpp
112,8 → 112,9
QString CompressStr(QString *in);
QString ImageToTxt(QImage *im);
QString ImageToCMYK(QImage *im);
QString ImageToGray(QImage *im);
QString ImageToCMYK_PS(QImage *im, int pl, bool pre);
void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK);
void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK, bool isGray);
QString MaskToTxt(QImage *im, bool PDF = true);
QString MaskToTxt14(QImage *im);
void Level2Layer(ScribusDoc *currentDoc, struct Layer *ll, int Level);
1043,6 → 1044,26
return ImgStr;
}
 
QString ImageToGray(QImage *im)
{
int h = im->height();
int w = im->width();
QString ImgStr = "";
for( int yi=0; yi < h; ++yi )
{
QRgb * s = (QRgb*)(im->scanLine( yi ));
for( int xi=0; xi < w; ++xi )
{
QRgb r=*s;
int k = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
*s = qRgba(k, 0, 0, 0);
ImgStr += k;
s++;
}
}
return ImgStr;
}
 
QString ImageToCMYK_PS(QImage *im, int pl, bool pre)
{
int h = im->height();
1177,7 → 1198,7
longjmp (myerr->setjmp_buffer, 1);
}
 
void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK)
void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK, bool isGray)
{
struct jpeg_compress_struct cinfo;
struct my_error_mgr jerr;
1207,8 → 1228,16
}
else
{
cinfo.in_color_space = JCS_RGB;
cinfo.input_components = 3;
if (isGray)
{
cinfo.in_color_space = JCS_GRAYSCALE;
cinfo.input_components = 1;
}
else
{
cinfo.in_color_space = JCS_RGB;
cinfo.input_components = 3;
}
}
jpeg_set_defaults (&cinfo);
int qual[] = { 95, 85, 75, 50, 25 }; // These are the JPEG Quality settings 100 means best, 0 .. don't discuss
1233,14 → 1262,26
}
else
{
QRgb* rgb = (QRgb*)image->scanLine(cinfo.next_scanline);
for (int i=0; i<w; i++)
if (isGray)
{
*row++ = qRed(*rgb);
*row++ = qGreen(*rgb);
*row++ = qBlue(*rgb);
++rgb;
QRgb* rgba = (QRgb*)image->scanLine(cinfo.next_scanline);
for (int i=0; i<w; ++i)
{
*row++ = qRed(*rgba);
++rgba;
}
}
else
{
QRgb* rgb = (QRgb*)image->scanLine(cinfo.next_scanline);
for (int i=0; i<w; i++)
{
*row++ = qRed(*rgb);
*row++ = qGreen(*rgb);
*row++ = qBlue(*rgb);
++rgb;
}
}
}
jpeg_write_scanlines (&cinfo, row_pointer, 1);
}
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp
497,8 → 497,17
OutCombo = new QComboBox( true, ColorGroup, "OutCombo" );
OutCombo->insertItem( tr( "Screen / Web" ) );
OutCombo->insertItem( tr( "Printer" ) );
OutCombo->insertItem( tr( "Grayscale" ) );
OutCombo->setEditable(false);
OutCombo->setCurrentItem(Optionen->UseRGB ? 0 : 1);
if (Optionen->UseRGB)
OutCombo->setCurrentItem(0);
else
{
if (Optionen->isGrayscale)
OutCombo->setCurrentItem(2);
else
OutCombo->setCurrentItem(1);
}
ColorText1->setBuddy(OutCombo);
ColorGroupLayout->addWidget( OutCombo );
tabColorLayout->addWidget( ColorGroup );
607,12 → 616,14
IntendI->setEditable(false);
ProfsGroupLayout->addWidget( IntendI, 3, 1 );
tabColorLayout->addWidget( ProfsGroup );
if (Optionen->UseRGB)
if ((Optionen->UseRGB) || (Optionen->isGrayscale))
{
ProfsGroup->setEnabled(false);
GroupBox9->setEnabled(false);
EnablePr(0);
}
EnablePr(Optionen->UseRGB ? 0 : 1);
else
EnablePr(1);
EnablePG();
EnablePGI();
#ifdef HAVE_CMS
1057,6 → 1068,7
{
GroupBox9->show();
ProfsGroup->show();
UseLPI->hide();
}
else
{
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
217,6 → 217,7
PDF_Optionen.PresentMode = prefsData->PDF_Optionen.PresentMode;
PDF_Optionen.Datei = prefsData->PDF_Optionen.Datei;
PDF_Optionen.PresentVals = prefsData->PDF_Optionen.PresentVals;
PDF_Optionen.isGrayscale = prefsData->PDF_Optionen.isGrayscale;
PDF_Optionen.UseRGB = prefsData->PDF_Optionen.UseRGB;
PDF_Optionen.UseProfiles = prefsData->PDF_Optionen.UseProfiles;
PDF_Optionen.UseProfiles2 = prefsData->PDF_Optionen.UseProfiles2;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
1522,6 → 1522,7
doc->PDF_Optionen.Resolution = QStoInt(pg.attribute("Resolution"));
doc->PDF_Optionen.Binding = QStoInt(pg.attribute("Binding"));
doc->PDF_Optionen.Datei = "";
doc->PDF_Optionen.isGrayscale = false;
doc->PDF_Optionen.UseRGB = static_cast<bool>(QStoInt(pg.attribute("RGBMode","0")));
doc->PDF_Optionen.UseProfiles = static_cast<bool>(QStoInt(pg.attribute("UseProfiles","0")));
doc->PDF_Optionen.UseProfiles2 = static_cast<bool>(QStoInt(pg.attribute("UseProfiles2","0")));
2762,6 → 2763,7
pdf.setAttribute("RotateDeg", static_cast<int>(doc->PDF_Optionen.RotateDeg));
pdf.setAttribute("PresentMode", static_cast<int>(doc->PDF_Optionen.PresentMode));
pdf.setAttribute("RecalcPic", static_cast<int>(doc->PDF_Optionen.RecalcPic));
pdf.setAttribute("Grayscale", static_cast<int>(doc->PDF_Optionen.isGrayscale));
pdf.setAttribute("RGBMode", static_cast<int>(doc->PDF_Optionen.UseRGB));
pdf.setAttribute("UseProfiles", static_cast<int>(doc->PDF_Optionen.UseProfiles));
pdf.setAttribute("UseProfiles2", static_cast<int>(doc->PDF_Optionen.UseProfiles2));
3158,6 → 3160,7
pdf.setAttribute("RotateDeg", static_cast<int>(Vor->PDF_Optionen.RotateDeg));
pdf.setAttribute("PresentMode", static_cast<int>(Vor->PDF_Optionen.PresentMode));
pdf.setAttribute("RecalcPic", static_cast<int>(Vor->PDF_Optionen.RecalcPic));
pdf.setAttribute("Grayscale", static_cast<int>(Vor->PDF_Optionen.isGrayscale));
pdf.setAttribute("RGBMode", static_cast<int>(Vor->PDF_Optionen.UseRGB));
pdf.setAttribute("UseProfiles", static_cast<int>(Vor->PDF_Optionen.UseProfiles));
pdf.setAttribute("UseProfiles2", static_cast<int>(Vor->PDF_Optionen.UseProfiles2));
3535,6 → 3538,7
Vorein->PDF_Optionen.Resolution = QStoInt(dc.attribute("Resolution"));
Vorein->PDF_Optionen.Binding = QStoInt(dc.attribute("Binding"));
Vorein->PDF_Optionen.Datei = "";
Vorein->PDF_Optionen.isGrayscale = static_cast<bool>(QStoInt(dc.attribute("Grayscale","0")));
Vorein->PDF_Optionen.UseRGB = static_cast<bool>(QStoInt(dc.attribute("RGBMode","0")));
Vorein->PDF_Optionen.UseProfiles = static_cast<bool>(QStoInt(dc.attribute("UseProfiles","0")));
Vorein->PDF_Optionen.UseProfiles2 = static_cast<bool>(QStoInt(dc.attribute("UseProfiles2","0")));
/branches/Version13x/Scribus/scribus/icons/DrawFrame.xpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/icons/DrawTextFrame.xpm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/Version13x/Scribus/scribus/icons/DrawTextFrame.xpm
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/icons/DrawTable.xpm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/Version13x/Scribus/scribus/icons/DrawTable.xpm
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/icons/Makefile.am
===================================================================
--- branches/Version13x/Scribus/scribus/icons/Makefile.am (revision 1475)
+++ branches/Version13x/Scribus/scribus/icons/Makefile.am (revision 1476)
@@ -1,8 +1,13 @@
-EXTRA_DIST = plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift.xpm Text.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline.png triangle.png Stiftalt.xpm beziertool.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table.png scribusdoc.png documentinfo.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png
+EXTRA_DIST = DrawFrame.xpm DrawImageFrame.xpm DrawPolylineFrame.xpm DrawTable.xpm DrawTextFrame.xpm plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift.xpm Text.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline.png triangle.png Stiftalt.xpm beziertool.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table.png scribusdoc.png documentinfo.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png
install-data-local:
$(mkinstalldirs) $(prefix)/share/scribus/icons/
$(mkinstalldirs) $(prefix)/share/pixmaps/
+ $(INSTALL_DATA) $(srcdir)/DrawTextFrame.xpm $(prefix)/share/scribus/icons/DrawTextFrame.xpm
+ $(INSTALL_DATA) $(srcdir)/DrawTable.xpm $(prefix)/share/scribus/icons/DrawTable.xpm
+ $(INSTALL_DATA) $(srcdir)/DrawPolylineFrame.xpm $(prefix)/share/scribus/icons/DrawPolylineFrame.xpm
+ $(INSTALL_DATA) $(srcdir)/DrawImageFrame.xpm $(prefix)/share/scribus/icons/DrawImageFrame.xpm
+ $(INSTALL_DATA) $(srcdir)/DrawFrame.xpm $(prefix)/share/scribus/icons/DrawFrame.xpm
$(INSTALL_DATA) $(srcdir)/plugins.png $(prefix)/share/scribus/icons/plugins.png
$(INSTALL_DATA) $(srcdir)/filenew.png $(prefix)/share/scribus/icons/filenew.png
$(INSTALL_DATA) $(srcdir)/fileopen.png $(prefix)/share/scribus/icons/fileopen.png
@@ -421,4 +426,9 @@
-rm -f $(prefix)/share/scribus/icons/editcopy22.png
-rm -f $(prefix)/share/scribus/icons/edittrash.png
-rm -f $(prefix)/share/scribus/icons/plugins.png
+ -rm -f $(prefix)/share/scribus/icons/DrawTextFrame.xpm
+ -rm -f $(prefix)/share/scribus/icons/DrawTable.xpm
+ -rm -f $(prefix)/share/scribus/icons/DrawPolylineFrame.xpm
+ -rm -f $(prefix)/share/scribus/icons/DrawImageFrame.xpm
+ -rm -f $(prefix)/share/scribus/icons/DrawFrame.xpm
/branches/Version13x/Scribus/scribus/icons/DrawImageFrame.xpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/icons/DrawPolylineFrame.xpm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/Version13x/Scribus/scribus/icons/DrawPolylineFrame.xpm
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/scribusstructs.h
===================================================================
--- branches/Version13x/Scribus/scribus/scribusstructs.h (revision 1475)
+++ branches/Version13x/Scribus/scribus/scribusstructs.h (revision 1476)
@@ -291,6 +291,7 @@
bool PresentMode;
QValueList<PDFPresentationData> PresentVals;
QString Datei;
+ bool isGrayscale;
bool UseRGB;
bool UseProfiles;
bool UseProfiles2;
Index: branches/Version13x/Scribus/scribus/scribusview.cpp
===================================================================
--- branches/Version13x/Scribus/scribus/scribusview.cpp (revision 1475)
+++ branches/Version13x/Scribus/scribus/scribusview.cpp (revision 1476)
@@ -3444,7 +3444,29 @@
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
}
else
- qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+ {
+ switch (Doc->appMode)
+ {
+ case DrawShapes:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")), true);
+ break;
+ case DrawPicture:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawImageFrame.xpm")), true);
+ break;
+ case DrawText:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")), true);
+ break;
+ case DrawTable:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTable.xpm")), true);
+ break;
+ case DrawRegularPolygon:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")), true);
+ break;
+ default:
+ qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+ break;
+ }
+ }
return;
}
for (a = 0; a < SelItem.count(); ++a)
@@ -3528,9 +3550,31 @@
if (!b->sizeLocked())
HandleCurs(&p, b, mpo);
}
- else
- qApp->setOverrideCursor(QCursor(ArrowCursor), true);
}
+ else
+ {
+ switch (Doc->appMode)
+ {
+ case DrawShapes:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")), true);
+ break;
+ case DrawPicture:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawImageFrame.xpm")), true);
+ break;
+ case DrawText:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")), true);
+ break;
+ case DrawTable:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTable.xpm")), true);
+ break;
+ case DrawRegularPolygon:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")), true);
+ break;
+ default:
+ qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+ break;
+ }
+ }
p.end();
}
}
Index: branches/Version13x/Scribus/scribus/libabout/about.cpp
===================================================================
--- branches/Version13x/Scribus/scribus/libabout/about.cpp (revision 1475)
+++ branches/Version13x/Scribus/scribus/libabout/about.cpp (revision 1476)
@@ -65,7 +65,7 @@
tabLayout1->addWidget( pixmapLabel1 );
buildID = new QLabel( tab, "BB" );
buildID->setAlignment(Qt::AlignCenter);
- QString bu = tr("%1. %2 %3 ").arg("8").arg("February").arg("2005");
+ QString bu = tr("%1. %2 %3 ").arg("9").arg("February").arg("2005");
#ifdef HAVE_CMS
bu += "C";
#else
Index: branches/Version13x/Scribus/scribus/scribus.cpp
===================================================================
--- branches/Version13x/Scribus/scribus/scribus.cpp (revision 1475)
+++ branches/Version13x/Scribus/scribus/scribus.cpp (revision 1476)
@@ -590,6 +590,7 @@
Prefs.PDF_Optionen.PresentMode = false;
Prefs.PDF_Optionen.Datei = "";
Prefs.PDF_Optionen.PresentVals.clear();
+ Prefs.PDF_Optionen.isGrayscale = false;
Prefs.PDF_Optionen.UseRGB = true;
Prefs.PDF_Optionen.UseProfiles = false;
Prefs.PDF_Optionen.UseProfiles2 = false;
@@ -3360,6 +3361,7 @@
doc->PDF_Optionen.Version = 12;
if (dia->tabPDF->OutCombo->currentItem() == 0)
{
+ doc->PDF_Optionen.isGrayscale = false;
doc->PDF_Optionen.UseRGB = true;
doc->PDF_Optionen.UseProfiles = false;
doc->PDF_Optionen.UseProfiles2 = false;
@@ -3366,20 +3368,31 @@
}
else
{
- doc->PDF_Optionen.UseRGB = false;
+ if (dia->tabPDF->OutCombo->currentItem() == 2)
+ {
+ doc->PDF_Optionen.isGrayscale = true;
+ doc->PDF_Optionen.UseRGB = false;
+ doc->PDF_Optionen.UseProfiles = false;
+ doc->PDF_Optionen.UseProfiles2 = false;
+ }
+ else
+ {
+ doc->PDF_Optionen.isGrayscale = false;
+ doc->PDF_Optionen.UseRGB = false;
#ifdef HAVE_CMS
- if (CMSuse)
- {
- doc->PDF_Optionen.UseProfiles = dia->tabPDF->EmbedProfs->isChecked();
- doc->PDF_Optionen.UseProfiles2 = dia->tabPDF->EmbedProfs2->isChecked();
- doc->PDF_Optionen.Intent = dia->tabPDF->IntendS->currentItem();
- doc->PDF_Optionen.Intent2 = dia->tabPDF->IntendI->currentItem();
- doc->PDF_Optionen.EmbeddedI = dia->tabPDF->NoEmbedded->isChecked();
- doc->PDF_Optionen.SolidProf = dia->tabPDF->SolidPr->currentText();
- doc->PDF_Optionen.ImageProf = dia->tabPDF->ImageP->currentText();
- doc->PDF_Optionen.PrintProf = dia->tabPDF->PrintProfC->currentText();
+ if (CMSuse)
+ {
+ doc->PDF_Optionen.UseProfiles = dia->tabPDF->EmbedProfs->isChecked();
+ doc->PDF_Optionen.UseProfiles2 = dia->tabPDF->EmbedProfs2->isChecked();
+ doc->PDF_Optionen.Intent = dia->tabPDF->IntendS->currentItem();
+ doc->PDF_Optionen.Intent2 = dia->tabPDF->IntendI->currentItem();
+ doc->PDF_Optionen.EmbeddedI = dia->tabPDF->NoEmbedded->isChecked();
+ doc->PDF_Optionen.SolidProf = dia->tabPDF->SolidPr->currentText();
+ doc->PDF_Optionen.ImageProf = dia->tabPDF->ImageP->currentText();
+ doc->PDF_Optionen.PrintProf = dia->tabPDF->PrintProfC->currentText();
+ }
+#endif
}
-#endif
}
scrActions["viewShowMargins"]->setOn(doc->guidesSettings.marginsShown);
scrActions["viewShowFrames"]->setOn(doc->guidesSettings.framesShown);
@@ -3870,6 +3883,8 @@
scrMenuMgr->addMenuToMenu("Shade","Style");
if (Nr == 6)
scrMenuMgr->setMenuEnabled("ItemShapes", true);
+ WerkTools->Textedit->setEnabled(false);
+ WerkTools->Textedit2->setEnabled(false);
WerkTools->KetteAus->setEnabled(false);
WerkTools->KetteEin->setEnabled(false);
if (Nr != 5)
@@ -6379,10 +6394,30 @@
MaPal->show();
connect(view, SIGNAL(MVals(double, double, double, double, double, double, int)), MaPal, SLOT(setValues(double, double, double, double, double, double, int )));
}
- if (mode == Magnifier)
- qApp->setOverrideCursor(QCursor(loadIcon("LupeZ.xpm")), true);
- else
- qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+ switch (mode)
+ {
+ case DrawShapes:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")), true);
+ break;
+ case DrawPicture:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawImageFrame.xpm")), true);
+ break;
+ case DrawText:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")), true);
+ break;
+ case DrawTable:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawTable.xpm")), true);
+ break;
+ case DrawRegularPolygon:
+ qApp->setOverrideCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")), true);
+ break;
+ case Magnifier:
+ qApp->setOverrideCursor(QCursor(loadIcon("LupeZ.xpm")), true);
+ break;
+ default:
+ qApp->setOverrideCursor(QCursor(ArrowCursor), true);
+ break;
+ }
if (mode == DrawShapes)
{
doc->SubMode = WerkTools->SubMode;
@@ -7942,6 +7977,7 @@
Prefs.PDF_Optionen.Version = 12;
if (dia->tabPDF->OutCombo->currentItem() == 0)
{
+ Prefs.PDF_Optionen.isGrayscale = false;
Prefs.PDF_Optionen.UseRGB = true;
Prefs.PDF_Optionen.UseProfiles = false;
Prefs.PDF_Optionen.UseProfiles2 = false;
@@ -7948,20 +7984,31 @@
}
else
{
- Prefs.PDF_Optionen.UseRGB = false;
+ if (dia->tabPDF->OutCombo->currentItem() == 2)
+ {
+ Prefs.PDF_Optionen.isGrayscale = true;
+ Prefs.PDF_Optionen.UseRGB = false;
+ Prefs.PDF_Optionen.UseProfiles = false;
+ Prefs.PDF_Optionen.UseProfiles2 = false;
+ }
+ else
+ {
+ Prefs.PDF_Optionen.isGrayscale = false;
+ Prefs.PDF_Optionen.UseRGB = false;
#ifdef HAVE_CMS
- if (CMSuse)
- {
- Prefs.PDF_Optionen.UseProfiles = dia->tabPDF->EmbedProfs->isChecked();
- Prefs.PDF_Optionen.UseProfiles2 = dia->tabPDF->EmbedProfs2->isChecked();
- Prefs.PDF_Optionen.Intent = dia->tabPDF->IntendS->currentItem();
- Prefs.PDF_Optionen.Intent2 = dia->tabPDF->IntendI->currentItem();
- Prefs.PDF_Optionen.EmbeddedI = dia->tabPDF->NoEmbedded->isChecked();
- Prefs.PDF_Optionen.SolidProf = dia->tabPDF->SolidPr->currentText();
- Prefs.PDF_Optionen.ImageProf = dia->tabPDF->ImageP->currentText();
- Prefs.PDF_Optionen.PrintProf = dia->tabPDF->PrintProfC->currentText();
+ if (CMSuse)
+ {
+ Prefs.PDF_Optionen.UseProfiles = dia->tabPDF->EmbedProfs->isChecked();
+ Prefs.PDF_Optionen.UseProfiles2 = dia->tabPDF->EmbedProfs2->isChecked();
+ Prefs.PDF_Optionen.Intent = dia->tabPDF->IntendS->currentItem();
+ Prefs.PDF_Optionen.Intent2 = dia->tabPDF->IntendI->currentItem();
+ Prefs.PDF_Optionen.EmbeddedI = dia->tabPDF->NoEmbedded->isChecked();
+ Prefs.PDF_Optionen.SolidProf = dia->tabPDF->SolidPr->currentText();
+ Prefs.PDF_Optionen.ImageProf = dia->tabPDF->ImageP->currentText();
+ Prefs.PDF_Optionen.PrintProf = dia->tabPDF->PrintProfC->currentText();
+ }
+#endif
}
-#endif
}
GetCMSProfiles();
Prefs.KeyActions = dia->tabKeys->getNewKeyMap();
@@ -8422,60 +8469,71 @@
if (dia->Options->OutCombo->currentItem() == 0)
{
doc->PDF_Optionen.UseRGB = true;
+ doc->PDF_Optionen.isGrayscale = false;
doc->PDF_Optionen.UseProfiles = false;
doc->PDF_Optionen.UseProfiles2 = false;
}
else
{
- doc->PDF_Optionen.UseRGB = false;
-#ifdef HAVE_CMS
- if (CMSuse)
+ if (dia->Options->OutCombo->currentItem() == 2)
{
- doc->PDF_Optionen.UseProfiles = dia->Options->EmbedProfs->isChecked();
- doc->PDF_Optionen.UseProfiles2 = dia->Options->EmbedProfs2->isChecked();
- doc->PDF_Optionen.Intent = dia->Options->IntendS->currentItem();
- doc->PDF_Optionen.Intent2 = dia->Options->IntendI->currentItem();
- doc->PDF_Optionen.EmbeddedI = dia->Options->NoEmbedded->isChecked();
- doc->PDF_Optionen.SolidProf = dia->Options->SolidPr->currentText();
- doc->PDF_Optionen.ImageProf = dia->Options->ImageP->currentText();
- doc->PDF_Optionen.PrintProf = dia->Options->PrintProfC->currentText();
- if (doc->PDF_Optionen.Version == 12)
- {
- const char *Descriptor;
- cmsHPROFILE hIn;
- hIn = cmsOpenProfileFromFile(PrinterProfiles[doc->PDF_Optionen.PrintProf], "r");
- Descriptor = cmsTakeProductDesc(hIn);
- nam = QString(Descriptor);
- if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
- Components = 3;
- if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
- Components = 4;
- if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmyData)
- Components = 3;
- cmsCloseProfile(hIn);
- doc->PDF_Optionen.Info = dia->Options->InfoString->text();
- doc->PDF_Optionen.BleedTop = dia->Options->BleedTop->value()/UmReFaktor;
- doc->PDF_Optionen.BleedLeft = dia->Options->BleedLeft->value()/UmReFaktor;
- doc->PDF_Optionen.BleedRight = dia->Options->BleedRight->value()/UmReFaktor;
- doc->PDF_Optionen.BleedBottom = dia->Options->BleedBottom->value()/UmReFaktor;
- doc->PDF_Optionen.Encrypt = false;
- doc->PDF_Optionen.MirrorH = false;
- doc->PDF_Optionen.MirrorV = false;
- doc->PDF_Optionen.RotateDeg = 0;
- doc->PDF_Optionen.PresentMode = false;
- doc->PDF_Optionen.Encrypt = false;
- }
+ doc->PDF_Optionen.isGrayscale = true;
+ doc->PDF_Optionen.UseRGB = false;
+ doc->PDF_Optionen.UseProfiles = false;
+ doc->PDF_Optionen.UseProfiles2 = false;
}
else
{
+ doc->PDF_Optionen.isGrayscale = false;
+ doc->PDF_Optionen.UseRGB = false;
+#ifdef HAVE_CMS
+ if (CMSuse)
+ {
+ doc->PDF_Optionen.UseProfiles = dia->Options->EmbedProfs->isChecked();
+ doc->PDF_Optionen.UseProfiles2 = dia->Options->EmbedProfs2->isChecked();
+ doc->PDF_Optionen.Intent = dia->Options->IntendS->currentItem();
+ doc->PDF_Optionen.Intent2 = dia->Options->IntendI->currentItem();
+ doc->PDF_Optionen.EmbeddedI = dia->Options->NoEmbedded->isChecked();
+ doc->PDF_Optionen.SolidProf = dia->Options->SolidPr->currentText();
+ doc->PDF_Optionen.ImageProf = dia->Options->ImageP->currentText();
+ doc->PDF_Optionen.PrintProf = dia->Options->PrintProfC->currentText();
+ if (doc->PDF_Optionen.Version == 12)
+ {
+ const char *Descriptor;
+ cmsHPROFILE hIn;
+ hIn = cmsOpenProfileFromFile(PrinterProfiles[doc->PDF_Optionen.PrintProf], "r");
+ Descriptor = cmsTakeProductDesc(hIn);
+ nam = QString(Descriptor);
+ if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
+ Components = 3;
+ if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
+ Components = 4;
+ if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmyData)
+ Components = 3;
+ cmsCloseProfile(hIn);
+ doc->PDF_Optionen.Info = dia->Options->InfoString->text();
+ doc->PDF_Optionen.BleedTop = dia->Options->BleedTop->value()/UmReFaktor;
+ doc->PDF_Optionen.BleedLeft = dia->Options->BleedLeft->value()/UmReFaktor;
+ doc->PDF_Optionen.BleedRight = dia->Options->BleedRight->value()/UmReFaktor;
+ doc->PDF_Optionen.BleedBottom = dia->Options->BleedBottom->value()/UmReFaktor;
+ doc->PDF_Optionen.Encrypt = false;
+ doc->PDF_Optionen.MirrorH = false;
+ doc->PDF_Optionen.MirrorV = false;
+ doc->PDF_Optionen.RotateDeg = 0;
+ doc->PDF_Optionen.PresentMode = false;
+ doc->PDF_Optionen.Encrypt = false;
+ }
+ }
+ else
+ {
+ doc->PDF_Optionen.UseProfiles = false;
+ doc->PDF_Optionen.UseProfiles2 = false;
+ }
+#else
doc->PDF_Optionen.UseProfiles = false;
doc->PDF_Optionen.UseProfiles2 = false;
+#endif
}
-#else
- doc->PDF_Optionen.UseProfiles = false;
- doc->PDF_Optionen.UseProfiles2 = false;
-#endif
-
}
if (dia->Options->AllPages->isChecked())
parsePagesString("*", &pageNs, doc->PageC);
Index: branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp
===================================================================
--- branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp (revision 1475)
+++ branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp (revision 1476)
@@ -56,7 +56,8 @@
extern QString CompressStr(QString *in);
extern QString ImageToTxt(QImage *im);
extern QString ImageToCMYK(QImage *im);
-extern void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK);
+extern QString ImageToGray(QImage *im);
+extern void Convert2JPG(QString fn, QImage *image, int Quality, bool isCMYK, bool isGray);
extern QString MaskToTxt(QImage *im, bool PDF = true);
extern QString MaskToTxt14(QImage *im);
extern char *toHex( uchar u );
@@ -927,39 +928,10 @@
PutPage("Q\n");
continue;
}
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" rg\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" scn\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" SCN\n");
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" k\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->fillColor() != "None")
+ PutPage(putColor(ite->fillColor(), ite->fillShade(), true));
+ if (ite->lineColor() != "None")
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
Inhalt += FToStr(fabs(ite->Pwidth))+" w\n";
if (ite->DashValues.count() != 0)
{
@@ -1126,27 +1098,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
}
@@ -1170,35 +1122,11 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
}
break;
- /* OBSOLETE CR 2005-02-06
- case 1:
- case 3:
- */
case PageItem::FrameType1:
case PageItem::FrameType3:
case PageItem::Polygon:
@@ -1291,27 +1219,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
break;
@@ -1346,27 +1254,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
break;
@@ -1674,52 +1562,10 @@
PutPage("q\n");
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options->Version == 14))
PDF_Transparenz(ite);
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" rg\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- switch (Options->Intent)
- {
- case 0:
- PutPage("/Perceptual");
- break;
- case 1:
- PutPage("/RelativeColorimetric");
- break;
- case 2:
- PutPage("/Saturation");
- break;
- case 3:
- PutPage("/AbsoluteColorimetric");
- break;
- }
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" scn\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" SCN\n");
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" k\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->fillColor() != "None")
+ PutPage(putColor(ite->fillColor(), ite->fillShade(), true));
+ if (ite->lineColor() != "None")
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
Inhalt += FToStr(fabs(ite->Pwidth))+" w\n";
if (ite->DashValues.count() != 0)
{
@@ -1838,39 +1684,10 @@
PutPage("q\n");
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options->Version == 14))
PDF_Transparenz(ite);
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" rg\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" scn\n");
+ PutPage(putColor(ite->fillColor(), ite->fillShade(), true));
if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" SCN\n");
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" k\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
Inhalt += FToStr(fabs(ite->Pwidth))+" w\n";
if (ite->DashValues.count() != 0)
{
@@ -2008,39 +1825,10 @@
PutPage("Q\n");
continue;
}
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" rg\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" scn\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" SCN\n");
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" k\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->fillColor() != "None")
+ PutPage(putColor(ite->fillColor(), ite->fillShade(), true));
+ if (ite->lineColor() != "None")
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
Inhalt += FToStr(fabs(ite->Pwidth))+" w\n";
if (ite->DashValues.count() != 0)
{
@@ -2247,27 +2035,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
}
@@ -2291,35 +2059,11 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
}
break;
- /* OBSOLETE 2005-02-06 CR
- case 1:
- case 3:
- */
case PageItem::FrameType1:
case PageItem::FrameType3:
case PageItem::Polygon:
@@ -2412,27 +2156,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
break;
@@ -2467,27 +2191,7 @@
PutDoc("/BM /Normal\n>>\nendobj\n");
PutPage("/"+ShName+" gs\n");
}
- if (Options->UseRGB)
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" rg\n");
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" scn\n");
- }
- else
- {
-#endif
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" k\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
PutPage(SetClipPathArray(&arrow));
PutPage("h\nf*\n");
break;
@@ -2550,8 +2254,7 @@
if ((pag->PageNam != "") && (ite->OwnPage != static_cast<int>(pag->PageNr)) && (ite->OwnPage != -1))
continue;
PutPage("q\n");
- if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) &&
- (Options->Version == 14))
+ if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options->Version == 14))
PDF_Transparenz(ite);
if (!ite->isPrintable)
{
@@ -2558,40 +2261,10 @@
PutPage("Q\n");
continue;
}
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" rg\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- QString tmp[] = {"/Perceptual", "/RelativeColorimetric",
- "/Saturation", "/AbsoluteColorimetric"};
- PutPage(tmp[Options->Intent]);
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" scn\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" SCN\n");
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- PutPage(SetFarbe(ite->fillColor(), ite->fillShade())+" k\n");
- if (ite->lineColor() != "None")
- PutPage(SetFarbe(ite->lineColor(), ite->lineShade())+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->fillColor() != "None")
+ PutPage(putColor(ite->fillColor(), ite->fillShade(), true));
+ if (ite->lineColor() != "None")
+ PutPage(putColor(ite->lineColor(), ite->lineShade(), false));
Inhalt += FToStr(fabs(ite->Pwidth))+" w\n";
if (ite->DashValues.count() != 0)
{
@@ -2692,31 +2365,73 @@
}
}
-QString PDFlib::setStrokeMulti(struct SingleLine *sl)
+QString PDFlib::putColor(QString color, int shade, bool fill)
{
QString tmp = "";
+ QString colString = SetFarbe(color, shade);
+ if (Options->isGrayscale)
+ {
+ if (color != "None")
+ {
+ if (fill)
+ tmp += colString+" g\n";
+ else
+ tmp += colString+" G\n";
+ }
+ return tmp;
+ }
if (Options->UseRGB)
- tmp += SetFarbe(sl->Color, sl->Shade)+" RG\n";
+ {
+ if (color != "None")
+ {
+ if (fill)
+ tmp += colString+" rg\n";
+ else
+ tmp += colString+" RG\n";
+ }
+ }
else
{
#ifdef HAVE_CMS
if ((CMSuse) && (Options->UseProfiles))
{
- QString t[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation",
- "/AbsoluteColorimetric"};
- tmp += t[Options->Intent];
- tmp += " ri\n";
- tmp += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- tmp += SetFarbe(sl->Color, sl->Shade)+" SCN\n";
+ QString tmp2[] = {"/Perceptual", "/RelativeColorimetric", "/Saturation", "/AbsoluteColorimetric"};
+ tmp += tmp2[Options->Intent]+ " ri\n";
+ if (color != "None")
+ {
+ if (fill)
+ {
+ tmp += "/"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
+ tmp += colString+" scn\n";
+ }
+ else
+ {
+ tmp += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
+ tmp += colString+" SCN\n";
+ }
+ }
}
else
{
#endif
- tmp += SetFarbe(sl->Color, sl->Shade)+" K\n";
- }
+ if (color != "None")
+ {
+ if (fill)
+ tmp += colString+" k\n";
+ else
+ tmp += colString+" K\n";
+ }
#ifdef HAVE_CMS
}
#endif
+ }
+ return tmp;
+}
+
+QString PDFlib::setStrokeMulti(struct SingleLine *sl)
+{
+ QString tmp = "";
+ tmp += putColor(sl->Color, sl->Shade, false);
tmp += FToStr(sl->Width)+" w\n";
QString Dt = FToStr(QMAX(2*sl->Width, 1));
QString Da = FToStr(QMAX(6*sl->Width, 1));
@@ -2858,38 +2573,12 @@
if (hl->cstroke != "None")
{
StrokeColor = "";
- if (Options->UseRGB)
- StrokeColor += SetFarbe(hl->cstroke, hl->cshade2)+" RG\n";
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- StrokeColor += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- StrokeColor += SetFarbe(hl->cstroke, hl->cshade2)+" SCN\n";
- }
- else
-#endif
- StrokeColor += SetFarbe(hl->cstroke, hl->cshade2)+" K\n";
- }
+ StrokeColor += putColor(hl->cstroke, hl->cshade2, false);
}
if (hl->ccolor != "None")
{
FillColor = "";
- if (Options->UseRGB)
- FillColor += SetFarbe(hl->ccolor, hl->cshade)+" rg\n";
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- FillColor += "/"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- FillColor += SetFarbe(hl->ccolor, hl->cshade)+" scn\n";
- }
- else
-#endif
- FillColor += SetFarbe(hl->ccolor, hl->cshade)+" k\n";
- }
+ FillColor += putColor(hl->cstroke, hl->cshade, true);
}
if (((*doc->AllFonts)[hl->cfont]->isOTF) || ((*doc->AllFonts)[hl->cfont]->Subset) || (Options->SubsetList.contains(hl->cfont)))
{
@@ -3076,22 +2765,7 @@
double Upos = (*doc->AllFonts)[hl->cfont]->underline_pos * (tsz / 10.0);
double Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * (tsz / 10.0), 1);
if (hl->ccolor != "None")
- {
- if (Options->UseRGB)
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" RG\n";
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- tmp2 += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" SCN\n";
- }
- else
-#endif
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" K\n";
- }
- }
+ tmp2 += putColor(hl->cstroke, hl->cshade, false);
tmp2 += FToStr(Uwid)+" w\n";
tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n";
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n";
@@ -3103,22 +2777,7 @@
double Upos = (*doc->AllFonts)[hl->cfont]->strikeout_pos * (tsz / 10.0);
double Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * (tsz / 10.0), 1);
if (hl->ccolor != "None")
- {
- if (Options->UseRGB)
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" RG\n";
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- tmp2 += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" SCN\n";
- }
- else
-#endif
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" K\n";
- }
- }
+ tmp2 += putColor(hl->cstroke, hl->cshade, false);
tmp2 += FToStr(Uwid)+" w\n";
tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n";
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n";
@@ -3142,6 +2801,26 @@
int h, s, v, k, sneu;
tmpC = doc->PageColors[farbe];
QColor tmpR;
+ if (Options->isGrayscale)
+ {
+ tmpC.getRawRGBColor(&h, &s, &v);
+ tmpR.setRgb(h, s, v);
+ if ((h == s) && (s == v))
+ {
+ tmpR.hsv(&h, &s, &v);
+ sneu = 255 - ((255 - v) * Shade / 100);
+ tmpR.setHsv(h, s, sneu);
+ }
+ else
+ {
+ tmpR.hsv(&h, &s, &v);
+ sneu = s * Shade / 100;
+ tmpR.setHsv(h, sneu, v);
+ }
+ tmpR.rgb(&h, &s, &v);
+ tmp = FToStr((0.3 * h + 0.59 * s + 0.11 * v) / 255.0);
+ return tmp;
+ }
if (Options->UseRGB)
{
tmpC.getRawRGBColor(&h, &s, &v);
@@ -3476,16 +3155,21 @@
if (Options->UseRGB)
PutDoc("/ColorSpace /DeviceRGB\n");
else
-#ifdef HAVE_CMS
{
- if ((CMSuse) && (Options->UseProfiles))
- PutDoc("/ColorSpace "+ICCProfiles[Options->SolidProf].ICCArray+"\n");
+ if (Options->isGrayscale)
+ PutDoc("/ColorSpace /DeviceGray\n");
else
+#ifdef HAVE_CMS
+ {
+ if ((CMSuse) && (Options->UseProfiles))
+ PutDoc("/ColorSpace "+ICCProfiles[Options->SolidProf].ICCArray+"\n");
+ else
#endif
- PutDoc("/ColorSpace /DeviceCMYK\n");
+ PutDoc("/ColorSpace /DeviceCMYK\n");
#ifdef HAVE_CMS
+ }
+#endif
}
-#endif
PutDoc("/BBox [0 "+FToStr(h)+" "+FToStr(w)+" 0]\n");
if ((b->GrType == 5) || (b->GrType == 7))
{
@@ -3627,36 +3311,10 @@
PutDoc(x[ite->AnBsty]);
PutDoc(" >>\n");
cnx = "("+ind2PDFabr[ite->AnFont]+" "+FToStr(ite->ISize / 10.0)+" Tf";
- if (Options->UseRGB)
- {
- if (ite->TxtFill != "None")
- cnx += " "+SetFarbe(ite->TxtFill, ite->ShTxtFill)+" rg\n";
- if (ite->fillColor() != "None")
- cnx += " "+SetFarbe(ite->fillColor(), ite->fillShade())+" RG\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- cnx += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cnx += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- if (ite->fillColor() != "None")
- cnx += SetFarbe(ite->fillColor(), ite->fillShade())+" SCN\n";
- if (ite->TxtFill != "None")
- cnx += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" scn\n";
- }
- else
- {
-#endif
- if (ite->TxtFill != "None")
- cnx += " "+SetFarbe(ite->TxtFill, ite->ShTxtFill)+" k";
- if (ite->fillColor() != "None")
- cnx += " "+SetFarbe(ite->fillColor(), ite->fillShade())+" K";
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->TxtFill != "None")
+ cnx += " "+ putColor(ite->TxtFill, ite->ShTxtFill, true);
+ if (ite->fillColor() != "None")
+ cnx += " "+ putColor(ite->fillColor(), ite->fillShade(), false);
cnx += ")";
PutDoc("/DA "+EncString(cnx,ObjCounter-1)+"\n");
int flg = ite->AnFlag;
@@ -3917,60 +3575,12 @@
if (ite->AnType == 3)
{
cc = "";
- if (Options->UseRGB)
- {
- if (ite->fillColor() != "None")
- cc += SetFarbe(ite->fillColor(), ite->fillShade())+" RG\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->fillColor() != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->fillColor(), ite->fillShade())+" SCN\n";
- }
- }
- else
- {
-#endif
- if (ite->fillColor() != "None")
- cc += SetFarbe(ite->fillColor(), ite->fillShade())+" K\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->fillColor() != "None")
+ cc += putColor(ite->fillColor(), ite->fillShade(), false);
cc += FToStr(x)+" "+FToStr(y2)+" "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nf\n";
cc += "/Tx BMC\nBT\n";
- if (Options->UseRGB)
- {
- if (ite->TxtFill != "None")
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" rg\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->TxtFill != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" scn\n";
- }
- }
- else
- {
-#endif
- if (ite->TxtFill != "None")
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" k\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->TxtFill != "None")
+ cc += putColor(ite->TxtFill, ite->ShTxtFill, true);
cc += ind2PDFabr[ite->AnFont];
cc += " "+FToStr(ite->ISize / 10.0)+" Tf\n";
if (bmst.count() > 1)
@@ -3990,32 +3600,8 @@
if (ite->AnType == 4)
{
cc = "q\nBT\n";
- if (Options->UseRGB)
- {
- if (ite->TxtFill != "None")
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" rg\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->TxtFill != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" scn\n";
- }
- }
- else
- {
-#endif
- if (ite->TxtFill != "None")
- cc += SetFarbe(ite->TxtFill, ite->ShTxtFill)+" k\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
+ if (ite->TxtFill != "None")
+ cc += putColor(ite->TxtFill, ite->ShTxtFill, true);
cc += "/ZaDb "+FToStr(ite->ISize / 10.0)+" Tf\n";
cc += "0 0 Td\n("+ct+") Tj\nET\nQ";
PDF_Form(cc);
@@ -4026,38 +3612,10 @@
cc += "1 g\n";
cc += "0 0 "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nf\n";
cc += IToStr(ite->AnBwid)+" w\n";
- if (Options->UseRGB)
- {
- if (ite->AnBColor != "None")
- cc += SetFarbe(ite->AnBColor, 100)+" RG\n";
- else
- cc += "0 G\n";
- }
+ if (ite->AnBColor != "None")
+ cc += putColor(ite->AnBColor, 100l, false);
else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->AnBColor != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->AnBColor, 100)+" SCN\n";
- }
- else
- cc += "0 G\n";
- }
- else
- {
-#endif
- if (ite->AnBColor != "None")
- cc += SetFarbe(ite->AnBColor, 100)+" K\n";
- else
- cc += "0 G\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
+ cc += "0 G\n";
cc += "0 0 "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nS\n";
cc += "/Tx BMC\nq\nBT\n";
cc += "0 g\n";
@@ -4484,12 +4042,17 @@
im = ImageToTxt(&img);
else
{
+ if (Options->isGrayscale)
+ im = ImageToGray(&img);
+ else
+ {
#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles2))
- im = ImageToTxt(&img);
- else
+ if ((CMSuse) && (Options->UseProfiles2))
+ im = ImageToTxt(&img);
+ else
#endif
- im = ImageToCMYK(&img);
+ im = ImageToCMYK(&img);
+ }
}
StartObj(ObjCounter);
ObjCounter++;
@@ -4516,7 +4079,17 @@
if ((gray) && (Options->UseRGB) && (ext == "jpg") && (!Options->RecalcPic))
PutDoc("/ColorSpace /DeviceGray\n");
else
- PutDoc(Options->UseRGB ? "/ColorSpace /DeviceRGB\n" : "/ColorSpace /DeviceCMYK\n");
+ {
+ if (Options->UseRGB)
+ PutDoc("/ColorSpace /DeviceRGB\n");
+ else
+ {
+ if (Options->isGrayscale)
+ PutDoc("/ColorSpace /DeviceGray\n");
+ else
+ PutDoc("/ColorSpace /DeviceCMYK\n");
+ }
+ }
#ifdef HAVE_CMS
}
#endif
@@ -4535,9 +4108,14 @@
{
QString tmpFile = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus/sc.jpg");
if ((Options->UseRGB) || (Options->UseProfiles2))
- Convert2JPG(tmpFile, &img, Options->Quality, false);
+ Convert2JPG(tmpFile, &img, Options->Quality, false, false);
else
- Convert2JPG(tmpFile, &img, Options->Quality, true);
+ {
+ if (Options->isGrayscale)
+ Convert2JPG(tmpFile, &img, Options->Quality, false, true);
+ else
+ Convert2JPG(tmpFile, &img, Options->Quality, true, false);
+ }
if (Options->CompressMethod == 0)
{
QFileInfo fi(tmpFile);
/branches/Version13x/Scribus/scribus/libpdf/pdflib.h
67,6 → 67,7
QString SetClipPathArray(FPointArray *ite, bool poly = true);
QString SetClipPath(PageItem *ite, bool poly = true);
QString SetFarbe(QString farbe, int Shade);
QString putColor(QString color, int Shade, bool fill);
QString setTextSt(PageItem *ite, uint PNr);
void PutDoc(QString in);
void PutPage(QString in);