Defect #61 » pdf_0x5c_char_handling.patch
vendor/plugins/rfpdf/lib/rfpdf/fpdf.rb (working copy) | ||
---|---|---|
642 | 642 | |
643 | 643 |
def Text(x, y, txt) |
644 | 644 |
# Output a string |
645 |
txt.gsub!(')', '\\)') |
|
646 |
txt.gsub!('(', '\\(') |
|
647 |
txt.gsub!('\\', '\\\\') |
|
648 |
s=sprintf('BT %.2f %.2f Td (%s) Tj ET',x*@k,(@h-y)*@k,txt); |
|
645 |
s=sprintf('BT %.2f %.2f Td (%s) Tj ET',x*@k,(@h-y)*@k, escape(txt)); |
|
649 | 646 |
s=s+' '+dounderline(x,y,txt) if @underline and txt!='' |
650 | 647 |
s='q '+@TextColor+' '+s+' Q' if @ColorFlag |
651 | 648 |
out(s) |
... | ... | |
719 | 716 |
else |
720 | 717 |
dx=@cMargin |
721 | 718 |
end |
722 |
txt = txt.gsub(')', '\\)') |
|
723 |
txt.gsub!('(', '\\(') |
|
724 |
txt.gsub!('\\', '\\\\') |
|
725 | 719 |
if @ColorFlag |
726 | 720 |
s=s+'q '+@TextColor+' ' |
727 | 721 |
end |
728 | 722 |
s=s+sprintf('BT %.2f %.2f Td (%s) Tj ET', |
729 |
(@x+dx)*@k,(@h-(@y+0.5*h+0.3*@FontSize))*@k,txt)
|
|
723 |
(@x+dx)*@k,(@h-(@y+0.5*h+0.3*@FontSize))*@k,escape(txt))
|
|
730 | 724 |
s=s+' '+dounderline(@x+dx,@y+0.5*h+0.3*@FontSize,txt) if @underline |
731 | 725 |
s=s+' Q' if @ColorFlag |
732 | 726 |
if link and link != '' |
... | ... | |
1538 | 1532 | |
1539 | 1533 |
def escape(s) |
1540 | 1534 |
# Add \ before \, ( and ) |
1541 |
s.gsub('\\','\\\\').gsub('(','\\(').gsub(')','\\)') |
|
1535 |
s.gsub('\\','\\\\\\').gsub('(','\\(').gsub(')','\\)')
|
|
1542 | 1536 |
end |
1543 | 1537 | |
1544 | 1538 |
def putstream(s) |
lib/redmine/export/pdf.rb (working copy) | ||
---|---|---|
163 | 163 |
end |
164 | 164 |
txt = txtar |
165 | 165 |
end |
166 |
# 0x5c char handling |
|
167 |
txt.gsub(/\\/, "\\\\\\\\") |
|
168 | 166 |
end |
169 | 167 | |
170 | 168 |
def RDMCell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='') |
- « Previous
- 1
- …
- 44
- 45
- 46
- Next »