Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25162 → Rev 25161

/trunk/Scribus/scribus/pdflib_core.cpp
2563,43 → 2563,43
 
void PDFLibCore::PDF_Begin_Layers()
{
if (!Options.exportsLayers())
return;
 
ScLayer ll;
PdfOCGInfo ocg;
ll.isPrintable = false;
ll.ID = 0;
QByteArray ocgNam("oc");
int docLayersCount = doc.Layers.count();
for (int la = 0; la < docLayersCount; ++la)
if (Options.exportsLayers())
{
PdfId optionalContent = writer.newObject();
doc.Layers.levelToLayer(ll, la);
ocg.Name = ocgNam + Pdf::toPdf(ll.ID);
ocg.ObjNum = optionalContent;
ocg.visible = ll.isViewable;
OCGEntries.insert(ll.Name, ocg);
writer.startObj(optionalContent);
PutDoc("<<\n");
PutDoc("/Type /OCG\n");
PutDoc("/Name ");
PutDoc(EncStringUTF16(ll.Name, optionalContent));
PutDoc("\n");
PutDoc("/Usage <</Print <</PrintState ");
if (ll.isPrintable)
PutDoc("/ON");
else
PutDoc("/OFF");
PutDoc(">> /View <</ViewState ");
if (ll.isViewable)
PutDoc("/ON");
else
PutDoc("/OFF");
PutDoc(">>>>");
PutDoc("\n");
PutDoc(">>");
writer.endObj(optionalContent);
ScLayer ll;
PdfOCGInfo ocg;
ll.isPrintable = false;
ll.ID = 0;
QByteArray ocgNam("oc");
int docLayersCount = doc.Layers.count();
for (int la = 0; la < docLayersCount; ++la)
{
PdfId optionalContent = writer.newObject();
doc.Layers.levelToLayer(ll, la);
ocg.Name = ocgNam + Pdf::toPdf(ll.ID);
ocg.ObjNum = optionalContent;
ocg.visible = ll.isViewable;
OCGEntries.insert(ll.Name, ocg);
writer.startObj(optionalContent);
PutDoc("<<\n");
PutDoc("/Type /OCG\n");
PutDoc("/Name ");
PutDoc(EncStringUTF16(ll.Name, optionalContent));
PutDoc("\n");
PutDoc("/Usage <</Print <</PrintState ");
if (ll.isPrintable)
PutDoc("/ON");
else
PutDoc("/OFF");
PutDoc(">> /View <</ViewState ");
if (ll.isViewable)
PutDoc("/ON");
else
PutDoc("/OFF");
PutDoc(">>>>");
PutDoc("\n");
PutDoc(">>");
writer.endObj(optionalContent);
}
}
}
 
11213,15 → 11213,15
ScLayer ll;
ll.isPrintable = false;
ll.ID = 0;
for (int i = 0; i < doc.Layers.count(); ++i)
for (int la = 0; la < doc.Layers.count(); ++la)
{
doc.Layers.levelToLayer(ll, i);
doc.Layers.levelToLayer(ll, la);
if (ll.isEditable)
lay.prepend(Pdf::toObjRef(OCGEntries[ll.Name].ObjNum) + " ");
}
for (int i = 0; i < lay.count(); ++i)
for (int layc = 0; layc < lay.count(); ++layc)
{
PutDoc(lay[i]);
PutDoc(lay[layc]);
}
PutDoc("]\n");
if (Options.Version == PDFVersion::PDF_X4)