Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4196 → Rev 4197

/branches/Version13x/Scribus/scribus/fileloader.cpp
1316,6 → 1316,12
doc->PDF_Options.UseLPI = static_cast<bool>(pg.attribute("UseLpi", "0").toInt());
doc->PDF_Options.UseSpotColors = static_cast<bool>(dc.attribute("UseSpotColors", "1").toInt());
doc->PDF_Options.doMultiFile = static_cast<bool>(dc.attribute("doMultiFile", "0").toInt());
doc->PDF_Options.displayBookmarks = static_cast<bool>(dc.attribute("displayBookmarks", "0").toInt());
doc->PDF_Options.displayFullscreen = static_cast<bool>(dc.attribute("displayFullscreen", "0").toInt());
doc->PDF_Options.displayLayers = static_cast<bool>(dc.attribute("displayLayers", "0").toInt());
doc->PDF_Options.displayThumbs = static_cast<bool>(dc.attribute("displayThumbs", "0").toInt());
doc->PDF_Options.PageLayout = dc.attribute("PageLayout", "0").toInt();
doc->PDF_Options.openAction = dc.attribute("openAction", "");
QDomNode PFO = PAGE.firstChild();
while(!PFO.isNull())
{
/branches/Version13x/Scribus/scribus/pdfopts.cpp
177,6 → 177,24
Opts->UseLPI = Options->UseLPI->isChecked();
Opts->useLayers = Options->useLayers->isChecked();
Opts->UseSpotColors = !Options->useSpot->isChecked();
Opts->displayBookmarks = Options->useBookmarks->isChecked();
Opts->displayFullscreen = Options->useFullScreen->isChecked();
Opts->displayLayers = Options->useLayers2->isChecked();
Opts->displayThumbs = Options->useThumbnails->isChecked();
int pgl = PDFOptions::SinglePage;
if (Options->singlePage->isChecked())
pgl = PDFOptions::SinglePage;
else if (Options->continuousPages->isChecked())
pgl = PDFOptions::OneColumn;
else if (Options->doublePageLeft->isChecked())
pgl = PDFOptions::TwoColumnLeft;
else if (Options->doublePageRight->isChecked())
pgl = PDFOptions::TwoColumnRight;
Opts->PageLayout = pgl;
if (Options->actionCombo->currentItem() != 0)
Opts->openAction = Options->actionCombo->currentText();
else
Opts->openAction = "";
if (Options->Encry->isChecked())
{
int Perm = -64;
/branches/Version13x/Scribus/scribus/tabpdfoptions.h
33,9 → 33,9
 
public:
TabPDFOptions( QWidget* parent, PDFOptions *Optionen, SCFonts &AllFonts,
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie = 0 );
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie = 0 );
~TabPDFOptions() {};
void restoreDefaults();
 
155,6 → 155,22
QComboBox* LPIfunc;
QValueList<QString> FontsToEmbed;
QValueList<QString> FontsToSubset;
QWidget* tabSpecial;
QGroupBox* groupDisplay;
QButtonGroup* pageLayout;
QRadioButton* singlePage;
QRadioButton* continuousPages;
QRadioButton* doublePageLeft;
QRadioButton* doublePageRight;
QButtonGroup* groupNavigation;
QRadioButton* useViewDefault;
QRadioButton* useFullScreen;
QRadioButton* useBookmarks;
QRadioButton* useThumbnails;
QRadioButton* useLayers2;
QGroupBox* groupJava;
QLabel* actionLabel;
QComboBox* actionCombo;
ScribusView *view;
QValueList<PDFPresentationData> EffVal;
int PgSel;
233,7 → 249,13
QGridLayout* GroupPassLayout;
QVBoxLayout* GroupSecSetLayout;
QGridLayout* LPIgroupLayout;
QVBoxLayout* tabSpecialLayout;
QVBoxLayout* groupDisplayLayout;
QHBoxLayout* LayoutSpecial;
QVBoxLayout* pageLayoutLayout;
QVBoxLayout* groupNavigationLayout;
QHBoxLayout* groupJavaLayout;
 
QString unit;
int precision;
};
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp
26,9 → 26,9
 
 
TabPDFOptions::TabPDFOptions( QWidget* parent, PDFOptions *Optionen, SCFonts &AllFonts,
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie ) : QTabWidget( parent, "pdf" )
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie ) : QTabWidget( parent, "pdf" )
{
 
unit = unitGetSuffixFromIndex(unitIndex);
415,7 → 415,7
EffectsLayout->addWidget( EDirection_2, 4, 1 );
EDirection_2_2 = new QComboBox( true, Effects, "EDirection_2_2" );
QString tmp_ed[] = { tr("Left to Right"), tr("Top to Bottom"), tr("Bottom to Top"), tr("Right to Left"),
tr("Top-left to Bottom-Right")};
tr("Top-left to Bottom-Right")};
size_t ar_ed = sizeof(tmp_ed) / sizeof(*tmp_ed);
for (uint a = 0; a < ar_ed; ++a)
EDirection_2_2->insertItem(tmp_ed[a]);
426,7 → 426,120
EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
tabLayout_5->addMultiCellWidget( Effects, 1, 2, 1, 1 );
insertTab( tabPresentation, tr( "E&xtras" ) );
 
if (view->Doc->currentPageLayout == doublePage)
{
if (view->Doc->pageSets[view->Doc->currentPageLayout].FirstPage == 0)
Optionen->PageLayout = PDFOptions::TwoColumnLeft;
else
Optionen->PageLayout = PDFOptions::TwoColumnRight;
}
else
Optionen->PageLayout = PDFOptions::SinglePage;
if (Optionen->PresentMode)
Optionen->displayFullscreen = true;
else
{
if ((Optionen->Version == 15) && (Optionen->useLayers))
Optionen->displayLayers = true;
}
tabSpecial = new QWidget( this, "tabSpecial" );
tabSpecialLayout = new QVBoxLayout( tabSpecial, 11, 6, "tabSpecialLayout");
groupDisplay = new QGroupBox( tabSpecial, "groupDisplay" );
groupDisplay->setTitle( tr( "Display Settings" ) );
groupDisplay->setColumnLayout(0, Qt::Vertical );
groupDisplay->layout()->setSpacing( 5 );
groupDisplay->layout()->setMargin( 10 );
groupDisplayLayout = new QVBoxLayout( groupDisplay->layout() );
groupDisplayLayout->setAlignment( Qt::AlignTop );
LayoutSpecial = new QHBoxLayout( 0, 0, 5, "LayoutSpecial");
pageLayout = new QButtonGroup( groupDisplay, "pageLayout" );
pageLayout->setTitle( tr( "Page Layout" ) );
pageLayout->setColumnLayout(0, Qt::Vertical );
pageLayout->layout()->setSpacing( 5 );
pageLayout->layout()->setMargin( 10 );
pageLayoutLayout = new QVBoxLayout( pageLayout->layout() );
pageLayoutLayout->setAlignment( Qt::AlignTop );
singlePage = new QRadioButton( pageLayout, "singlePage" );
singlePage->setText( tr( "Single Page" ) );
pageLayoutLayout->addWidget( singlePage );
continuousPages = new QRadioButton( pageLayout, "continuousPages" );
continuousPages->setText( tr( "Continuous" ) );
pageLayoutLayout->addWidget( continuousPages );
doublePageLeft = new QRadioButton( pageLayout, "doublePageLeft" );
doublePageLeft->setText( tr( "Double Page Left" ) );
pageLayoutLayout->addWidget( doublePageLeft );
doublePageRight = new QRadioButton( pageLayout, "doublePageRight" );
doublePageRight->setText( tr( "Double Page Right" ) );
pageLayoutLayout->addWidget( doublePageRight );
LayoutSpecial->addWidget( pageLayout );
groupNavigation = new QButtonGroup( groupDisplay, "groupNavigation" );
groupNavigation->setTitle( tr( "Visual Appearance" ) );
groupNavigation->setColumnLayout(0, Qt::Vertical );
groupNavigation->layout()->setSpacing( 5 );
groupNavigation->layout()->setMargin( 10 );
groupNavigationLayout = new QVBoxLayout( groupNavigation->layout() );
groupNavigationLayout->setAlignment( Qt::AlignTop );
useViewDefault = new QRadioButton( groupNavigation, "useViewDefault" );
bool df = true;
if ((Optionen->displayBookmarks) || (Optionen->displayFullscreen) || (Optionen->displayLayers) || (Optionen->displayThumbs))
df = false;
useViewDefault->setChecked(df);
useViewDefault->setText( tr( "Use Viewers Defaults" ) );
groupNavigationLayout->addWidget( useViewDefault );
useFullScreen = new QRadioButton( groupNavigation, "useFullScreen" );
useFullScreen->setChecked(Optionen->displayFullscreen);
useFullScreen->setText( tr( "Use Full Screen Mode" ) );
groupNavigationLayout->addWidget( useFullScreen );
useBookmarks = new QRadioButton( groupNavigation, "useBookmarks" );
useBookmarks->setText( tr( "Display Bookmarks Tab" ) );
useBookmarks->setChecked(Optionen->displayBookmarks);
groupNavigationLayout->addWidget( useBookmarks );
useThumbnails = new QRadioButton( groupNavigation, "useThumbnails" );
useThumbnails->setText( tr( "Display Thumbnails" ) );
useThumbnails->setChecked(Optionen->displayThumbs);
groupNavigationLayout->addWidget( useThumbnails );
useLayers2 = new QRadioButton( groupNavigation, "useLayers" );
useLayers2->setText( tr( "Display Layers Tab" ) );
useLayers2->setChecked(Optionen->displayLayers);
groupNavigationLayout->addWidget( useLayers2 );
LayoutSpecial->addWidget( groupNavigation );
groupDisplayLayout->addLayout( LayoutSpecial );
tabSpecialLayout->addWidget( groupDisplay );
groupJava = new QGroupBox( tabSpecial, "groupJava" );
groupJava->setTitle( tr( "Special Actions" ) );
groupJava->setColumnLayout(0, Qt::Vertical );
groupJava->layout()->setSpacing( 5 );
groupJava->layout()->setMargin( 10 );
groupJavaLayout = new QHBoxLayout( groupJava->layout() );
groupJavaLayout->setAlignment( Qt::AlignTop );
actionLabel = new QLabel( groupJava, "actionLabel" );
actionLabel->setText( tr( "Javascript to be executed\nwhen Document is opened:" ) );
groupJavaLayout->addWidget( actionLabel );
actionCombo = new QComboBox( true, groupJava, "actionCombo" );
actionCombo->setEditable(false);
actionCombo->insertItem( tr("No Script"));
QMap<QString,QString>::Iterator itja;
for (itja = view->Doc->JavaScripts.begin(); itja != view->Doc->JavaScripts.end(); ++itja)
actionCombo->insertItem(itja.key());
groupJavaLayout->addWidget( actionCombo );
tabSpecialLayout->addWidget( groupJava );
if (Optionen->PageLayout == PDFOptions::SinglePage)
singlePage->setChecked(true);
else if (Optionen->PageLayout == PDFOptions::OneColumn)
continuousPages->setChecked(true);
else if (Optionen->PageLayout == PDFOptions::TwoColumnLeft)
doublePageLeft->setChecked(true);
else if (Optionen->PageLayout == PDFOptions::TwoColumnRight)
doublePageRight->setChecked(true);
if (Optionen->Version == 15)
useLayers2->setEnabled(true);
else
useLayers2->setEnabled(false);
insertTab( tabSpecial, tr("Viewer") );
}
 
 
tabSecurity = new QWidget( this, "tabSecurity" );
tabSecurityLayout = new QVBoxLayout( tabSecurity, 11, 5, "tabSecurityLayout");
Encry = new QCheckBox( tr( "&Use Encryption" ), tabSecurity, "Enc" );
851,8 → 964,8
QToolTip::add( AllPages, "<qt>" + tr( "Export all pages to PDF" ) + "</qt>" );
QToolTip::add( OnlySome, "<qt>" + tr( "Export a range of pages to PDF" ) );
QToolTip::add( PageNr, "<qt>" + tr( "Insert a comma separated list of tokens where "
"a token can be * for all the pages, 1-5 for "
"a range of pages or a single page number.") + "</qt>" );
"a token can be * for all the pages, 1-5 for "
"a range of pages or a single page number.") + "</qt>" );
 
QToolTip::add( PDFVersionCombo, "<qt>" + tr( "Determines the PDF compatibility. The default is PDF 1.3 which gives the widest compatibility. Choose PDF 1.4 if your file uses features such as transparency or you require 128 bit encryption. PDF/X-3 is for exporting the PDF when you want color managed RGB for commercial printing and is selectable when you have activated color management. Use only when advised by your printer or in some cases printing to a 4 color digital color laser printer." ) + "</qt>");
QToolTip::add( ComboBind, "<qt>" + tr( "Determines the binding of pages in the PDF. Unless you know you need to change it leave the default choice - Left." ) + "</qt>" );
890,12 → 1003,11
QToolTip::add( BleedRight, "<qt>" + tr( "Distance for bleed from the right of the physical page" ) + "</qt>");
QToolTip::add( MirrorH, "<qt>" + tr( "Mirror Page(s) horizontally" ) + "</qt>" );
QToolTip::add( MirrorV, "<qt>" + tr( "Mirror Page(s) vertically" ) + "</qt>" );
QToolTip::add( useSpot,"<qt>" + tr( "Enables Spot Colors to be converted to composite colors. Unless you are planning to print spot colors at a commercial printer, this is probably best left enabled." ) + "</qt>");
QToolTip::add( useSpot,"<qt>" + tr( "Enables Spot Colors to be converted to composite colors. Unless you are planning to print spot colors at a commercial printer, this is probably best left enabled." ) + "</qt>");
}
 
void TabPDFOptions::restoreDefaults()
{
}
{}
 
void TabPDFOptions::checkInfo()
{
956,6 → 1068,7
void TabPDFOptions::EnablePDFX(int a)
{
useLayers->setEnabled(a == 2);
useLayers2->setEnabled(a == 2);
if (a != 3)
{
setTabEnabled(tabPDFX, false);
1180,6 → 1293,7
Pages->setEnabled(setter);
Effects->setEnabled(setter);
PagePrev->setEnabled(setter);
useFullScreen->setChecked(setter);
}
 
void TabPDFOptions::ValidDI(int nr)
/branches/Version13x/Scribus/scribus/reformdoc.cpp
1042,6 → 1042,21
currDoc->PDF_Options.BleedTop = tabPDF->BleedTop->value() / currDoc->unitRatio();
currDoc->PDF_Options.BleedLeft = tabPDF->BleedLeft->value() / currDoc->unitRatio();
currDoc->PDF_Options.BleedRight = tabPDF->BleedRight->value() / currDoc->unitRatio();
currDoc->PDF_Options.displayBookmarks = tabPDF->useBookmarks->isChecked();
currDoc->PDF_Options.displayFullscreen = tabPDF->useFullScreen->isChecked();
currDoc->PDF_Options.displayLayers = tabPDF->useLayers2->isChecked();
currDoc->PDF_Options.displayThumbs = tabPDF->useThumbnails->isChecked();
int pgl = PDFOptions::SinglePage;
if (tabPDF->singlePage->isChecked())
pgl = PDFOptions::SinglePage;
else if (tabPDF->continuousPages->isChecked())
pgl = PDFOptions::OneColumn;
else if (tabPDF->doublePageLeft->isChecked())
pgl = PDFOptions::TwoColumnLeft;
else if (tabPDF->doublePageRight->isChecked())
pgl = PDFOptions::TwoColumnRight;
currDoc->PDF_Options.PageLayout = pgl;
currDoc->PDF_Options.openAction = "";
if (tabPDF->Encry->isChecked())
{
int Perm = -64;
/branches/Version13x/Scribus/scribus/pdflib.cpp
495,8 → 495,32
PutDoc("/OCProperties 9 0 R\n");
if (Options->Version == 12)
PutDoc("/OutputIntents [ "+IToStr(ObjCounter-1)+" 0 R ]\n");
if (doc->currentPageLayout == doublePage)
PutDoc("/PageLayout ");
switch (Options->PageLayout)
{
case PDFOptions::SinglePage:
PutDoc("/SinglePage\n");
break;
case PDFOptions::OneColumn:
PutDoc("/OneColumn\n");
break;
case PDFOptions::TwoColumnLeft:
PutDoc("/TwoColumnLeft\n");
break;
case PDFOptions::TwoColumnRight:
PutDoc("/TwoColumnRight\n");
break;
}
if (Options->displayBookmarks)
PutDoc("/PageMode /UseOutlines\n");
else if (Options->displayFullscreen)
PutDoc("/PageMode /FullScreen\n");
else if (Options->displayThumbs)
PutDoc("/PageMode /UseThumbs\n");
else if ((Options->Version == 15) && (Options->displayLayers))
PutDoc("/PageMode /UseOC\n");
/* if (doc->currentPageLayout == doublePage)
{
PutDoc("/PageLayout ");
if (doc->pageSets[doc->currentPageLayout].FirstPage == 0)
PutDoc("/TwoColumnLeft\n");
509,7 → 533,7
{
if ((Options->Version == 15) && (Options->useLayers))
PutDoc("/PageMode /UseOC\n");
}
} */
PutDoc("/ViewerPreferences\n<<\n/PageDirection ");
PutDoc( Options->Binding == 0 ? "/L2R\n" : "/R2L\n");
PutDoc(" >>\n>>\nendobj\n");
/branches/Version13x/Scribus/scribus/prefsmanager.cpp
383,6 → 383,12
appPrefs.PDF_Options.LPISettings.clear();
appPrefs.PDF_Options.UseSpotColors = true;
appPrefs.PDF_Options.doMultiFile = false;
appPrefs.PDF_Options.displayBookmarks = false;
appPrefs.PDF_Options.displayFullscreen = false;
appPrefs.PDF_Options.displayLayers = false;
appPrefs.PDF_Options.displayThumbs = false;
appPrefs.PDF_Options.PageLayout = PDFOptions::SinglePage;
appPrefs.PDF_Options.openAction = "";
 
//Attribute setup
appPrefs.defaultItemAttributes.clear();
1160,6 → 1166,12
pdf.setAttribute("UseLpi", static_cast<int>(appPrefs.PDF_Options.UseLPI));
pdf.setAttribute("UseSpotColors", static_cast<int>(appPrefs.PDF_Options.UseSpotColors));
pdf.setAttribute("doMultiFile", static_cast<int>(appPrefs.PDF_Options.doMultiFile));
pdf.setAttribute("displayBookmarks", static_cast<int>(appPrefs.PDF_Options.displayBookmarks));
pdf.setAttribute("displayFullscreen", static_cast<int>(appPrefs.PDF_Options.displayFullscreen));
pdf.setAttribute("displayLayers", static_cast<int>(appPrefs.PDF_Options.displayLayers));
pdf.setAttribute("displayThumbs", static_cast<int>(appPrefs.PDF_Options.displayThumbs));
pdf.setAttribute("PageLayout", appPrefs.PDF_Options.PageLayout);
pdf.setAttribute("openAction", appPrefs.PDF_Options.openAction);
QMap<QString,LPIData>::Iterator itlp;
for (itlp = appPrefs.PDF_Options.LPISettings.begin(); itlp != appPrefs.PDF_Options.LPISettings.end(); ++itlp)
{
1668,6 → 1680,12
appPrefs.PDF_Options.UseLPI = static_cast<bool>(dc.attribute("UseLpi", "0").toInt());
appPrefs.PDF_Options.UseSpotColors = static_cast<bool>(dc.attribute("UseSpotColors", "1").toInt());
appPrefs.PDF_Options.doMultiFile = static_cast<bool>(dc.attribute("doMultiFile", "0").toInt());
appPrefs.PDF_Options.displayBookmarks = static_cast<bool>(dc.attribute("displayBookmarks", "0").toInt());
appPrefs.PDF_Options.displayFullscreen = static_cast<bool>(dc.attribute("displayFullscreen", "0").toInt());
appPrefs.PDF_Options.displayLayers = static_cast<bool>(dc.attribute("displayLayers", "0").toInt());
appPrefs.PDF_Options.displayThumbs = static_cast<bool>(dc.attribute("displayThumbs", "0").toInt());
appPrefs.PDF_Options.PageLayout = dc.attribute("PageLayout", "0").toInt();
appPrefs.PDF_Options.openAction = dc.attribute("openAction", "");
QDomNode PFO = DOC.firstChild();
appPrefs.PDF_Options.LPISettings.clear();
while(!PFO.isNull())
/branches/Version13x/Scribus/scribus/scribusXml.cpp
3321,6 → 3321,12
pdf.setAttribute("UseLpi", static_cast<int>(doc->PDF_Options.UseLPI));
pdf.setAttribute("UseSpotColors", static_cast<int>(doc->PDF_Options.UseSpotColors));
pdf.setAttribute("doMultiFile", static_cast<int>(doc->PDF_Options.doMultiFile));
pdf.setAttribute("displayBookmarks", static_cast<int>(doc->PDF_Options.displayBookmarks));
pdf.setAttribute("displayFullscreen", static_cast<int>(doc->PDF_Options.displayFullscreen));
pdf.setAttribute("displayLayers", static_cast<int>(doc->PDF_Options.displayLayers));
pdf.setAttribute("displayThumbs", static_cast<int>(doc->PDF_Options.displayThumbs));
pdf.setAttribute("PageLayout", doc->PDF_Options.PageLayout);
pdf.setAttribute("openAction", doc->PDF_Options.openAction);
for (uint pdoF = 0; pdoF < doc->PDF_Options.EmbedList.count(); ++pdoF)
{
QDomElement pdf2 = docu.createElement("Fonts");
/branches/Version13x/Scribus/scribus/pdfoptions.h
44,6 → 44,14
PDFVersion_X3 = 12,
};
 
enum PDFPageLayout
{
SinglePage = 0,
OneColumn,
TwoColumnLeft,
TwoColumnRight
};
 
/**
* @author Craig Ringer
* @brief Sanity check the options defined.
111,6 → 119,12
QString PassOwner;
QString PassUser;
int Permissions;
int PageLayout;
bool displayBookmarks;
bool displayThumbs;
bool displayLayers;
bool displayFullscreen;
QString openAction;
};
 
#endif