@@ -262,35 +262,6 @@ def _ID(self) -> Optional[ArrayObject]:
262
262
id = self .trailer .get (TK .ID , None )
263
263
return None if is_null_or_none (id ) else cast (ArrayObject , id .get_object ())
264
264
265
- def _repr_mimebundle_ (
266
- self ,
267
- include : Union [None , Iterable [str ]] = None ,
268
- exclude : Union [None , Iterable [str ]] = None ,
269
- ) -> Dict [str , Any ]:
270
- """
271
- Integration into Jupyter Notebooks.
272
-
273
- This method returns a dictionary that maps a mime-type to its
274
- representation.
275
-
276
- See https://ipython.readthedocs.io/en/stable/config/integrating.html
277
- """
278
- self .stream .seek (0 )
279
- pdf_data = self .stream .read ()
280
- data = {
281
- "application/pdf" : pdf_data ,
282
- }
283
-
284
- if include is not None :
285
- # Filter representations based on include list
286
- data = {k : v for k , v in data .items () if k in include }
287
-
288
- if exclude is not None :
289
- # Remove representations based on exclude list
290
- data = {k : v for k , v in data .items () if k not in exclude }
291
-
292
- return data
293
-
294
265
@property
295
266
def pdf_header (self ) -> str :
296
267
"""
@@ -1254,3 +1225,34 @@ def rename_form_topname(self, name: str) -> Optional[DictionaryObject]:
1254
1225
)
1255
1226
interim [NameObject ("/T" )] = TextStringObject (name )
1256
1227
return interim
1228
+
1229
+ def _repr_mimebundle_ (
1230
+ self ,
1231
+ include : Union [None , Iterable [str ]] = None ,
1232
+ exclude : Union [None , Iterable [str ]] = None ,
1233
+ ) -> Dict [str , Any ]:
1234
+ """
1235
+ Integration into Jupyter Notebooks.
1236
+
1237
+ This method returns a dictionary that maps a mime-type to its
1238
+ representation.
1239
+
1240
+ .. seealso::
1241
+
1242
+ https://ipython.readthedocs.io/en/stable/config/integrating.html
1243
+ """
1244
+ self .stream .seek (0 )
1245
+ pdf_data = self .stream .read ()
1246
+ data = {
1247
+ "application/pdf" : pdf_data ,
1248
+ }
1249
+
1250
+ if include is not None :
1251
+ # Filter representations based on include list
1252
+ data = {k : v for k , v in data .items () if k in include }
1253
+
1254
+ if exclude is not None :
1255
+ # Remove representations based on exclude list
1256
+ data = {k : v for k , v in data .items () if k not in exclude }
1257
+
1258
+ return data
0 commit comments