aspose-barcode-for-python-via-java 24.12.0__tar.gz → 25.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/PKG-INFO +1 -1
  2. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/aspose_barcode_for_python_via_java.egg-info/PKG-INFO +1 -1
  3. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/aspose_barcode_for_python_via_java.egg-info/SOURCES.txt +1 -1
  4. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/asposebarcode/Assist.py +1 -1
  5. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/asposebarcode/ComplexBarcode.py +71 -61
  6. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/asposebarcode/Generation.py +50 -259
  7. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/asposebarcode/Recognition.py +6 -29
  8. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/asposebarcode/__init__.py +1 -1
  9. aspose-barcode-for-python-via-java-24.12.0/asposebarcode/jlib/aspose-barcode-python-24.12.jar → aspose-barcode-for-python-via-java-25.2.0/asposebarcode/jlib/aspose-barcode-python-25.2.jar +0 -0
  10. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/setup.py +1 -1
  11. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/MANIFEST.in +0 -0
  12. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/README.md +0 -0
  13. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/aspose_barcode_for_python_via_java.egg-info/dependency_links.txt +0 -0
  14. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/aspose_barcode_for_python_via_java.egg-info/requires.txt +0 -0
  15. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/aspose_barcode_for_python_via_java.egg-info/top_level.txt +0 -0
  16. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/license/End+User+License+Agreement.html +0 -0
  17. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/license/ThirdPartyLicenses.Aspose.BarCode.Java.pdf +0 -0
  18. {aspose-barcode-for-python-via-java-24.12.0 → aspose-barcode-for-python-via-java-25.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aspose-barcode-for-python-via-java
3
- Version: 24.12.0
3
+ Version: 25.2.0
4
4
  Summary: Barcode generation and recognition component. It allows developers to quickly and easily add barcode creation and scanning functionality to their Python applications.
5
5
  Home-page: UNKNOWN
6
6
  Author: Aspose
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aspose-barcode-for-python-via-java
3
- Version: 24.12.0
3
+ Version: 25.2.0
4
4
  Summary: Barcode generation and recognition component. It allows developers to quickly and easily add barcode creation and scanning functionality to their Python applications.
5
5
  Home-page: UNKNOWN
6
6
  Author: Aspose
@@ -11,6 +11,6 @@ asposebarcode/ComplexBarcode.py
11
11
  asposebarcode/Generation.py
12
12
  asposebarcode/Recognition.py
13
13
  asposebarcode/__init__.py
14
- asposebarcode/jlib/aspose-barcode-python-24.12.jar
14
+ asposebarcode/jlib/aspose-barcode-python-25.2.jar
15
15
  license/End+User+License+Agreement.html
16
16
  license/ThirdPartyLicenses.Aspose.BarCode.Java.pdf
@@ -28,7 +28,7 @@ class BaseJavaClass(ABC):
28
28
  self.init()
29
29
 
30
30
  def getJavaClassName(self) -> str:
31
- return self.javaClassName
31
+ return self.getJavaClass().getClass().getName()
32
32
 
33
33
  def isNull(self) -> bool:
34
34
  return self.javaClass.isNull()
@@ -2,8 +2,8 @@ from __future__ import annotations
2
2
 
3
3
  from abc import abstractmethod
4
4
  from typing import Union, List, Optional
5
- import time
6
- from datetime import datetime
5
+ import calendar
6
+ from datetime import datetime, timezone
7
7
 
8
8
  import jpype
9
9
  import base64
@@ -106,11 +106,9 @@ class ComplexBarcodeGenerator(Assist.BaseJavaClass):
106
106
  default value is BarCodeImageFormat.PNG
107
107
  @return Pillow Image object of barcode image
108
108
  """
109
- # Decode the base64 string to bytes
110
- bytes_data: bytes = base64.b64decode(str(self.javaClass.generateBarCodeImage(Generation.BarCodeImageFormat.PNG.value)) )
111
- # Create a BytesIO buffer from the bytes
112
- buf: io.BytesIO = io.BytesIO(bytes_data)
113
- # Return an image object using Pillow
109
+ bytes_data = base64.b64decode(str(self.javaClass.generateBarCodeImage(
110
+ Generation.BarCodeImageFormat.PNG.value)))
111
+ buf = io.BytesIO(bytes_data)
114
112
  return Image.open(buf)
115
113
 
116
114
  def save(self, imageSource: Union[str, io.BytesIO], imageFormat: Generation.BarCodeImageFormat) -> None:
@@ -133,6 +131,7 @@ class ComplexBarcodeGenerator(Assist.BaseJavaClass):
133
131
  except Exception as e:
134
132
  raise IOError(f"Failed to save the image: {e}")
135
133
 
134
+
136
135
  class Address(Assist.BaseJavaClass):
137
136
  """!
138
137
  Address of creditor or debtor.
@@ -156,7 +155,7 @@ class Address(Assist.BaseJavaClass):
156
155
  address.init()
157
156
  return address
158
157
 
159
- def getType(self) -> int:
158
+ def getType(self) -> AddressType:
160
159
  """!
161
160
  Gets the address type.
162
161
  The address type is automatically set by either setting street / house number
@@ -164,7 +163,7 @@ class Address(Assist.BaseJavaClass):
164
163
  If fields of both types are set, the address type becomes Conflicting.
165
164
  @return: The address type.
166
165
  """
167
- return int(self.getJavaClass().getType())
166
+ return AddressType(self.getJavaClass().getType())
168
167
 
169
168
  def getName(self) -> Optional[str]:
170
169
  """!
@@ -465,8 +464,9 @@ class ComplexCodetextReader(Assist.BaseJavaClass):
465
464
  @return decoded SwissQRCodetext or None.
466
465
  @param encodedCodetext encoded codetext
467
466
  """
468
- javaPythonComplexCodetextReader = jpype.JClass(ComplexCodetextReader.javaClassName)
469
- return SwissQRCodetext.construct(javaPythonComplexCodetextReader.tryDecodeSwissQR(encodedCodetext))
467
+ javaComplexCodetextReaderClass = jpype.JClass(ComplexCodetextReader.javaClassName)
468
+ javaSwissQR = javaComplexCodetextReaderClass.tryDecodeSwissQR(encodedCodetext)
469
+ return None if javaSwissQR is None else SwissQRCodetext.construct(javaSwissQR)
470
470
 
471
471
  @staticmethod
472
472
  def tryDecodeMailmark2D(encodedCodetext: str) -> Optional[Mailmark2DCodetext]:
@@ -475,8 +475,9 @@ class ComplexCodetextReader(Assist.BaseJavaClass):
475
475
  @param encodedCodetext encoded codetext
476
476
  @return decoded Royal Mail Mailmark 2D or None.
477
477
  """
478
- javaPythonComplexCodetextReader = jpype.JClass(ComplexCodetextReader.javaClassName)
479
- return Mailmark2DCodetext.construct(javaPythonComplexCodetextReader.tryDecodeMailmark2D(encodedCodetext))
478
+ javaComplexCodetextReaderClass = jpype.JClass(ComplexCodetextReader.javaClassName)
479
+ javaMailmark2DCodetext = javaComplexCodetextReaderClass.tryDecodeMailmark2D(encodedCodetext)
480
+ return None if javaMailmark2DCodetext is None else Mailmark2DCodetext.construct(javaMailmark2DCodetext)
480
481
 
481
482
  @staticmethod
482
483
  def tryDecodeMailmark(encodedCodetext: str) -> Optional[MailmarkCodetext]:
@@ -485,15 +486,12 @@ class ComplexCodetextReader(Assist.BaseJavaClass):
485
486
  @param encodedCodetext encoded codetext
486
487
  @return Decoded Mailmark Barcode C and L or None.
487
488
  """
488
- res = MailmarkCodetext(None)
489
- try:
490
- res.initFromString(encodedCodetext)
491
- except Exception as e:
492
- return None
493
- return res
489
+ javaComplexCodetextReaderClass = jpype.JClass(ComplexCodetextReader.javaClassName)
490
+ javaDecodeMailmark = javaComplexCodetextReaderClass.tryDecodeMailmark(encodedCodetext)
491
+ return None if javaDecodeMailmark is None else MailmarkCodetext.construct(javaDecodeMailmark)
494
492
 
495
493
  @staticmethod
496
- def tryDecodeMaxiCode(maxiCodeMode: int, encodedCodetext: str) -> Optional[Union[MaxiCodeCodetextMode2, MaxiCodeCodetextMode3, MaxiCodeStandardCodetext]]:
494
+ def tryDecodeMaxiCode(maxiCodeMode: Generation.MaxiCodeMode, encodedCodetext: str) -> Optional[Union[MaxiCodeCodetextMode2, MaxiCodeCodetextMode3, MaxiCodeStandardCodetext]]:
497
495
  """!
498
496
  Decodes MaxiCode codetext.
499
497
  @param: maxiCodeMode: MaxiCode mode
@@ -503,7 +501,7 @@ class ComplexCodetextReader(Assist.BaseJavaClass):
503
501
  javaComplexCodetextReaderClass = jpype.JClass(ComplexCodetextReader.javaClassName)
504
502
  javaMaxiCodeCodetextMode2Class = jpype.JClass(MaxiCodeCodetextMode2.JAVA_CLASS_NAME)
505
503
  javaMaxiCodeCodetextMode3Class = jpype.JClass(MaxiCodeCodetextMode3.JAVA_CLASS_NAME)
506
- javaMaxiCodeCodetext = javaComplexCodetextReaderClass.tryDecodeMaxiCode(maxiCodeMode, encodedCodetext)
504
+ javaMaxiCodeCodetext = javaComplexCodetextReaderClass.tryDecodeMaxiCode(maxiCodeMode.value, encodedCodetext)
507
505
 
508
506
  if javaMaxiCodeCodetext.getClass().equals(javaMaxiCodeCodetextMode2Class().getClass()):
509
507
  return MaxiCodeCodetextMode2.construct(javaMaxiCodeCodetext)
@@ -819,15 +817,15 @@ class SwissQRCodetext(IComplexCodetext):
819
817
  self.bill: SwissQRBill = SwissQRBill(self.getJavaClass().getBill())
820
818
 
821
819
  def init(self) -> None:
820
+ self.bill = SwissQRBill(self.getJavaClass().getBill())
822
821
  pass
823
- # self.bill: Optional[SwissQRBill] = SwissQRBill(self.getJavaClass().getBill())
824
822
 
825
823
 
826
824
  @staticmethod
827
825
  def construct(javaClass) -> SwissQRCodetext:
828
- phpClass = SwissQRCodetext(None)
829
- phpClass.setJavaClass(javaClass)
830
- return phpClass
826
+ pythonClass = SwissQRCodetext(None)
827
+ pythonClass.setJavaClass(javaClass)
828
+ return pythonClass
831
829
 
832
830
  def getConstructedCodetext(self) -> Optional[str]:
833
831
  """!
@@ -858,6 +856,24 @@ class MailmarkCodetext(IComplexCodetext):
858
856
  """
859
857
  javaClassName = "com.aspose.mw.barcode.complexbarcode.MwMailmarkCodetext"
860
858
 
859
+ def __init__(self) -> None:
860
+ """!
861
+ Initializes a new instance of the MailmarkCodetext class.
862
+ @param: mailmarkCodetext:
863
+ """
864
+ java_class_link = jpype.JClass(self.javaClassName)
865
+ javaClass = java_class_link()
866
+ super().__init__(javaClass)
867
+
868
+ @staticmethod
869
+ def construct(javaClass) -> MailmarkCodetext:
870
+ pythonClass = MailmarkCodetext()
871
+ pythonClass.setJavaClass(javaClass)
872
+ return pythonClass
873
+
874
+ def init(self) -> None:
875
+ pass
876
+
861
877
  def getFormat(self) -> int:
862
878
  """!
863
879
  "0" – None or Test
@@ -900,7 +916,7 @@ class MailmarkCodetext(IComplexCodetext):
900
916
  "8" - Premium (Network Access)
901
917
  "9" - Standard (Network Access)
902
918
  """
903
- value = self.getJavaClass().getClass_()()
919
+ value = self.getJavaClass().getClass_()
904
920
  return str(value) if value is not None else None
905
921
 
906
922
  def setClass(self, value: str) -> None:
@@ -972,22 +988,6 @@ class MailmarkCodetext(IComplexCodetext):
972
988
  """
973
989
  self.getJavaClass().setDestinationPostCodePlusDPS(value)
974
990
 
975
- def __init__(self, mailmarkCodetext: Optional[MailmarkCodetext]) -> None:
976
- """!
977
- Initializes a new instance of the MailmarkCodetext class.
978
- @param: mailmarkCodetext:
979
- """
980
- java_class_link = jpype.JClass(self.javaClassName)
981
- javaClass = None
982
- if mailmarkCodetext is None:
983
- javaClass = java_class_link()
984
- else:
985
- javaClass = java_class_link(mailmarkCodetext.getJavaClass())
986
- super().__init__(javaClass)
987
-
988
- def init(self) -> None:
989
- pass
990
-
991
991
  def getConstructedCodetext(self) -> Optional[str]:
992
992
  """!
993
993
  Construct codetext from Mailmark data.
@@ -1492,12 +1492,17 @@ class MaxiCodeStandartSecondMessage(MaxiCodeSecondMessage):
1492
1492
 
1493
1493
  def __init__(self) -> None:
1494
1494
  try:
1495
- java_class = jpype.JClass(
1496
- MaxiCodeStandartSecondMessage.JAVA_CLASS_NAME)
1495
+ java_class = jpype.JClass(MaxiCodeStandartSecondMessage.JAVA_CLASS_NAME)
1497
1496
  super().__init__(java_class())
1498
1497
  except Exception as ex:
1499
1498
  raise Assist.BarCodeException(ex)
1500
1499
 
1500
+ @staticmethod
1501
+ def construct(javaClass) -> MaxiCodeStandartSecondMessage:
1502
+ _class = MaxiCodeStandartSecondMessage()
1503
+ _class.setJavaClass(javaClass)
1504
+ return _class
1505
+
1501
1506
  def setMessage(self, value: str) -> None:
1502
1507
  """!
1503
1508
  Sets second message
@@ -1567,19 +1572,17 @@ class MaxiCodeStructuredCodetext(MaxiCodeCodetext):
1567
1572
 
1568
1573
  def init(self) -> None:
1569
1574
  javaMaxiCodeSecondMessage = self.getJavaClass().getSecondMessage()
1570
- javaMaxiCodeStandartSecondMessageClass = jpype.JClass(
1571
- "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStandartSecondMessage")
1572
- javaMaxiCodeStandartSecondMessage = javaMaxiCodeStandartSecondMessageClass()
1573
- javaMaxiCodeStructuredSecondMessageClass = jpype.JClass(
1574
- "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStructuredSecondMessage")
1575
- javaMaxiCodeStructuredSecondMessage = javaMaxiCodeStructuredSecondMessageClass()
1576
-
1577
- if javaMaxiCodeSecondMessage is javaMaxiCodeStandartSecondMessage:
1578
- # self.maxiCodeSecondMessage = MaxiCodeStandartSecondMessage(self.getJavaClass().getSecondMessage())
1579
- self.maxiCodeSecondMessage = MaxiCodeStandartSecondMessage() # TODO BARCODEPYTHON-569
1580
- elif javaMaxiCodeSecondMessage is javaMaxiCodeStructuredSecondMessage:
1581
- # self.maxiCodeSecondMessage = MaxiCodeStructuredSecondMessage(self.getJavaClass().getSecondMessage())
1582
- self.maxiCodeSecondMessage = MaxiCodeStructuredSecondMessage() #TODO BARCODEPYTHON-569
1575
+ javaMaxiCodeStandartSecondMessageClass = jpype.JClass(MaxiCodeStandartSecondMessage.JAVA_CLASS_NAME)
1576
+ javaMaxiCodeStructuredSecondMessageClass = jpype.JClass(MaxiCodeStructuredSecondMessage.JAVA_CLASS_NAME)
1577
+
1578
+ if javaMaxiCodeSecondMessage is None:
1579
+ self.maxiCodeSecondMessage = None
1580
+ elif str(javaMaxiCodeSecondMessage.getClass().toString()) == str(javaMaxiCodeStandartSecondMessageClass.class_.toString()):
1581
+ self.maxiCodeSecondMessage = MaxiCodeStandartSecondMessage.construct(javaMaxiCodeSecondMessage)
1582
+ elif str(javaMaxiCodeSecondMessage.getClass().toString()) == str(javaMaxiCodeStructuredSecondMessageClass.class_.toString()):
1583
+ self.maxiCodeSecondMessage = MaxiCodeStructuredSecondMessage.construct(javaMaxiCodeSecondMessage)
1584
+ else:
1585
+ raise Exception()
1583
1586
 
1584
1587
  def getPostalCode(self) -> str:
1585
1588
  """!
@@ -1877,6 +1880,12 @@ class MaxiCodeStructuredSecondMessage(MaxiCodeSecondMessage):
1877
1880
  except Exception as ex:
1878
1881
  raise Assist.BarCodeException(ex)
1879
1882
 
1883
+ @staticmethod
1884
+ def construct(javaClass) -> MaxiCodeStructuredSecondMessage:
1885
+ _class = MaxiCodeStructuredSecondMessage()
1886
+ _class.setJavaClass(javaClass)
1887
+ return _class
1888
+
1880
1889
  def getYear(self) -> int:
1881
1890
  """!
1882
1891
  Gets year. Year must be 2 digit integer value.
@@ -2279,6 +2288,7 @@ class HIBCLICSecondaryAndAdditionalDataCodetext(HIBCLICComplexCodetext):
2279
2288
  @param: constructedCodetext:Constructed codetext.
2280
2289
  """
2281
2290
  self.getJavaClass().initFromString(constructedCodetext)
2291
+ self.init()
2282
2292
 
2283
2293
  def __eq__(self, other: HIBCLICSecondaryAndAdditionalDataCodetext) -> bool:
2284
2294
  """!
@@ -2637,13 +2647,13 @@ class SecondaryAndAdditionalData(Assist.BaseJavaClass):
2637
2647
  """!
2638
2648
  Identifies expiry date. Will be used if ExpiryDateFormat is not set to None.
2639
2649
  """
2640
- return datetime.fromtimestamp(int(str(self.getJavaClass().getExpiryDate())))
2650
+ return datetime.fromtimestamp(int(str(self.getJavaClass().getExpiryDate())), tz=timezone.utc)
2641
2651
 
2642
2652
  def setExpiryDate(self, value: datetime) -> None:
2643
2653
  """!
2644
2654
  Identifies expiry date. Will be used if ExpiryDateFormat is not set to None.
2645
2655
  """
2646
- self.getJavaClass().setExpiryDate(str(int(time.mktime(value.timetuple()))))
2656
+ self.getJavaClass().setExpiryDate(str(int(calendar.timegm(value.timetuple()))))
2647
2657
 
2648
2658
  def getLotNumber(self) -> str:
2649
2659
  """!
@@ -2681,7 +2691,7 @@ class SecondaryAndAdditionalData(Assist.BaseJavaClass):
2681
2691
  Date of manufacture can be set to DateTime.MinValue in order not to use this field.
2682
2692
  Default value: DateTime.MinValue
2683
2693
  """
2684
- return datetime.fromtimestamp(int(str(self.getJavaClass().getDateOfManufacture())))
2694
+ return datetime.fromtimestamp(int(str(self.getJavaClass().getDateOfManufacture())), tz=timezone.utc)
2685
2695
 
2686
2696
  def setDateOfManufacture(self, value: datetime) -> None:
2687
2697
  """!
@@ -2689,7 +2699,7 @@ class SecondaryAndAdditionalData(Assist.BaseJavaClass):
2689
2699
  Date of manufacture can be set to DateTime.MinValue in order not to use this field.
2690
2700
  Default value: DateTime.MinValue
2691
2701
  """
2692
- self.getJavaClass().setDateOfManufacture(str(int(time.mktime(value.timetuple()))))
2702
+ self.getJavaClass().setDateOfManufacture(str(int(calendar.timegm(value.timetuple()))))
2693
2703
 
2694
2704
  def getQuantity(self) -> int:
2695
2705
  """!
@@ -85,21 +85,25 @@ class BarcodeGenerator(Assist.BaseJavaClass):
85
85
  value = self.getJavaClass().getCodeText()
86
86
  return str(value) if value is not None else None
87
87
 
88
- def setCodeText(self, value: Union[str, bytes], encoding: Optional[str]) -> None:
88
+ def setCodeText(self, codeText: Union[str, bytes], encoding: Optional[str], BoM: Optional[bool]) -> None:
89
89
  """
90
90
  Encodes codetext with a byte order mark (BOM) using the specified encoding.
91
- @param value: The CodeText string or bytes.
91
+ @param codeText: The CodeText string or bytes.
92
92
  If a bytes object is provided, it will be encoded to Base64.
93
93
  @param encoding: The encoding to apply when processing the string value.
94
94
 
95
+ @param BoM: flag indicates insertion of the Encoding byte order mark (BOM). In case, the Encoding requires byte order mark (BOM) insertion: like UTF8,
96
+ UTF16, UTF32, e.t.c. and flag is set to true, the BOM is added, in case of setting flag to false, the BOM insertion is ignored.
97
+
95
98
  If 'value' is a bytes object, it is encoded using Base64.
96
99
  If 'value' is a string, it's passed to 'setCodeText' of the Java class along with the specified encoding.
97
100
  """
98
- if isinstance(value, bytes):
99
- base64_bytes = base64.b64encode(value)
101
+ if isinstance(codeText, bytes):
102
+ base64_bytes = base64.b64encode(codeText)
100
103
  self.getJavaClass().setCodeBytes(base64_bytes)
101
104
  else:
102
- self.getJavaClass().setCodeText(value, encoding)
105
+ adaptedBoMStr = None if BoM is None else str(BoM)
106
+ self.getJavaClass().setCodeText(codeText, encoding, adaptedBoMStr)
103
107
 
104
108
  def generateBarCodeImage(self) -> Image:
105
109
  """! Generate the barcode image under current settings.
@@ -920,7 +924,17 @@ class CaptionParameters(Assist.BaseJavaClass):
920
924
  """!
921
925
  String representation of the CaptionParameters object.
922
926
  """
923
- return str(self.getJavaClass().toString())
927
+ return (
928
+ f"CaptionParameters("
929
+ f"text='{self.getText()}', "
930
+ f"font={self.getFont()}, "
931
+ f"text_color={self.getTextColor()}, "
932
+ f"alignment={self.getAlignment()}, "
933
+ f"padding={self.getPadding()}, "
934
+ f"visible={self.getVisible()}, "
935
+ f"no_wrap={self.getNoWrap()}"
936
+ f")"
937
+ )
924
938
 
925
939
 
926
940
  class Unit(Assist.BaseJavaClass):
@@ -2479,14 +2493,14 @@ class Pdf417Parameters(Assist.BaseJavaClass):
2479
2493
  """
2480
2494
  return int(self.getJavaClass().getMacroCharacters())
2481
2495
 
2482
- def setMacroCharacters(self, value: int) -> None:
2496
+ def setMacroCharacters(self, value: MacroCharacter) -> None:
2483
2497
  """!
2484
2498
  Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.
2485
2499
  Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes
2486
2500
  Default value: MacroCharacters.None.
2487
2501
  @param MacroCharacters int value
2488
2502
  """
2489
- self.getJavaClass().setMacroCharacters(value)
2503
+ self.getJavaClass().setMacroCharacters(value.value)
2490
2504
 
2491
2505
  def isLinked(self) -> bool:
2492
2506
  """!
@@ -2999,6 +3013,18 @@ class FontUnit(Assist.BaseJavaClass):
2999
3013
  """
3000
3014
  return self._size
3001
3015
 
3016
+ def __str__(self) -> str:
3017
+ """!
3018
+ String representation of the FontUnit object.
3019
+ """
3020
+ return (
3021
+ f"FontUnit("
3022
+ f"family_name='{self.getFamilyName()}', "
3023
+ f"style={self.getStyle()}, "
3024
+ f"size={self.getSize()}"
3025
+ f")"
3026
+ )
3027
+
3002
3028
  class ExtCodetextBuilder(Assist.BaseJavaClass):
3003
3029
  """!
3004
3030
  Helper class for automatic codetext generation of the Extended Codetext Mode
@@ -4866,258 +4892,20 @@ class EncodeTypes(Enum):
4866
4892
  RECT_MICRO_QR = 84
4867
4893
 
4868
4894
  @staticmethod
4869
- def parse(encodeTypeName):
4870
- if encodeTypeName == "CODABAR":
4871
- return 0
4872
-
4873
- elif encodeTypeName == "CODE_11":
4874
- return 1
4875
-
4876
- elif encodeTypeName == "CODE_39":
4877
- return 2
4878
-
4879
- elif encodeTypeName == "CODE_39_FULL_ASCII":
4880
- return 3
4881
-
4882
- elif encodeTypeName == "CODE_93":
4883
- return 5
4884
-
4885
- elif encodeTypeName == "CODE_128":
4886
- return 6
4887
-
4888
- elif encodeTypeName == "GS_1_CODE_128":
4889
- return 7
4890
-
4891
- elif encodeTypeName == "EAN_8":
4892
- return 8
4893
-
4894
- elif encodeTypeName == "EAN_13":
4895
- return 9
4896
-
4897
- elif encodeTypeName == "EAN_14":
4898
- return 10
4899
-
4900
- elif encodeTypeName == "SCC_14":
4901
- return 11
4902
-
4903
- elif encodeTypeName == "SSCC_18":
4904
- return 12
4905
-
4906
- elif encodeTypeName == "UPCA":
4907
- return 13
4908
-
4909
- elif encodeTypeName == "UPCE":
4910
- return 14
4911
-
4912
- elif encodeTypeName == "ISBN":
4913
- return 15
4914
-
4915
- elif encodeTypeName == "ISSN":
4916
- return 16
4917
-
4918
- elif encodeTypeName == "ISMN":
4919
- return 17
4920
-
4921
- elif encodeTypeName == "STANDARD_2_OF_5":
4922
- return 18
4923
-
4924
- elif encodeTypeName == "INTERLEAVED_2_OF_5":
4925
- return 19
4926
-
4927
- elif encodeTypeName == "MATRIX_2_OF_5":
4928
- return 20
4929
-
4930
- elif encodeTypeName == "ITALIAN_POST_25":
4931
- return 21
4932
-
4933
- elif encodeTypeName == "IATA_2_OF_5":
4934
- return 22
4935
-
4936
- elif encodeTypeName == "ITF_14":
4937
- return 23
4938
-
4939
- elif encodeTypeName == "ITF_6":
4940
- return 24
4941
-
4942
- elif encodeTypeName == "MSI":
4943
- return 25
4944
-
4945
- elif encodeTypeName == "VIN":
4946
- return 26
4947
-
4948
- elif encodeTypeName == "DEUTSCHE_POST_IDENTCODE":
4949
- return 27
4950
-
4951
- elif encodeTypeName == "DEUTSCHE_POST_LEITCODE":
4952
- return 28
4953
-
4954
- elif encodeTypeName == "OPC":
4955
- return 29
4956
-
4957
- elif encodeTypeName == "PZN":
4958
- return 30
4959
-
4960
- elif encodeTypeName == "CODE_16_K":
4961
- return 31
4962
-
4963
- elif encodeTypeName == "PHARMACODE":
4964
- return 32
4965
-
4966
- elif encodeTypeName == "DATA_MATRIX":
4967
- return 33
4968
-
4969
- elif encodeTypeName == "QR":
4970
- return 34
4971
-
4972
- elif encodeTypeName == "AZTEC":
4973
- return 35
4974
-
4975
- elif encodeTypeName == "GS_1_AZTEC":
4976
- return 81
4977
-
4978
- elif encodeTypeName == "PDF_417":
4979
- return 36
4980
-
4981
- elif encodeTypeName == "MACRO_PDF_417":
4982
- return 37
4983
-
4984
- elif encodeTypeName == "GS_1_DATA_MATRIX":
4985
- return 48
4986
-
4987
- elif encodeTypeName == "MICRO_PDF_417":
4988
- return 55
4989
-
4990
- elif encodeTypeName == "GS_1_QR":
4991
- return 56
4992
-
4993
- elif encodeTypeName == "MAXI_CODE":
4994
- return 57
4995
-
4996
- elif encodeTypeName == "DOT_CODE":
4997
- return 60
4998
-
4999
- elif encodeTypeName == "AUSTRALIA_POST":
5000
- return 38
5001
-
5002
- elif encodeTypeName == "POSTNET":
5003
- return 39
5004
-
5005
- elif encodeTypeName == "PLANET":
5006
- return 40
5007
-
5008
- elif encodeTypeName == "ONE_CODE":
5009
- return 41
5010
-
5011
- elif encodeTypeName == "RM_4_SCC":
5012
- return 42
5013
-
5014
- elif encodeTypeName == "MAILMARK":
5015
- return 66
5016
-
5017
- elif encodeTypeName == "DATABAR_OMNI_DIRECTIONAL":
5018
- return 43
5019
-
5020
- elif encodeTypeName == "DATABAR_TRUNCATED":
5021
- return 44
5022
-
5023
- elif encodeTypeName == "DATABAR_LIMITED":
5024
- return 45
5025
-
5026
- elif encodeTypeName == "DATABAR_EXPANDED":
5027
- return 46
5028
-
5029
- elif encodeTypeName == "DATABAR_EXPANDED_STACKED":
5030
- return 52
5031
-
5032
- elif encodeTypeName == "DATABAR_STACKED":
5033
- return 53
5034
-
5035
- elif encodeTypeName == "DATABAR_STACKED_OMNI_DIRECTIONAL":
5036
- return 54
5037
-
5038
- elif encodeTypeName == "SINGAPORE_POST":
5039
- return 47
5040
-
5041
- elif encodeTypeName == "AUSTRALIAN_POSTE_PARCEL":
5042
- return 49
5043
-
5044
- elif encodeTypeName == "SWISS_POST_PARCEL":
5045
- return 50
5046
-
5047
- elif encodeTypeName == "PATCH_CODE":
5048
- return 51
5049
-
5050
- elif encodeTypeName == "CODE_32":
5051
- return 58
5052
-
5053
- elif encodeTypeName == "DATA_LOGIC_2_OF_5":
5054
- return 59
5055
-
5056
- elif encodeTypeName == "DUTCH_KIX":
5057
- return 61
5058
-
5059
- elif encodeTypeName == "UPCA_GS_1_CODE_128_COUPON":
5060
- return 62
5061
-
5062
- elif encodeTypeName == "UPCA_GS_1_DATABAR_COUPON":
5063
- return 63
5064
-
5065
- elif encodeTypeName == "CODABLOCK_F":
5066
- return 64
5067
-
5068
- elif encodeTypeName == "GS_1_CODABLOCK_F":
5069
- return 65
5070
-
5071
- elif encodeTypeName == "GS_1_COMPOSITE_BAR":
5072
- return 67
5073
-
5074
- elif encodeTypeName == "HIBC_CODE_39_LIC":
5075
- return 68
5076
-
5077
- elif encodeTypeName == "HIBC_CODE_128_LIC":
5078
- return 69
5079
-
5080
- elif encodeTypeName == "HIBC_AZTEC_LIC":
5081
- return 70
5082
-
5083
- elif encodeTypeName == "HIBC_DATA_MATRIX_LIC":
5084
- return 71
5085
-
5086
- elif encodeTypeName == "HIBCQRLIC":
5087
- return 72
5088
-
5089
- elif encodeTypeName == "HIBC_CODE_39_PAS":
5090
- return 73
5091
-
5092
- elif encodeTypeName == "HIBC_CODE_128_PAS":
5093
- return 74
5094
-
5095
- elif encodeTypeName == "HIBC_AZTEC_PAS":
5096
- return 75
5097
-
5098
- elif encodeTypeName == "HIBC_DATA_MATRIX_PAS":
5099
- return 76
5100
-
5101
- elif encodeTypeName == "HIBCQRPAS":
5102
- return 77
5103
-
5104
- elif encodeTypeName == "GS_1_DOT_CODE":
5105
- return 78
5106
-
5107
- elif encodeTypeName == "HAN_XIN":
5108
- return 79
5109
-
5110
- elif encodeTypeName == "GS_1_HAN_XIN":
5111
- return 80
5112
-
5113
- elif encodeTypeName == "MICRO_QR":
5114
- return 83
5115
-
5116
- elif encodeTypeName == "RECT_MICRO_QR":
5117
- return 84
4895
+ def parse(encodeTypeName: str):
4896
+ """!
4897
+ Returns the corresponding Enum value for the given name.
4898
+ If the name does not exist, raises a ValueError.
4899
+ """
4900
+ try:
4901
+ return EncodeTypes[encodeTypeName]
4902
+ except KeyError:
4903
+ raise ValueError(f"Invalid encode type name: {encodeTypeName}")
5118
4904
 
5119
- else:
5120
- return -1
4905
+ @staticmethod
4906
+ def parseToInt(encodeTypeName):
4907
+ intValue = EncodeTypes.parse(encodeTypeName).value
4908
+ return intValue
5121
4909
 
5122
4910
 
5123
4911
  class PatchFormat(Enum):
@@ -5303,6 +5091,9 @@ class BarCodeImageFormat(Enum):
5303
5091
  ## Specifies the Scalable Vector Graphics (SVG) image format.
5304
5092
  SVG = 7
5305
5093
 
5094
+ ## Specifies the Portable Document Format (PDF) image format.
5095
+ PDF = 8
5096
+
5306
5097
  ##
5307
5098
 
5308
5099
 
@@ -78,7 +78,7 @@ class BarCodeReader(Assist.BaseJavaClass):
78
78
  for area in areas:
79
79
  if area is None or not isinstance(area, Assist.Rectangle):
80
80
  raise Exception('All elements of areas should be instances of Rectangle class')
81
- stringFormattedAreas.append(area.toString())
81
+ stringFormattedAreas.append(area.__str__())
82
82
  else:
83
83
  if not isinstance(areas, Assist.Rectangle):
84
84
  raise Exception('All elements of areas should be instances of Rectangle class')
@@ -1764,16 +1764,6 @@ class MaxiCodeExtendedParameters(Assist.BaseJavaClass):
1764
1764
  """
1765
1765
  return MaxiCodeMode(self.getJavaClass().getMaxiCodeMode())
1766
1766
 
1767
- def setMaxiCodeMode(self, maxiCodeMode: MaxiCodeMode) -> None:
1768
- """!
1769
- Sets a MaxiCode encode mode.
1770
- Default value: Mode4
1771
- """
1772
- if not isinstance(maxiCodeMode, MaxiCodeMode):
1773
- # Processing invalid input
1774
- raise TypeError(f"Expected MaxiCodeMode, got {type(maxiCodeMode).__name__}")
1775
- self.getJavaClass().setMaxiCodeMode(maxiCodeMode.value)
1776
-
1777
1767
  def getMaxiCodeStructuredAppendModeBarcodeId(self) -> int:
1778
1768
  """!
1779
1769
  Gets a MaxiCode barcode id in structured append mode.
@@ -1781,13 +1771,6 @@ class MaxiCodeExtendedParameters(Assist.BaseJavaClass):
1781
1771
  """
1782
1772
  return int(self.getJavaClass().getMaxiCodeStructuredAppendModeBarcodeId())
1783
1773
 
1784
- def setMaxiCodeStructuredAppendModeBarcodeId(self, value: int) -> None:
1785
- """!
1786
- Sets a MaxiCode barcode id in structured append mode.
1787
- Default value: 0
1788
- """
1789
- self.getJavaClass().setMaxiCodeStructuredAppendModeBarcodeId(value)
1790
-
1791
1774
  def getMaxiCodeStructuredAppendModeBarcodesCount(self) -> int:
1792
1775
  """!
1793
1776
  Gets a MaxiCode barcodes count in structured append mode.
@@ -1795,13 +1778,6 @@ class MaxiCodeExtendedParameters(Assist.BaseJavaClass):
1795
1778
  """
1796
1779
  return int(self.getJavaClass().getMaxiCodeStructuredAppendModeBarcodesCount())
1797
1780
 
1798
- def setMaxiCodeStructuredAppendModeBarcodesCount(self, value: int) -> None:
1799
- """!
1800
- Sets a MaxiCode barcodes count in structured append mode.
1801
- Default value: -1
1802
- """
1803
- self.getJavaClass().setMaxiCodeStructuredAppendModeBarcodesCount(value)
1804
-
1805
1781
  def __eq__(self, other: MaxiCodeExtendedParameters) -> bool:
1806
1782
  """!
1807
1783
  Returns a value indicating whether this instance is equal to a specified MaxiCodeExtendedParameters value.
@@ -1814,10 +1790,11 @@ class MaxiCodeExtendedParameters(Assist.BaseJavaClass):
1814
1790
  return NotImplemented
1815
1791
  return bool(self.getJavaClass().equals(other.getJavaClass()))
1816
1792
 
1817
- def getHashCode(self) -> int:
1793
+
1794
+ def __hash__(self) -> int:
1818
1795
  """!
1819
- Returns the hash code for this instance.
1820
- @return: A 32-bit signed integer hash code.
1796
+ Returns the hash code for the current instance.
1797
+ @return A hash code for the current object.
1821
1798
  """
1822
1799
  return int(self.getJavaClass().getHashCode())
1823
1800
 
@@ -2763,4 +2740,4 @@ class BarcodeQualityMode(Enum):
2763
2740
  ## Enables recognition methods for Common(Normal) quality barcodes.</p>
2764
2741
  NORMAL = 1
2765
2742
  ## Enables recognition methods for Low quality barcodes.</p>
2766
- LOW = 2
2743
+ LOW = 2
@@ -3,6 +3,6 @@ import os
3
3
  from asposebarcode import Generation, Recognition, Assist
4
4
 
5
5
  __asposebarcode_dir__ = os.path.dirname(__file__)
6
- __barcode_jar_path__ = __asposebarcode_dir__ + "/jlib/aspose-barcode-python-24.12.jar"
6
+ __barcode_jar_path__ = __asposebarcode_dir__ + "/jlib/aspose-barcode-python-25.2.jar"
7
7
  jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s" % __barcode_jar_path__)
8
8
  __all__ = ['Assist','Recognition','Generation','ComplexBarcode']
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup
2
2
 
3
3
  NAME = "aspose-barcode-for-python-via-java"
4
- VERSION = "24.12.0"
4
+ VERSION = "25.2.0"
5
5
  REQUIRES = ["JPype1==1.4.1"]
6
6
 
7
7
  setup(