Skip to content

Update PDFObject.php #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dreamingsleeping
Copy link

Type of pull request

[ * ] Bug fix (involves code and configuration changes)

About

A small number of abnormal PDFs return an empty result when calling the getDefaultFont() method. Therefore, either modify the getDefaultFont() method or check the input before entering the getTJUsingFontFallback() method to prevent the program from crashing due to errors when reaching the $font->decodeText() line.
小部分异常PDF,调用getDefaultFont()方法返回为空,所以要么去修改getDefaultFont(),要么在进入getTJUsingFontFallback()方法先判错,防止运行到$font->decodeText()报错卡死。

A small number of abnormal PDFs return an empty result when calling the getDefaultFont() method. Therefore, either modify the getDefaultFont() method or check the input before entering the getTJUsingFontFallback() method to prevent the program from crashing due to errors when reaching the $font->decodeText() line.
小部分异常PDF,调用getDefaultFont()方法返回为空,所以要么去修改getDefaultFont(),要么在进入getTJUsingFontFallback()方法先判错,防止运行到$font->decodeText()报错卡死。
@k00ni
Copy link
Collaborator

k00ni commented Mar 12, 2025

Thanks for the PR.

Could you provide a test which demonstrates that this fix does what you describe? Either use a real "abnormal" PDF or construct an artificial case.

@k00ni
Copy link
Collaborator

k00ni commented Mar 21, 2025

Please respond or this PR will be closed without further notice.

@k00ni k00ni added the stale needs decision label Mar 21, 2025
@k00ni k00ni closed this Mar 26, 2025
@k00ni k00ni removed the stale needs decision label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants