r16567 by jghali - #9385 : clip page content to bleed box when exporting pdf

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 10 14:58:01 CEST 2011


Author: jghali
Date: Sun Apr 10 12:58:01 2011
New Revision: 16567

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16567
Log:
#9385 : clip page content to bleed box when exporting pdf

Modified:
    branches/Version135/Scribus/scribus/pdflib_core.cpp

Modified: branches/Version135/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16567&path=/branches/Version135/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pdflib_core.cpp (original)
+++ branches/Version135/Scribus/scribus/pdflib_core.cpp Sun Apr 10 12:58:01 2011
@@ -2709,9 +2709,11 @@
 	ll.LNr = 0;
 	if (Options.UseLPI)
 		PutPage("/"+HTName+" gs\n");
-	double bleedRight = 0.0;
-	double bleedLeft = 0.0;
-	double markOffs = 0.0;
+	double bleedRight  = 0.0;
+	double bleedLeft   = 0.0;
+	double bleedBottom = 0.0;
+	double bleedTop    = 0.0;
+	double markOffs    = 0.0;
 	bleedDisplacementX = 0.0;
 	bleedDisplacementY = 0.0;
 	PutPage("q\n"); // Save
@@ -2720,11 +2722,18 @@
 	// #8773 - incorrect page position if MPageNam.isEmpty()
 	/*if (!pag->MPageNam.isEmpty())
 	{*/
-		getBleeds(ActPageP, bleedLeft, bleedRight);
+		getBleeds(ActPageP, bleedLeft, bleedRight, bleedBottom, bleedTop);
 		PutPage("1 0 0 1 "+FToStr(bleedLeft+markOffs)+" "+FToStr(Options.bleeds.Bottom+markOffs)+" cm\n");
 		bleedDisplacementX = bleedLeft+markOffs;
 		bleedDisplacementY = Options.bleeds.Bottom+markOffs;
 	/*}*/
+	//#9385 : clip to BleedBox
+	if ((Options.cropMarks) || (Options.bleedMarks) || (Options.registrationMarks) || (Options.colorMarks) || (Options.docInfoMarks))
+	{
+		double bbWidth  = ActPageP->width()  + bleedLeft + bleedRight;
+		double bbHeight = ActPageP->height() + bleedBottom + bleedTop;
+		PutPage( QString("%1 %2 %3 %4 re W n\n").arg(FToStr(-bleedLeft)).arg(FToStr(-bleedBottom)).arg(FToStr(bbWidth)).arg(FToStr(bbHeight)) );
+	}
 	if ( (Options.MirrorH) && (!pag->MPageNam.isEmpty()) )
 		PutPage("-1 0 0 1 "+FToStr(ActPageP->width())+" 0 cm\n");
 	if ( (Options.MirrorV) && (!pag->MPageNam.isEmpty()) )




More information about the scribus-commit mailing list