Skip to content
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

pdf not support to show Khmer characters #1785

Open
BoyPhanna opened this issue Nov 30, 2024 · 0 comments
Open

pdf not support to show Khmer characters #1785

BoyPhanna opened this issue Nov 30, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@BoyPhanna
Copy link

Describe the bug
When i use pdf package to generate pdf for Khmer language characters it show incorrect.
This is result out put from generate pdf.
សួ​ស្​ដី

To Reproduce

Future generatePdf() async {
final font = await PdfGoogleFonts.khmerRegular();
final pdf = pw.Document();

String arabicText = 'សួស្ដី';

// Convert logical Arabic text to visual order
String visualText = logicalToVisual(arabicText);

pdf.addPage(
pw.Page(
build: (pw.Context context) {
return pw.Center(
child: pw.Column(children: [
pw.Text(
visualText,
style: pw.TextStyle(fontSize: 24, fontFallback: [font]),
),
]));
},
),
);

// Save or print the PDF
final outputFile = File('path_to_output.pdf');
await outputFile.writeAsBytes(await pdf.save());
}



**Screenshots**
![pdf](https://github.com/user-attachments/assets/61e42bc0-dd98-4880-9704-a79bc91f37c4)



**Desktop (please complete the following information):**
 - [ ] iOS
 - [ ] Android
 - [ ] Browser
 - [ ] Windows
 - [ ] Linux

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**

@BoyPhanna BoyPhanna added bug Something isn't working needs triage labels Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant