REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.64 KB
Close
/proc/thread-self/root/opt/alt/libharu/usr/share/libharu/bindings/ruby/demo/arc_demo.rb
Text
Base64
# # << Haru Free PDF Library 2.0.2 >> -- arc_demo.rb # # http://libharu.org/ # # Copyright (c) 1999-2006 Takeshi Kanno # # Permission to use, copy, modify, distribute and sell this software # and its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice appear in all copies and # that both that copyright notice and this permission notice appear # in supporting documentation. # It is provided "as is" without express or implied warranty. # require "hpdf" pdf = HPDFDoc.new # add a new page object. # page = pdf.add_page page.set_height(220) page.set_width(200) # draw pie chart # # A: 45% Red # B: 25% Blue # C: 15% green # D: other yellow # # A # page.set_rgb_fill(1.0, 0, 0) page.move_to(100, 100) page.line_to(100, 180) page.arc(100, 100, 80, 0, 360 * 0.45) pos = page.get_current_pos page.line_to(100, 100) page.fill # B # page.set_rgb_fill(0, 0, 1.0) page.move_to(100, 100) page.line_to(pos[0], pos[1]) page.arc(100, 100, 80, 360 * 0.45, 360 * 0.7) pos = page.get_current_pos page.line_to(100, 100) page.fill # C # page.set_rgb_fill(0, 1.0, 0) page.move_to(100, 100) page.line_to(pos[0], pos[1]) page.arc(100, 100, 80, 360 * 0.7, 360 * 0.85) pos = page.get_current_pos page.line_to(100, 100) page.fill # D # page.set_rgb_fill(1.0, 1.0, 0) page.move_to(100, 100) page.line_to(pos[0], pos[1]) page.arc(100, 100, 80, 360 * 0.85, 360) pos = page.get_current_pos page.line_to(100, 100) page.fill # draw center circle # page.set_gray_stroke(0) page.set_gray_fill(1) page.circle(100, 100, 30) page.fill pdf.save_to_file($0 + ".pdf")
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
arc_demo.rb
1.64 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
demo.rb
1.97 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
encryption.rb
1.04 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ext_gstater_demo.rb
4.48 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
font_demo.rb
1.73 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jpfont_demo.rb
3.47 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
line_demo.rb
6.30 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
slide_show_demo.rb
4.42 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
text_demo2.rb
4.08 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ttfont_demo.rb
2.46 KB
lrw-r--r--
2025-03-11 14:13:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).