Comments (3)
I would like you to explain more for people who have zero knowledge of Arabic language, where the points are wrong and where the points are correct.
from gopdf.
i dont have much knowlege for arabic either but i could see discrepency when the multiline text was showing differently in browser and in the pdf
below is how a browser renders the multiline
and this is how it renders in go pdf
code snippet
pdf.Br(20.0) pdf.Text("example 1 with 2 with 3 with 4 and 5 and 6 and 7") pdf.Br(20.0) pdf.Text(reverseString(goarabic.ToGlyph("مثال 1 مع 2 مع 3 مع 4 و5 و6 و7"))) pdf.Br(20.0) rect := &gopdf.Rect{W: 100, H: 100} pdf.MultiCell(rect,"example 1 with 2 with 3 with 4 and 5 and 6 and 7") pdf.Br(20.0) pdf.MultiCell(rect,reverseString(goarabic.ToGlyph("مثال 1 مع 2 مع 3 مع 4 و5 و6 و7")))
from gopdf.
https://github.com/oneplus1000/gopdf/tree/issue_291
I've tried modifying the function MultiCellWithOption. To be able to add new lines RTL style.
(new code in the branch in link above.)
pdf.Br(20.0)
pdf.Text("example 1 with 2 with 3 with 4 and 5 and 6 and 7")
pdf.Br(20.0)
pdf.Text(reverseString(goarabic.ToGlyph("مثال 1 مع 2 مع 3 مع 4 و5 و6 و7")))
pdf.Br(20.0)
rect := &gopdf.Rect{W: 100, H: 100}
pdf.MultiCell(rect, "example 1 with 2 with 3 with 4 and 5 and 6 and 7")
pdf.Br(20.0)
pdf.MultiCellWithOption(rect, reverseString(goarabic.ToGlyph("مثال 1 مع 2 مع 3 مع 4 و5 و6 و7")), gopdf.CellOption{
Align: gopdf.Right,
RtlLineBrk: true, // <-- Make a new line RTL style.
})
pdf.WritePdf("test.pdf")
I would like you to help me. Check if I did it right or wrong.
from gopdf.
Related Issues (20)
- Write Chinese garbled characters HOT 2
- support negative x and y? HOT 2
- Please help me understand why this PDF file was imported with an error message HOT 2
- [Question] Remove or Find & Replace Text HOT 1
- Requires timeout control
- Add MaxPageSize in gopdf.Config or gopdf.PageOption.
- Accessibility Issues with PDF Content Order HOT 3
- html and css layout support HOT 1
- panic en AddChars HOT 1
- 不支持书签的吗? HOT 4
- go1.13不支持 HOT 1
- how set page index? HOT 1
- stream write of content using WriteTo rewrites entire content HOT 1
- pageNumber / TotalPages in each page HOT 3
- HIndi Rendering Problem HOT 4
- Split text cannot handle Unicode HOT 7
- MultiCell* methods don't respect linebreaking rules HOT 2
- Add support for image alt text HOT 1
- Return Font_Size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopdf.