@@ -528,7 +528,7 @@ def set_need_appearances_writer(self, state: bool = True) -> None:
528528 Returns:
529529 None
530530 """
531- # See 12.7.2 and 7.7.2 for more information:
531+ # See § 12.7.2 and § 7.7.2 for more information:
532532 # https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
533533 try :
534534 # get the AcroForm tree
@@ -716,7 +716,7 @@ def add_js(self, javascript: str) -> None:
716716 Add JavaScript which will launch upon opening this PDF.
717717
718718 Args:
719- javascript: Your Javascript .
719+ javascript: Your JavaScript .
720720
721721 >>> output.add_js("this.print({bUI:true,bSilent:false,bShrinkToFit:true});")
722722 # Example: This will launch the print window when the PDF is opened.
@@ -741,7 +741,7 @@ def add_js(self, javascript: str) -> None:
741741 NameObject ("/JS" ): TextStringObject (f"{ javascript } " ),
742742 }
743743 )
744- # We need a name for parameterized javascript in the pdf file,
744+ # We need a name for parameterized JavaScript in the PDF file,
745745 # but it can be anything.
746746 js_list .append (create_string_object (str (uuid .uuid4 ())))
747747 js_list .append (self ._add_object (js ))
@@ -1605,7 +1605,7 @@ def compress_identical_objects(
16051605 remove_orphans : bool = True ,
16061606 ) -> None :
16071607 """
1608- Parse the PDF file and merge objects that have same hash.
1608+ Parse the PDF file and merge objects that have the same hash.
16091609 This will make objects common to multiple pages.
16101610 Recommended to be used just before writing output.
16111611
@@ -3132,7 +3132,7 @@ def set_page_label(
31323132
31333133 Page indexes must be given starting from 0.
31343134 Labels must have a style, a prefix or both.
3135- If a range is not assigned any page label a decimal label starting from 1 is applied.
3135+ If a range is not assigned any page label, a decimal label starting from 1 is applied.
31363136
31373137 Args:
31383138 page_index_from: page index of the beginning of the range starting from 0
@@ -3155,17 +3155,17 @@ def set_page_label(
31553155 Default value: 1.
31563156 """
31573157 if style is None and prefix is None :
3158- raise ValueError ("at least one between style and prefix must be given" )
3158+ raise ValueError ("At least one of style and prefix must be given" )
31593159 if page_index_from < 0 :
3160- raise ValueError ("page_index_from must be equal or greater then 0" )
3160+ raise ValueError ("page_index_from must be greater or equal than 0" )
31613161 if page_index_to < page_index_from :
31623162 raise ValueError (
3163- "page_index_to must be equal or greater then page_index_from"
3163+ "page_index_to must be greater or equal than page_index_from"
31643164 )
31653165 if page_index_to >= len (self .pages ):
31663166 raise ValueError ("page_index_to exceeds number of pages" )
31673167 if start is not None and start != 0 and start < 1 :
3168- raise ValueError ("if given, start must be equal or greater than one" )
3168+ raise ValueError ("If given, start must be greater or equal than one" )
31693169
31703170 self ._set_page_label (page_index_from , page_index_to , style , prefix , start )
31713171
@@ -3241,8 +3241,8 @@ def _pdf_objectify(obj: Union[Dict[str, Any], str, int, List[Any]]) -> PdfObject
32413241 to_add = DictionaryObject ()
32423242 for key , value in obj .items ():
32433243 name_key = NameObject (key )
3244- casted_value = _pdf_objectify (value )
3245- to_add [name_key ] = casted_value
3244+ cast_value = _pdf_objectify (value )
3245+ to_add [name_key ] = cast_value
32463246 return to_add
32473247 elif isinstance (obj , str ):
32483248 if obj .startswith ("/" ):
0 commit comments