MacOS developers, rejoice! Aspose.OCR for Python via .NET 24.6.0 is here, and it provides exciting new features for your Python OCR applications running on macOS ARM64.
Extracting important information, like names, birth dates, and passport numbers, directly from US passport images is convenient with the new Country.USA
recognition setting in the latest Python OCR API version.
Code Example:
# Instantiate Aspose.OCR API
api = ocr.AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("us_passport.png")
# Enable US passport recognition
settings = ocr.PassportRecognitionSettings()
settings.country = ocr.Country.USA
# Extract passport details
result = api.recognize_passport(input, settings)
details = result[0].get_keywords()
for detail in details:
print(detail.key)
print(detail.value.text_in_line)
Source*
Easily Embed Custom Fonts in PDF Documents
Embedding custom fonts into your PDF documents enables maintaining consistency. This feature is now supported, and you can incorporate it into your Python applications on the macOS M1 platform. Here is how to use this functionality in Python.
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.PDF)
input.add("source.pdf")
# Recognize the image
results = api.recognize(input)
# Save recognition result
save_multipage_document("result.pdf", SaveFormat.PDF_NO_IMG, results, "fonts/AdobeMingStd-Light.otf")
Source*
For more information about the public API changes and deprecations in this release, please visit the release notes page.
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.OCR for Python via .NET 24.6.0 Release Notes.