Skip to content

Broken RU encoding in specific document #4

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

Open
ava5412 opened this issue Mar 12, 2025 · 4 comments
Open

Broken RU encoding in specific document #4

ava5412 opened this issue Mar 12, 2025 · 4 comments

Comments

@ava5412
Copy link

ava5412 commented Mar 12, 2025

Steps:
0. get ComPdf Android 2.2.2

  1. open MO issue RU text.pdf
  2. review texts

Actual result
RU letters not displayed
Image

Expected result
like
Image

Note
(probably, it works in ComPdf Android 2.0.1...)

@youna12345
Copy link
Contributor

Hi @ava5412 , sorry for the late reply. We truly appreciate your feedback.

The sample document uses the Times New Roman font series, but since the PDF file does not embed this font and the mobile system does not have it pre-installed, the related text cannot be displayed properly. This issue also exists in version v2.0.1.

To resolve this, you can manually import the Times New Roman font and set it as the default font by referring to the following code. We sincerely apologize for the inconvenience and will continue to optimize font support.

// First, copy the Times New Roman.ttf file to the filesDir directory
String ttfPath = new File(getFilesDir(), "Times New Roman.ttf").getAbsolutePath();  
CPDFSdk.setDefaultFontPath(this, ttfPath);  
CPDFSdk.useDefaultFont(true);  
CPDFSdk.init(this, "your compdfkit license", true);

@youna12345
Copy link
Contributor

Hi @ava5412 , I would like to ask if there is a solution to your problem. If it is solved, I will close the issue.

@Rumyantsev-office
Copy link

Hi @youna12345
This solution creates other problems:

  1. Times New Roman font cannot be used freely due to license.
  2. After applying these solutions, compatibility with PDF test files is broken.
  3. The file cannot be fully saved for further printing using saveFontSubset, some lines are lost.

@youna12345
Copy link
Contributor

Hi @ava5412 , sorry for the late reply. We truly appreciate your feedback.
We are investigating this issue and will contact you as soon as there is progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants