View Issue Details

IDProjectCategoryView StatusLast Update
0014965ScribusPDFpublic2018-03-26 12:32
Reportersefran Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
PlatformallOSallOS Versionall
Product Version1.5.3 
Summary0014965: [PATCH] When using javascript to hide layers, these are always printed
DescriptionWhen scribus generates a PDF with hidden printable layers, these are systematically printed.
The PDF code:
27 0 obj
<<
/ Type / OCG
/ Name <FEFF0046006F006E006400200064006500200070006100670065>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>
endobj
28 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F00490050>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
29 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F0052004E00490053>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
30 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F004400650066006100750074>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>

An option Print on view should generate:

27 0 obj
<<
/ Type / OCG
/ Name <FEFF0046006F006E006400200064006500200070006100670065>
/ Usage << / View << / ViewState / ON >>>>
>>
endobj
28 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F00490050>
/ Usage << / View << / ViewState / OFF >>>>
>>
endobj
29 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F0052004E00490053>
/ Usage << / View << / ViewState / OFF >>>>
>>
endobj
30 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F004400650066006100750074>
/ Usage << / View << / ViewState / ON >>>>
>>

In this case the layer no are printed
Steps To ReproduceOpen the scribus document attached to the bug report.
Generate the PDF.
Open pdf file with a text editor and search / Type / OCG

The generated code is:
...
27 0 obj
<<
/ Type / OCG
/ Name <FEFF0046006F006E006400200064006500200070006100670065>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>
endobj
28 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F00490050>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
29 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F0052004E00490053>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
30 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F004400650066006100750074>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>
endobj
...

To work properly this should be:
27 0 obj
<<
/ Type / OCG
/ Name <FEFF0046006F006E006400200064006500200070006100670065>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>
endobj
28 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F00490050>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
29 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F0052004E00490053>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / OFF >>>>
>>
endobj
30 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F004400650066006100750074>
/ Usage << / Print << / PrintState / ON >> / View << / ViewState / ON >>>>
>>
endobj

I attach to this report a patch proposal to add this functionality to scribus.
Additional InformationThe patch changes:
Pdflib_core.cpp for the processing of generated pdf code.
Sclayer.cpp and sclayer.h for the print management functions on visible.
Scribusdoc.cpp and scribusdoc.h for management in document
Layers.cpp and layers.h for managing the interface with the addition of a checkbox Print on view only.
TagsPDF
PatchYes

Activities

sefran

2017-08-24 21:08

reporter  

scribus_pdfprintonview.patch (16,294 bytes)   
diff -Naur scribus-1.5.3/scribus/pdflib_core.cpp scribus-1.5.3.new/scribus/pdflib_core.cpp
--- scribus-1.5.3/scribus/pdflib_core.cpp	2017-05-28 11:10:25.000000000 +0200
+++ scribus-1.5.3.new/scribus/pdflib_core.cpp	2017-08-24 19:06:31.321370451 +0200
@@ -2531,12 +2531,15 @@
 			PutDoc("/Name ");
 			PutDoc(EncStringUTF16(ll.Name, optionalContent));
 			PutDoc("\n");
-			PutDoc("/Usage <</Print <</PrintState ");
+			PutDoc("/Usage <<");
 			if (ll.isPrintable)
-				PutDoc("/ON");
+			{
+				if (!ll.isPrintableView)
+					PutDoc("/Print <</PrintState /ON>> ");
+			}
 			else
-				PutDoc("/OFF");
-			PutDoc(">> /View <</ViewState ");
+				PutDoc("/Print <</PrintState /OFF>> ");
+			PutDoc("/View <</ViewState ");
 			if (ll.isViewable)
 				PutDoc("/ON");
 			else
diff -Naur scribus-1.5.3/scribus/sclayer.cpp scribus-1.5.3.new/scribus/sclayer.cpp
--- scribus-1.5.3/scribus/sclayer.cpp	2017-05-28 11:10:26.000000000 +0200
+++ scribus-1.5.3.new/scribus/sclayer.cpp	2017-08-22 23:12:10.000000000 +0200
@@ -18,6 +18,7 @@
 	ID          = 0;
 	Level        = 0;
 	isPrintable  = true;
+	isPrintableView    = true;
 	isViewable   = true;
 	isEditable   = true;
 	isSelectable = false;
@@ -34,6 +35,7 @@
 	ID           = id;
 	Level        = level;
 	isPrintable  = true;
+	isPrintableView    = true;
 	isViewable   = true;
 	isEditable   = true;
 	isSelectable = false;
@@ -76,10 +78,11 @@
 bool ScLayer::operator== (const ScLayer& other) const
 {
 	// ignore markerColor?
-	if (Name == other.Name && ID == other.ID && Level == other.Level      &&
-		isPrintable  == other.isPrintable  && isViewable  == other.isViewable  &&
-		flowControl  == other.flowControl  && outlineMode == other.outlineMode && 
-		transparency == other.transparency && isEditable == other.isEditable &&
+	if (Name == other.Name && ID == other.ID && Level == other.Level &&
+		isPrintable  == other.isPrintable  && isPrintableView  == other.isPrintableView  && 
+		isViewable  == other.isViewable  && flowControl  == other.flowControl  && 
+		outlineMode == other.outlineMode && transparency == other.transparency && 
+		isEditable == other.isEditable &&
 		blendMode   == other.blendMode)
 	{
 		return true;
@@ -133,6 +136,7 @@
 			const ScLayer& ll  = this->at(la2);
 			layer.isViewable   = ll.isViewable;
 			layer.isPrintable  = ll.isPrintable;
+			layer.isPrintableView    = ll.isPrintableView;
 			layer.isEditable   = ll.isEditable;
 			layer.isSelectable = ll.isSelectable;
 			layer.ID           = ll.ID;
@@ -503,6 +507,25 @@
 		return true;
 	}
 	return false;
+}
+
+bool ScLayers::layerPrintableView(const int layerID) const
+{
+	const ScLayer* layer = layerByID(layerID);
+	if (layer)
+		return layer->isPrintableView;
+	return false;
+}
+
+bool ScLayers::setLayerPrintableView(const int layerID, const bool isPrintableView)
+{
+	ScLayer* layer = byID(layerID);
+	if (layer)
+	{
+		layer->isPrintableView = isPrintableView;
+		return true;
+	}
+	return false;
 }
 
 bool ScLayers::layerVisible(const int layerID) const
diff -Naur scribus-1.5.3/scribus/sclayer.h scribus-1.5.3.new/scribus/sclayer.h
--- scribus-1.5.3/scribus/sclayer.h	2017-05-28 11:10:26.000000000 +0200
+++ scribus-1.5.3.new/scribus/sclayer.h	2017-08-22 23:33:10.000000000 +0200
@@ -23,6 +23,7 @@
 	int     ID;
 	int     Level;
 	bool    isPrintable;
+	bool    isPrintableView;
 	bool    isViewable;
 	bool    isEditable;
 	bool    isSelectable;
@@ -214,12 +215,27 @@
 	/**
 	 * @brief Set the layer printable via the layer ID
 	 * @param layerID ID of the layer
-	 * @param isPrintable bool true = layer is prantable
+	 * @param isPrintable bool true = layer is printable
 	 * @return Success or failure
 	 */
 	bool setLayerPrintable(const int layerID, const bool isPrintable);
 
 	/**
+	 * @brief Is the layer printable on view only
+	 * @param layerID ID of the layer
+	 * @return Printable view only or not
+	 */
+	bool layerPrintableView(const int layerID) const;
+
+	/**
+	 * @brief Set the layer printable view only via the layer ID
+	 * @param layerID ID of the layer
+	 * @param IsPrintableView bool true = layer is printable view only
+	 * @return Success or failure
+	 */
+	bool setLayerPrintableView(const int layerID, const bool IsPrintableView);
+
+	/**
 	 * @brief Is the layer visible
 	 * @param layerID ID of the layer
 	 * @return Visible or not
diff -Naur scribus-1.5.3/scribus/scribusdoc.cpp scribus-1.5.3.new/scribus/scribusdoc.cpp
--- scribus-1.5.3/scribus/scribusdoc.cpp	2017-05-28 11:10:24.000000000 +0200
+++ scribus-1.5.3.new/scribus/scribusdoc.cpp	2017-08-23 07:41:14.000000000 +0200
@@ -1786,6 +1786,12 @@
 			setLayerPrintable(ss->getInt("ACTIVE"), isUndo ? !print : print);
 			layersUndo=true;
 		}
+		else if (ss->contains("PRINTVIEW_LAYER"))
+		{
+			bool print = ss->getBool("PRINTVIEW");
+			setLayerPrintableView(ss->getInt("ACTIVE"), isUndo ? !print : print);
+			layersUndo=true;
+		}
 		else if (ss->contains("LAYER_FLOW"))
 		{
 			bool flow = ss->getBool("FLOW");
@@ -3091,6 +3097,47 @@
 	}
 	return false;
 }
+
+
+bool ScribusDoc::setLayerPrintableView(const int layerID, const bool isPrintableView)
+{
+	ScLayers::iterator itend=Layers.end();
+	ScLayers::iterator it;
+	bool found=false;
+	for (it = Layers.begin(); it != itend; ++it)
+	{
+		if (it->ID == layerID)
+		{
+			if (it->isPrintableView!=isPrintableView && UndoManager::undoEnabled())
+			{
+				SimpleState *ss = new SimpleState(isPrintableView ? Um::PrintLayer : Um::DoNotPrintLayer, "", Um::IPrint);
+				ss->set("PRINTVIEW_LAYER");
+				ss->set("ACTIVE", it->ID);
+				ss->set("PRINTVIEW", isPrintableView);
+				m_undoManager->action(this, ss, it->Name, Um::ILayer);
+			}
+			it->isPrintableView = isPrintableView;
+			found=true;
+			break;
+		}
+	}
+	if (found)
+		changed();
+	return found;
+}
+
+
+bool ScribusDoc::layerPrintableView(const int layerID)
+{
+	ScLayers::iterator itend=Layers.end();
+	ScLayers::iterator it;
+	for (it = Layers.begin(); it != itend; ++it)
+	{
+		if (it->ID == layerID)
+			return it->isPrintableView;
+	}
+	return false;
+}
 
 
 bool ScribusDoc::setLayerVisible(const int layerID, const bool isViewable)
diff -Naur scribus-1.5.3/scribus/scribusdoc.h scribus-1.5.3.new/scribus/scribusdoc.h
--- scribus-1.5.3/scribus/scribusdoc.h	2017-05-28 11:10:25.000000000 +0200
+++ scribus-1.5.3.new/scribus/scribusdoc.h	2017-08-23 00:07:06.000000000 +0200
@@ -326,6 +326,19 @@
 	 */
 	bool layerPrintable(const int layerID);
 	/**
+	 * @brief Set the layer printable view via the layer number
+	 * @param layerID ID of the layer
+	 * @param isPrintableView bool true = layer is printable
+	 * @return Success or failure
+	 */
+	bool setLayerPrintableView(const int layerID, const bool isPrintableView);
+	/**
+	 * @brief Is the layer printable view
+	 * @param layerID ID of the layer
+	 * @return Printable view or not
+	 */
+	bool layerPrintableView(const int layerID);
+	/**
 	 * @brief Set the layer visible via the layer number
 	 * @param layerID ID of the layer
 	 * @param isViewable true = layer is visible
diff -Naur scribus-1.5.3/scribus/ui/layers.cpp scribus-1.5.3.new/scribus/ui/layers.cpp
--- scribus-1.5.3/scribus/ui/layers.cpp	2017-05-28 11:10:23.000000000 +0200
+++ scribus-1.5.3.new/scribus/ui/layers.cpp	2017-08-24 19:31:14.403569551 +0200
@@ -69,15 +69,16 @@
 	LayerPaletteLayout->addLayout( layout1 );
 
 	IconManager* im = IconManager::instance();
-	Table = new QTableWidget(0, 8, this );
+	Table = new QTableWidget(0, 9, this );
 	Table->setHorizontalHeaderItem(0, new QTableWidgetItem(""));
 	Table->setHorizontalHeaderItem(1, new QTableWidgetItem(im->loadIcon("16/show-object.png"), ""));
 	Table->setHorizontalHeaderItem(2, new QTableWidgetItem(im->loadIcon("16/document-print.png"), ""));
-	Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
-	Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
-	Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
-	Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
-	Table->setHorizontalHeaderItem(7, new QTableWidgetItem( tr("Name")));
+	Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("acroread16.png"), ""));
+	Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
+	Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
+	Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
+	Table->setHorizontalHeaderItem(7, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
+	Table->setHorizontalHeaderItem(8, new QTableWidgetItem( tr("Name")));
 
 	QHeaderView *header = Table->horizontalHeader();
 	header->setStretchLastSection(true);
@@ -93,6 +94,7 @@
 	Table->setColumnWidth(4, 24);
 	Table->setColumnWidth(5, 24);
 	Table->setColumnWidth(6, 24);
+	Table->setColumnWidth(7, 24);
 	Table->setSortingEnabled(false);
 	Table->setSelectionBehavior( QAbstractItemView::SelectRows );
 	QHeaderView *Header = Table->verticalHeader();
@@ -256,48 +258,59 @@
 		QWidget *cw3 = new QWidget(Table);
 		QCheckBox *cp3 = new QCheckBox(cw3);
 		cp3->setObjectName(tmp);
-		cp3->setChecked(m_Doc->layerLocked(layerID));
+		cp3->setChecked(m_Doc->layerPrintableView(layerID));
 		QHBoxLayout *cl3 = new QHBoxLayout(cw3);
 		cl3->addWidget(cp3);
 		cl3->setAlignment(Qt::AlignCenter);
 		cl3->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 3, cw3);
-		connect(cp3, SIGNAL(clicked()), this, SLOT(lockLayer()));
+		connect(cp3, SIGNAL(clicked()), this, SLOT(printviewLayer()));
 
 		QWidget *cw4 = new QWidget(Table);
 		QCheckBox *cp4 = new QCheckBox(cw4);
 		cp4->setObjectName(tmp);
-		cp4->setChecked(m_Doc->layerFlow(layerID));
+		cp4->setChecked(m_Doc->layerLocked(layerID));
 		QHBoxLayout *cl4 = new QHBoxLayout(cw4);
 		cl4->addWidget(cp4);
 		cl4->setAlignment(Qt::AlignCenter);
 		cl4->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 4, cw4);
-		connect(cp4, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
+		connect(cp4, SIGNAL(clicked()), this, SLOT(lockLayer()));
 
 		QWidget *cw5 = new QWidget(Table);
 		QCheckBox *cp5 = new QCheckBox(cw5);
 		cp5->setObjectName(tmp);
-		cp5->setChecked(m_Doc->layerOutline(layerID));
+		cp5->setChecked(m_Doc->layerFlow(layerID));
 		QHBoxLayout *cl5 = new QHBoxLayout(cw5);
 		cl5->addWidget(cp5);
 		cl5->setAlignment(Qt::AlignCenter);
 		cl5->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 5, cw5);
-		connect(cp5, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
+		connect(cp5, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
 
 		QWidget *cw6 = new QWidget(Table);
 		QCheckBox *cp6 = new QCheckBox(cw6);
 		cp6->setObjectName(tmp);
-		cp6->setChecked(m_Doc->layerSelectable(layerID));
+		cp6->setChecked(m_Doc->layerOutline(layerID));
 		QHBoxLayout *cl6 = new QHBoxLayout(cw6);
 		cl6->addWidget(cp6);
 		cl6->setAlignment(Qt::AlignCenter);
 		cl6->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 6, cw6);
-		connect(cp6, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+		connect(cp6, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
 
-		Table->setItem(row, 7, new QTableWidgetItem(m_Doc->layerName(layerID)));
+		QWidget *cw7 = new QWidget(Table);
+		QCheckBox *cp7 = new QCheckBox(cw6);
+		cp7->setObjectName(tmp);
+		cp7->setChecked(m_Doc->layerSelectable(layerID));
+		QHBoxLayout *cl7 = new QHBoxLayout(cw7);
+		cl7->addWidget(cp7);
+		cl7->setAlignment(Qt::AlignCenter);
+		cl7->setContentsMargins(0,0,0,0);
+		Table->setCellWidget(row, 7, cw7);
+		connect(cp7, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+
+		Table->setItem(row, 8, new QTableWidgetItem(m_Doc->layerName(layerID)));
 	}
 	connect(Table, SIGNAL(cellChanged(int, int)), this, SLOT(changeName(int, int)));
 	connect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
@@ -446,6 +459,23 @@
 	}
 }
 
+void LayerPalette::printviewLayer()
+{
+	if (!m_Doc)
+		return;
+	int level = QString(sender()->objectName()).toInt();
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
+		return;
+	const QObject* senderBox=sender();
+	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
+	{
+		m_Doc->setLayerPrintableView(layerID,((QCheckBox*)(senderBox))->isChecked());
+		setActiveLayer(Table->currentRow(), -1);
+		emit LayerChanged();
+	}
+}
+
 void LayerPalette::lockLayer()
 {
 	if (!m_Doc)
@@ -537,17 +567,22 @@
 			if (index == 3)
 			{
 				((QCheckBox*)(Table->cellWidget(row, 3)))->toggle();
-				it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
+				it->isPrintableView = ((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
 			}
 			if (index == 4)
 			{
 				((QCheckBox*)(Table->cellWidget(row, 4)))->toggle();
-				it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
+				it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
 			}
-			else if (index == 5)
+			if (index == 5)
 			{
 				((QCheckBox*)(Table->cellWidget(row, 5)))->toggle();
-				it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+				it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+			}
+			else if (index == 6)
+			{
+				((QCheckBox*)(Table->cellWidget(row, 6)))->toggle();
+				it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 6)))->isChecked();
 			}
 		}
 		emit LayerChanged();
@@ -720,11 +755,12 @@
 	Table->horizontalHeaderItem(0)->setToolTip("<qt>" + tr("Color of the Layer Indicator. Each layer has a color assigned to display on the canvas when layer indicators are enabled. You can double click to edit the color.") + "</qt>");
 	Table->horizontalHeaderItem(1)->setToolTip("<qt>" + tr("Make Layer Visible. Uncheck to hide the layer from the display.") + "</qt>" );
 	Table->horizontalHeaderItem(2)->setToolTip("<qt>" + tr("Print Layer. Uncheck to disable printing.") + "</qt>" );
-	Table->horizontalHeaderItem(3)->setToolTip("<qt>" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "</qt>" );
-	Table->horizontalHeaderItem(4)->setToolTip("<qt>" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "</qt>" );
-	Table->horizontalHeaderItem(5)->setToolTip("<qt>" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "</qt>" ) ;
-	Table->horizontalHeaderItem(6)->setToolTip("<qt>" + tr("Select Objects on Layer. Check to enable selecting.") + "</qt>" );
-	Table->horizontalHeaderItem(7)->setToolTip("<qt>" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "</qt>" );
+	Table->horizontalHeaderItem(3)->setToolTip("<qt>" + tr("Print Layer on view only. Check to print layer PDF on view only.") + "</qt>" );
+	Table->horizontalHeaderItem(4)->setToolTip("<qt>" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "</qt>" );
+	Table->horizontalHeaderItem(5)->setToolTip("<qt>" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "</qt>" );
+	Table->horizontalHeaderItem(6)->setToolTip("<qt>" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "</qt>" ) ;
+	Table->horizontalHeaderItem(7)->setToolTip("<qt>" + tr("Select Objects on Layer. Check to enable selecting.") + "</qt>" );
+	Table->horizontalHeaderItem(8)->setToolTip("<qt>" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "</qt>" );
 }
 
 
diff -Naur scribus-1.5.3/scribus/ui/layers.h scribus-1.5.3.new/scribus/ui/layers.h
--- scribus-1.5.3/scribus/ui/layers.h	2017-05-28 11:10:23.000000000 +0200
+++ scribus-1.5.3.new/scribus/ui/layers.h	2017-08-22 23:51:19.000000000 +0200
@@ -52,6 +52,7 @@
 	void changeName(int row, int col);
 	void visibleLayer();
 	void printLayer();
+	void printviewLayer();
 	void lockLayer();
 	void flowToggleLayer();
 	void outlineToggleLayer();
scribus_pdfprintonview.patch (16,294 bytes)   

sefran

2017-08-24 21:18

reporter   ~0044356

To work properly this should be:
27 0 obj
<<
/ Type / OCG
/ Name <FEFF0046006F006E006400200064006500200070006100670065>
/ Usage << / View << / ViewState / ON >>>>
>>
endobj
28 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F00490050>
/ Usage << / View << / ViewState / OFF >>>>
>>
endobj
29 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F0052004E00490053>
/ Usage << / View << / ViewState / OFF >>>>
>>
endobj
30 0 obj
<<
/ Type / OCG
/ Name <FEFF0049006E0066006F004400650066006100750074>
/ Usage << / View << / ViewState / ON >>>>
>>
endobj

sefran

2017-08-31 08:08

reporter   ~0044383

The pdf working with adobe reader.
More sample for help.
Show with view before print the result.
ViewBeforePrintWithoutPrint.png (29,614 bytes)   
ViewBeforePrintWithoutPrint.png (29,614 bytes)   
ViewBeforePrintWithPrint.png (34,233 bytes)   
ViewBeforePrintWithPrint.png (34,233 bytes)   

ale

2017-08-31 12:51

manager   ~0044384

Last edited: 2017-08-31 12:51

"Print Layer on view only. Check to print layer PDF on view only."

does it mean:

"Print Layer when visible"

?

p.s.: i have a hard time understanding what exactly the but is about... but i have not downloaded the files, only skimmed the patch...

sefran

2017-09-01 15:16

reporter   ~0044387

Yes :-)

sefran

2017-09-01 15:17

reporter   ~0044388

I'm sorry for my english, i'sn my natural language.

ale

2017-09-01 15:32

manager   ~0044389

can you briefly explain in french what the problem is?

sefran

2017-09-01 21:56

reporter   ~0044391

Bonjour et merci de votre patience.

Donc le problème est lorsque l'on gère l'impression des calques PDF avec des formulaires avancés et javascript.

Par défaut le fait de préciser l'impression dans Scribus cela force ou interdit l'impression d'un calque quel que soit son état d'affichage.

Dans Acrobat, il existe une option Apply Print Overrides avec trois choix «Prints When Visible, Never Prints, Always Prints», imprime le calque que lorsque celui-ci est visible, jamais ou tout le temps.
https://helpx.adobe.com/acrobat/using/pdf-layers.html
Ceci ne fonctionne qu'avec Acrobat reader.

Dans Scribus il n'y a que deux possibilités.
Il manque donc Print When visible. Ce qui pour moi me parait-être un bug sur la gestion des fonctionnalités d'impression des calques.

Dans l'état Print de mon formulaire d'exemple fait sous windows, cela donne à l'impression et dans l'image d’aperçu d'Acrobat reader :
https://bugs.scribus.net/file_download.php?file_id=9808&type=bug

Après édition avec un éditeur de texte et suppression dans les sections / Type / OCG de / Print << / PrintState / ON >> , on se retrouve dans le fonctionnement Prints When Visible.
Comme on peut le voir avec l'aperçu d'impression d'Acrobat reader :
https://bugs.scribus.net/file_download.php?file_id=9807&type=bug

C'est pour cela que j'ai proposé ce patch pour ajouter la fonction Prints When visible.

Peut-être que mon patch est maladroit dans la gestion de l'interface graphique parce qu'il ne grise pas Print et rajoute deux options plutôt que trois choix d'impression .
Et aussi que dans sa formulation en anglais il faudrait plutôt «Prints When Visible».

J'espère vous avoir mieux éclairé sur la problématique qu'avec mon expression horrible en anglais.
Cordialement

sefran

2017-09-01 22:07

reporter   ~0044392

J'ai aussi fait ce patch suite à ce fil de discutions…
http://forums.scribus.net/index.php?topic=2187.0

ale

2017-09-02 14:57

manager   ~0044393

ok, i got it!

not much to do with js then (but i understand where js can use that...)

sefran

2017-10-05 22:00

reporter   ~0044490

Better PATCH
pdf_print_on_visible.patch (16,801 bytes)   
diff -Naur scribus15/scribus/pdflib_core.cpp scribus15-new/scribus/pdflib_core.cpp
--- scribus15/scribus/pdflib_core.cpp	2017-10-02 21:08:49.608222244 +0200
+++ scribus15-new/scribus/pdflib_core.cpp	2017-10-05 23:16:26.813486770 +0200
@@ -2615,12 +2615,15 @@
 			PutDoc("/Name ");
 			PutDoc(EncStringUTF16(ll.Name, optionalContent));
 			PutDoc("\n");
-			PutDoc("/Usage <</Print <</PrintState ");
+			PutDoc("/Usage <<");
 			if (ll.isPrintable)
-				PutDoc("/ON");
-			else
-				PutDoc("/OFF");
-			PutDoc(">> /View <</ViewState ");
+			{
+				if (!ll.isPrintableVisible)
+					PutDoc("/Print <</PrintState /ON>> ");
+			}
+ 			else
+				PutDoc("/Print <</PrintState /OFF>> ");
+			PutDoc("/View <</ViewState ");
 			if (ll.isViewable)
 				PutDoc("/ON");
 			else
diff -Naur scribus15/scribus/sclayer.cpp scribus15-new/scribus/sclayer.cpp
--- scribus15/scribus/sclayer.cpp	2017-10-02 21:08:55.421639058 +0200
+++ scribus15-new/scribus/sclayer.cpp	2017-10-05 22:12:27.903185962 +0200
@@ -15,9 +15,10 @@
 ScLayer::ScLayer(void)
 {
 	Name         = QObject::tr("New Layer");
-	ID          = 0;
+	ID           = 0;
 	Level        = 0;
 	isPrintable  = true;
+	isPrintableVisible    = true;
 	isViewable   = true;
 	isEditable   = true;
 	isSelectable = false;
@@ -34,6 +35,7 @@
 	ID           = id;
 	Level        = level;
 	isPrintable  = true;
+	isPrintableVisible    = true;
 	isViewable   = true;
 	isEditable   = true;
 	isSelectable = false;
@@ -76,10 +78,11 @@
 bool ScLayer::operator== (const ScLayer& other) const
 {
 	// ignore markerColor?
-	if (Name == other.Name && ID == other.ID && Level == other.Level      &&
-		isPrintable  == other.isPrintable  && isViewable  == other.isViewable  &&
-		flowControl  == other.flowControl  && outlineMode == other.outlineMode && 
-		transparency == other.transparency && isEditable == other.isEditable &&
+	if (Name == other.Name && ID == other.ID && Level == other.Level &&
+		isPrintable  == other.isPrintable  && isPrintableVisible  == other.isPrintableVisible  && 
+		isViewable  == other.isViewable  && flowControl  == other.flowControl  && 
+		outlineMode == other.outlineMode && transparency == other.transparency && 
+		isEditable == other.isEditable &&
 		blendMode   == other.blendMode)
 	{
 		return true;
@@ -133,6 +136,7 @@
 			const ScLayer& ll  = this->at(la2);
 			layer.isViewable   = ll.isViewable;
 			layer.isPrintable  = ll.isPrintable;
+			layer.isPrintableVisible    = ll.isPrintableVisible;
 			layer.isEditable   = ll.isEditable;
 			layer.isSelectable = ll.isSelectable;
 			layer.ID           = ll.ID;
@@ -505,7 +509,26 @@
 	return false;
 }
 
-bool ScLayers::layerVisible(const int layerID) const
+bool ScLayers::layerPrintableVisible(const int layerID) const
+{
+	const ScLayer* layer = layerByID(layerID);
+	if (layer)
+		return layer->isPrintableVisible;
+	return false;
+}
+
+bool ScLayers::setLayerPrintableVisible(const int layerID, const bool isPrintableVisible)
+{
+	ScLayer* layer = byID(layerID);
+	if (layer)
+	{
+		layer->isPrintableVisible = isPrintableVisible;
+		return true;
+	}
+	return false;
+}
+
+ bool ScLayers::layerVisible(const int layerID) const
 {
 	const ScLayer* layer = layerByID(layerID);
 	if (layer)
diff -Naur scribus15/scribus/sclayer.h scribus15-new/scribus/sclayer.h
--- scribus15/scribus/sclayer.h	2017-10-02 21:08:55.421639058 +0200
+++ scribus15-new/scribus/sclayer.h	2017-10-05 21:37:47.935946728 +0200
@@ -23,6 +23,7 @@
 	int     ID;
 	int     Level;
 	bool    isPrintable;
+	bool    isPrintableVisible;
 	bool    isViewable;
 	bool    isEditable;
 	bool    isSelectable;
@@ -214,11 +215,26 @@
 	/**
 	 * @brief Set the layer printable via the layer ID
 	 * @param layerID ID of the layer
-	 * @param isPrintable bool true = layer is prantable
+	 * @param isPrintable bool true = layer is printable
 	 * @return Success or failure
 	 */
 	bool setLayerPrintable(const int layerID, const bool isPrintable);
 
+ 	/**
+	 * @brief Is the layer printable on visible only
+	 * @param layerID ID of the layer
+	 * @return Printable on visible only or not
+	 */
+	bool layerPrintableVisible(const int layerID) const;
+
+	/**
+	 * @brief Set the layer printable on visible only via the layer ID
+	 * @param layerID ID of the layer
+	 * @param IsPrintableVisible bool true = layer is printable on visible only
+	 * @return Success or failure
+	 */
+	bool setLayerPrintableVisible(const int layerID, const bool IsPrintableVisible);
+
 	/**
 	 * @brief Is the layer visible
 	 * @param layerID ID of the layer
diff -Naur scribus15/scribus/scribusdoc.cpp scribus15-new/scribus/scribusdoc.cpp
--- scribus15/scribus/scribusdoc.cpp	2017-10-02 21:08:49.608222244 +0200
+++ scribus15-new/scribus/scribusdoc.cpp	2017-10-02 21:51:09.690880124 +0200
@@ -1790,6 +1790,12 @@
 			setLayerPrintable(ss->getInt("ACTIVE"), isUndo ? !print : print);
 			layersUndo=true;
 		}
+		else if (ss->contains("PRINTVISIBLE_LAYER"))
+		{
+			bool print = ss->getBool("PRINTVISIBLE");
+			setLayerPrintableVisible(ss->getInt("ACTIVE"), isUndo ? !print : print);
+			layersUndo=true;
+		}
 		else if (ss->contains("LAYER_FLOW"))
 		{
 			bool flow = ss->getBool("FLOW");
@@ -3095,6 +3101,47 @@
 	}
 	return false;
 }
+
+
+bool ScribusDoc::setLayerPrintableVisible(const int layerID, const bool isPrintableVisible)
+{
+	ScLayers::iterator itend=Layers.end();
+	ScLayers::iterator it;
+	bool found=false;
+	for (it = Layers.begin(); it != itend; ++it)
+	{
+		if (it->ID == layerID)
+		{
+			if (it->isPrintableVisible!=isPrintableVisible && UndoManager::undoEnabled())
+			{
+				SimpleState *ss = new SimpleState(isPrintableVisible ? Um::PrintLayer : Um::DoNotPrintLayer, "", Um::IPrint);
+				ss->set("PRINTVISIBLE_LAYER");
+				ss->set("ACTIVE", it->ID);
+				ss->set("PRINTVISIBLE", isPrintableVisible);
+				m_undoManager->action(this, ss, it->Name, Um::ILayer);
+			}
+			it->isPrintableVisible = isPrintableVisible;
+			found=true;
+			break;
+		}
+	}
+	if (found)
+		changed();
+	return found;
+}
+
+
+bool ScribusDoc::layerPrintableVisible(const int layerID)
+{
+	ScLayers::iterator itend=Layers.end();
+	ScLayers::iterator it;
+	for (it = Layers.begin(); it != itend; ++it)
+	{
+		if (it->ID == layerID)
+			return it->isPrintableVisible;
+	}
+	return false;
+}
 
 
 bool ScribusDoc::setLayerVisible(const int layerID, const bool isViewable)
diff -Naur scribus15/scribus/scribusdoc.h scribus15-new/scribus/scribusdoc.h
--- scribus15/scribus/scribusdoc.h	2017-10-02 21:08:49.608222244 +0200
+++ scribus15-new/scribus/scribusdoc.h	2017-10-02 21:55:47.451209825 +0200
@@ -325,6 +325,19 @@
 	 * @return Printable or not
 	 */
 	bool layerPrintable(const int layerID);
+ 	/**
+	 * @brief Set the layer printable on visible via the layer number
+	 * @param layerID ID of the layer
+	 * @param isPrintableVisible bool true = layer is printable on visible
+	 * @return Success or failure
+	 */
+	bool setLayerPrintableVisible(const int layerID, const bool isPrintableVisible);
+	/**
+	 * @brief Is the layer printable on visible
+	 * @param layerID ID of the layer
+	 * @return Printable on visible or not
+	 */
+	bool layerPrintableVisible(const int layerID);
 	/**
 	 * @brief Set the layer visible via the layer number
 	 * @param layerID ID of the layer
diff -Naur scribus15/scribus/ui/layers.cpp scribus15-new/scribus/ui/layers.cpp
--- scribus15/scribus/ui/layers.cpp	2017-10-02 21:08:40.578091849 +0200
+++ scribus15-new/scribus/ui/layers.cpp	2017-10-02 22:12:22.587219765 +0200
@@ -69,15 +69,16 @@
 	LayerPaletteLayout->addLayout( layout1 );
 
 	IconManager* im = IconManager::instance();
-	Table = new QTableWidget(0, 8, this );
+	Table = new QTableWidget(0, 9, this );
 	Table->setHorizontalHeaderItem(0, new QTableWidgetItem(""));
 	Table->setHorizontalHeaderItem(1, new QTableWidgetItem(im->loadIcon("16/show-object.png"), ""));
 	Table->setHorizontalHeaderItem(2, new QTableWidgetItem(im->loadIcon("16/document-print.png"), ""));
-	Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
-	Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
-	Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
-	Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
-	Table->setHorizontalHeaderItem(7, new QTableWidgetItem( tr("Name")));
+	Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("acroread16.png"), ""));
+	Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
+	Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
+	Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
+	Table->setHorizontalHeaderItem(7, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
+	Table->setHorizontalHeaderItem(8, new QTableWidgetItem( tr("Name")));
 
 	QHeaderView *header = Table->horizontalHeader();
 	header->setStretchLastSection(true);
@@ -93,6 +94,7 @@
 	Table->setColumnWidth(4, 24);
 	Table->setColumnWidth(5, 24);
 	Table->setColumnWidth(6, 24);
+	Table->setColumnWidth(7, 24);
 	Table->setSortingEnabled(false);
 	Table->setSelectionBehavior( QAbstractItemView::SelectRows );
 	QHeaderView *Header = Table->verticalHeader();
@@ -256,48 +258,59 @@
 		QWidget *cw3 = new QWidget(Table);
 		QCheckBox *cp3 = new QCheckBox(cw3);
 		cp3->setObjectName(tmp);
-		cp3->setChecked(m_Doc->layerLocked(layerID));
+		cp3->setChecked(m_Doc->layerPrintableVisible(layerID));
 		QHBoxLayout *cl3 = new QHBoxLayout(cw3);
 		cl3->addWidget(cp3);
 		cl3->setAlignment(Qt::AlignCenter);
 		cl3->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 3, cw3);
-		connect(cp3, SIGNAL(clicked()), this, SLOT(lockLayer()));
+		connect(cp3, SIGNAL(clicked()), this, SLOT(printviewLayer()));
 
 		QWidget *cw4 = new QWidget(Table);
 		QCheckBox *cp4 = new QCheckBox(cw4);
 		cp4->setObjectName(tmp);
-		cp4->setChecked(m_Doc->layerFlow(layerID));
+		cp4->setChecked(m_Doc->layerLocked(layerID));
 		QHBoxLayout *cl4 = new QHBoxLayout(cw4);
 		cl4->addWidget(cp4);
 		cl4->setAlignment(Qt::AlignCenter);
 		cl4->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 4, cw4);
-		connect(cp4, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
+		connect(cp4, SIGNAL(clicked()), this, SLOT(lockLayer()));
 
 		QWidget *cw5 = new QWidget(Table);
 		QCheckBox *cp5 = new QCheckBox(cw5);
 		cp5->setObjectName(tmp);
-		cp5->setChecked(m_Doc->layerOutline(layerID));
+		cp5->setChecked(m_Doc->layerFlow(layerID));
 		QHBoxLayout *cl5 = new QHBoxLayout(cw5);
 		cl5->addWidget(cp5);
 		cl5->setAlignment(Qt::AlignCenter);
 		cl5->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 5, cw5);
-		connect(cp5, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
+		connect(cp5, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
 
 		QWidget *cw6 = new QWidget(Table);
 		QCheckBox *cp6 = new QCheckBox(cw6);
 		cp6->setObjectName(tmp);
-		cp6->setChecked(m_Doc->layerSelectable(layerID));
+		cp6->setChecked(m_Doc->layerOutline(layerID));
 		QHBoxLayout *cl6 = new QHBoxLayout(cw6);
 		cl6->addWidget(cp6);
 		cl6->setAlignment(Qt::AlignCenter);
 		cl6->setContentsMargins(0,0,0,0);
 		Table->setCellWidget(row, 6, cw6);
-		connect(cp6, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+		connect(cp6, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
 
-		Table->setItem(row, 7, new QTableWidgetItem(m_Doc->layerName(layerID)));
+		QWidget *cw7 = new QWidget(Table);
+		QCheckBox *cp7 = new QCheckBox(cw6);
+		cp7->setObjectName(tmp);
+		cp7->setChecked(m_Doc->layerSelectable(layerID));
+		QHBoxLayout *cl7 = new QHBoxLayout(cw7);
+		cl7->addWidget(cp7);
+		cl7->setAlignment(Qt::AlignCenter);
+		cl7->setContentsMargins(0,0,0,0);
+		Table->setCellWidget(row, 7, cw7);
+		connect(cp7, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+
+		Table->setItem(row, 8, new QTableWidgetItem(m_Doc->layerName(layerID)));
 	}
 	connect(Table, SIGNAL(cellChanged(int, int)), this, SLOT(changeName(int, int)));
 	connect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
@@ -446,6 +459,23 @@
 	}
 }
 
+void LayerPalette::printvisibleLayer()
+{
+	if (!m_Doc)
+		return;
+	int level = QString(sender()->objectName()).toInt();
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
+		return;
+	const QObject* senderBox=sender();
+	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
+	{
+		m_Doc->setLayerPrintableVisible(layerID,((QCheckBox*)(senderBox))->isChecked());
+		setActiveLayer(Table->currentRow(), -1);
+		emit LayerChanged();
+	}
+}
+
 void LayerPalette::lockLayer()
 {
 	if (!m_Doc)
@@ -537,17 +567,22 @@
 		if (index == 3)
 		{
 			((QCheckBox*)(Table->cellWidget(row, 3)))->toggle();
-			it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
+			it->isPrintableVisible = ((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
 		}
 		if (index == 4)
 		{
 			((QCheckBox*)(Table->cellWidget(row, 4)))->toggle();
-			it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
+			it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
 		}
-		else if (index == 5)
+		if (index == 5)
 		{
 			((QCheckBox*)(Table->cellWidget(row, 5)))->toggle();
-			it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+			it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+		}
+		else if (index == 6)
+		{
+			((QCheckBox*)(Table->cellWidget(row, 6)))->toggle();
+			it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 6)))->isChecked();
 		}
 	}
 	emit LayerChanged();
@@ -719,10 +754,11 @@
 	Table->horizontalHeaderItem(0)->setToolTip("<qt>" + tr("Color of the Layer Indicator. Each layer has a color assigned to display on the canvas when layer indicators are enabled. You can double click to edit the color.") + "</qt>");
 	Table->horizontalHeaderItem(1)->setToolTip("<qt>" + tr("Make Layer Visible. Uncheck to hide the layer from the display.") + "</qt>" );
 	Table->horizontalHeaderItem(2)->setToolTip("<qt>" + tr("Print Layer. Uncheck to disable printing.") + "</qt>" );
-	Table->horizontalHeaderItem(3)->setToolTip("<qt>" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "</qt>" );
-	Table->horizontalHeaderItem(4)->setToolTip("<qt>" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "</qt>" );
-	Table->horizontalHeaderItem(5)->setToolTip("<qt>" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "</qt>" ) ;
-	Table->horizontalHeaderItem(6)->setToolTip("<qt>" + tr("Select Objects on Layer. Check to enable selecting.") + "</qt>" );
-	Table->horizontalHeaderItem(7)->setToolTip("<qt>" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "</qt>" );
+	Table->horizontalHeaderItem(3)->setToolTip("<qt>" + tr("Print Layer on visible only. Check to print layer PDF on visible only.") + "</qt>" );
+	Table->horizontalHeaderItem(4)->setToolTip("<qt>" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "</qt>" );
+	Table->horizontalHeaderItem(5)->setToolTip("<qt>" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "</qt>" );
+	Table->horizontalHeaderItem(6)->setToolTip("<qt>" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "</qt>" ) ;
+	Table->horizontalHeaderItem(7)->setToolTip("<qt>" + tr("Select Objects on Layer. Check to enable selecting.") + "</qt>" );
+	Table->horizontalHeaderItem(8)->setToolTip("<qt>" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "</qt>" );
 }
 
diff -Naur scribus15/scribus/ui/layers.h scribus15-new/scribus/ui/layers.h
--- scribus15/scribus/ui/layers.h	2017-10-02 21:08:42.331450571 +0200
+++ scribus15-new/scribus/ui/layers.h	2017-10-02 22:11:27.996539903 +0200
@@ -52,6 +52,7 @@
 	void changeName(int row, int col);
 	void visibleLayer();
 	void printLayer();
+	void printvisibleLayer();
 	void lockLayer();
 	void flowToggleLayer();
 	void outlineToggleLayer();
pdf_print_on_visible.patch (16,801 bytes)   

sefran

2017-10-27 10:37

reporter   ~0044603

How acrobat do for layers
OCGPropsDlg.jpg (102,865 bytes)   
OCGPropsDlg.jpg (102,865 bytes)   

sefran

2017-10-27 10:41

reporter   ~0044604

référence link https://acrobatusers.com/tutorials/print/creating-and-using-layers-ocgs-with-acrobat-javascript

bubu

2018-03-26 08:14

reporter   ~0045099

Is this patch merged in the trunk? I need this feature.

bubu

2018-03-26 12:32

reporter   ~0045101

Not perfect, but working workaround: Open exported PDF file in some hex editor, and replace these:

from:
/Usage <</Print <</PrintState /ON>> /View <</ViewState /ON>>
to:
/Usage <</View <</ViewState /ON>>

from:
/Usage <</Print <</PrintState /ON>> /View <</ViewState /OFF>>
to:
/Usage <</View <</ViewState /OFF>>

Issue History

Date Modified Username Field Change
2017-08-24 21:08 sefran New Issue
2017-08-24 21:08 sefran File Added: D012_FormulaireDeCréationDeVisioconférenceTemporaireV3.sla
2017-08-24 21:08 sefran File Added: D012_FormulaireDeCréationDeVisioconférenceTemporaireV3.pdf
2017-08-24 21:08 sefran File Added: scribus_pdfprintonview.patch
2017-08-24 21:08 sefran Tag Attached: PDF
2017-08-24 21:18 sefran Note Added: 0044356
2017-08-31 08:08 sefran File Added: D012_CréationDeVisioconférenceTemporaireV3_withoutPrint.pdf
2017-08-31 08:08 sefran File Added: D012_CréationDeVisioconférenceTemporaireV3_withPrint.pdf
2017-08-31 08:08 sefran File Added: ViewBeforePrintWithoutPrint.png
2017-08-31 08:08 sefran File Added: ViewBeforePrintWithPrint.png
2017-08-31 08:08 sefran Note Added: 0044383
2017-08-31 12:51 ale Note Added: 0044384
2017-08-31 12:51 ale Note Edited: 0044384
2017-09-01 15:16 sefran Note Added: 0044387
2017-09-01 15:17 sefran Note Added: 0044388
2017-09-01 15:30 ale Summary When using javascript to hide layers, these are always printed => [PATCH] When using javascript to hide layers, these are always printed
2017-09-01 15:32 ale Note Added: 0044389
2017-09-01 21:56 sefran Note Added: 0044391
2017-09-01 22:07 sefran Note Added: 0044392
2017-09-02 14:57 ale Note Added: 0044393
2017-10-05 22:00 sefran File Added: pdf_print_on_visible.patch
2017-10-05 22:00 sefran Note Added: 0044490
2017-10-27 10:37 sefran File Added: OCGPropsDlg.jpg
2017-10-27 10:37 sefran Note Added: 0044603
2017-10-27 10:41 sefran Note Added: 0044604
2018-03-26 08:14 bubu Note Added: 0045099
2018-03-26 12:32 bubu Note Added: 0045101