Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38d8da3

Browse files
committed
PDF backend: put the Group describing transparency into the Pages object instead of into every Page object. This avoids a PDFLaTeX warning when including pages from a multi-page PDF.
1 parent 13a8f31 commit 38d8da3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,10 @@ def __init__(self, filename):
449449
self.resourceObject = self.reserveObject('resources')
450450

451451
root = {'Type': Name('Catalog'),
452-
'Pages': self.pagesObject}
452+
'Pages': self.pagesObject,
453+
'Group': {'Type': Name('Group'),
454+
'S': Name('Transparency'),
455+
'CS': Name('DeviceRGB')}}
453456
self.writeObject(self.rootObject, root)
454457

455458
revision = ''
@@ -508,9 +511,6 @@ def newPage(self, width, height):
508511
'Resources': self.resourceObject,
509512
'MediaBox': [0, 0, 72 * width, 72 * height],
510513
'Contents': contentObject,
511-
'Group': {'Type': Name('Group'),
512-
'S': Name('Transparency'),
513-
'CS': Name('DeviceRGB')},
514514
'Annots': self.pageAnnotations,
515515
}
516516
pageObject = self.reserveObject('page')

0 commit comments

Comments
 (0)