├── .gitignore ├── README-ja.md ├── README.md ├── barcode ├── Gemfile ├── README.md ├── barcode.pdf ├── barcode.rb └── barcode.tlf ├── chart ├── Gemfile ├── README.md ├── chart.pdf ├── chart.rb └── chart.tlf ├── estimate-ja ├── Gemfile ├── README.md ├── estimate.pdf ├── estimate.rb └── estimate.tlf ├── estimate ├── Gemfile ├── README.md ├── estimate.pdf ├── estimate.rb └── estimate.tlf ├── eudc ├── Gemfile ├── README.md ├── eudc.pdf ├── eudc.rb ├── eudc.tlf └── eudc.ttf ├── event ├── Gemfile ├── README.md ├── event.pdf ├── event.rb └── event.tlf ├── image-block ├── Gemfile ├── README.md ├── file │ └── image.png ├── image_block.pdf ├── image_block.rb └── image_block.tlf ├── list ├── README.md ├── advanced │ ├── Gemfile │ ├── README.md │ ├── advanced_list.pdf │ ├── advanced_list.rb │ └── advanced_list.tlf ├── basic │ ├── Gemfile │ ├── README.md │ ├── basic_list.pdf │ ├── basic_list.rb │ └── basic_list.tlf └── group-rows │ ├── Gemfile │ ├── README.md │ ├── group_rows.pdf │ ├── group_rows.png │ ├── group_rows.rb │ └── group_rows.tlf ├── multiple-layout ├── Gemfile ├── README.md ├── multiple_layout.pdf ├── multiple_layout.rb ├── multiple_layout_back_cover.tlf ├── multiple_layout_cover.tlf └── multiple_layout_default.tlf ├── permission ├── Gemfile ├── README.md ├── permission.pdf ├── permission.rb └── permission.tlf └── text-block ├── Gemfile ├── README.md ├── text_block.pdf ├── text_block.rb └── text_block.tlf /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | result.pdf 3 | -------------------------------------------------------------------------------- /README-ja.md: -------------------------------------------------------------------------------- 1 | # Thinreports Examples 2 | 3 | The official examples for Thinreports. 4 | 5 | [English »](https://github.com/thinreports/thinreports-examples/blob/master/README.md) 6 | 7 | ## Features 8 | 9 | ### [TextBlock tool](https://github.com/thinreports/thinreports-examples/tree/master/text-block) 10 | 11 | [Generator](http://www.thinreports.org/) から動的な値を挿入可能なテキストブロックツールの使い方サンプルです。基本的な使い方から、日付時刻書式や数値書式、字詰め書式などの簡易書式についても解説しています。 12 | 13 | ### [ImageBlock tool](https://github.com/thinreports/thinreports-examples/tree/master/image-block) 14 | 15 | [Generator](http://www.thinreports.org/) から動的な画像を挿入可能なイメージブロックツールの使い方サンプルです。 16 | 17 | ### [Use external character](https://github.com/thinreports/thinreports-examples/tree/master/eudc) 18 | 19 | `0.7.0` より、PDFに外字を表示・埋め込むことが可能になりました。そのコード例と外字フォントのセットアップ方法について解説しています。 20 | 21 | ### [Use Event](https://github.com/thinreports/thinreports-examples/tree/master/event) 22 | 23 | Thinreportsでは、帳票の生成ユーティリティとして「簡易イベントモデル」を提供しています。イベントを使うことにより、共通の処理を一元化したり、総ページ数の描画やさまざまな使い方が可能です。 24 | 25 | ### [Use multiple layouts](https://github.com/thinreports/thinreports-examples/tree/master/multiple-layout) 26 | 27 | 用紙サイズの異なる帳票やレイアウトの異なる帳票などを組み合わせて一つの帳票を作成する方法を解説しています。 28 | 29 | ### [List](https://github.com/thinreports/thinreports-examples/tree/master/list) 30 | 31 | Thinreportsでは、一覧表を一つの機能として提供しており最大行数を超えた場合の自動改ページ機能もサポートしています。基本的な一覧表からページフッター/フッターを使った高度な一覧表について解説しています。 32 | 33 | ### [PDF Security](https://github.com/thinreports/thinreports-examples/tree/master/permission) 34 | 35 | 生成するPDFの暗号化/パスワードロック/操作制限等のセキュリティを設定する方法について解説しています。 36 | 37 | ## Usage Examples 38 | 39 | ### [Rails Example](https://github.com/thinreports/thinreports-rails-example) 40 | 41 | RailsとThinreportsを使った簡単なタスク管理アプリケーションのソースコードです。 [thinreports-rails](https://github.com/takeshinoda/thinreports-rails) も使っています。 42 | 43 | ### [Embed graph using GoogleChartAPI](https://github.com/thinreports/thinreports-examples/tree/master/chart) 44 | 45 | `0.7.0` の新機能「イメージブロック」と [Google Chart API](https://developers.google.com/chart/) を使って各種グラフやQRコードを埋め込む例です。 46 | 47 | ### [Embed barcode](https://github.com/thinreports/thinreports-examples/tree/master/barcode) 48 | 49 | `0.7.0` の新機能「イメージブロック」とRubyのバーコード生成ライブラリ [barby](http://toreto.re/barby/) を使って、基本的なバーコードを動的に生成する例です。 50 | 51 | ### [Estimate](https://github.com/thinreports/thinreports-examples/tree/master/estimate-ja) 52 | 53 | ヘッダー部と一覧部を持つ、一般的な見積書のサンプルです。 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Thinreports Examples 2 | 3 | The official examples for Thinreports. 4 | 5 | [日本語版 »](https://github.com/thinreports/thinreports-examples/blob/master/README-ja.md) 6 | 7 | ## Features 8 | 9 | ### [TextBlock tool](https://github.com/thinreports/thinreports-examples/tree/master/text-block) 10 | 11 | Here are some sample codes on how to use the [Generator](http://www.thinreports.org/) to insert values dynamically using the text block tool. The samples include basic usage, date and number formatting and text formatting. 12 | 13 | ### [ImageBlock tool](https://github.com/thinreports/thinreports-examples/tree/master/image-block) 14 | 15 | Here are some sample codes on how to use the [Generator](http://www.thinreports.org/) to insert images dynamically using the image block tool. 16 | 17 | ### [Use Event](https://github.com/thinreports/thinreports-examples/tree/master/event) 18 | 19 | Thinreports is a utility that offers a “simple event model” for generating reports. By using events, full reports can be generated more efficiently by centralizing and sharing common functionalities. 20 | 21 | ### [Use multiple layouts](https://github.com/thinreports/thinreports-examples/tree/master/multiple-layout) 22 | 23 | Methods for generating a single report with different page sizes and different layouts is outlined here. 24 | 25 | ### [List](https://github.com/thinreports/thinreports-examples/tree/master/list) 26 | 27 | Thinreports offers list layout functions, which handles page breaks automatically when content overflows the page. Methods for generating a simple list document with a footer is outlined. 28 | 29 | ### [PDF Security](https://github.com/thinreports/thinreports-examples/tree/master/permission) 30 | 31 | Methods for encrypting, setting password locks and setting security and restrictions for the generated PDF document is outlined. 32 | 33 | ## Usage Examples 34 | 35 | ### [Rails Example](https://github.com/thinreports/thinreports-rails-example) 36 | 37 | The links provide the source code to a simple task management application using Rails and Thinreports. The [thinreports-rails](https://github.com/takeshinoda/thinreports-rails) gem is used in these projects. 38 | 39 | ### [Embed graph using GoogleChartAPI](https://github.com/thinreports/thinreports-examples/tree/master/chart) 40 | 41 | Examples for using the “Image Block” functionality of `0.7.0` and [Google Chart API](https://developers.google.com/chart/) in order to insert graphs and QR codes into the report. 42 | 43 | ### [Embed barcode](https://github.com/thinreports/thinreports-examples/tree/master/barcode) 44 | 45 | Examples for using the “Image Block” functionality of `0.7.0` and the barcode generation library [barby](http://toreto.re/barby/) to dynamically insert simple bar codes into the report. 46 | 47 | ### [Estimate](https://github.com/thinreports/thinreports-examples/tree/master/estimate) 48 | 49 | Example of a typical estimate form. 50 | -------------------------------------------------------------------------------- /barcode/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | gem 'barby' 5 | gem 'rqrcode' 6 | gem 'chunky_png' 7 | -------------------------------------------------------------------------------- /barcode/README.md: -------------------------------------------------------------------------------- 1 | # Barcode - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `barcode.rb`: 10 | 11 | % bundle exec ruby barcode.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * Runtime dependencies 19 | * thinreports 0.9.0 20 | * Barby 21 | * rQRCode 22 | * ChunkyPNG 23 | 24 | ## Tips 25 | 26 | ### Adjust size of the barcode (バーコードのサイズを調整する) 27 | 28 | See this [gist](https://gist.github.com/hidakatsuya/6362423) (Japanese). 29 | -------------------------------------------------------------------------------- /barcode/barcode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/barcode/barcode.pdf -------------------------------------------------------------------------------- /barcode/barcode.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | require 'barby/barcode/ean_13' 7 | require 'barby/barcode/ean_8' 8 | require 'barby/barcode/qr_code' 9 | require 'barby/outputter/png_outputter' 10 | 11 | def barcode(type, data, png_opts = {}) 12 | code = case type 13 | when :ean_13 14 | Barby::EAN13.new(data) 15 | when :ean_8 16 | Barby::EAN8.new(data) 17 | when :qr_code 18 | Barby::QrCode.new(data) 19 | end 20 | StringIO.new(code.to_png(png_opts)) 21 | end 22 | 23 | Thinreports::Report.generate filename: 'result.pdf', layout: 'barcode' do 24 | start_new_page 25 | 26 | # JAN13 27 | page.item(:jan_13).src(barcode(:ean_13, '491234567890')) 28 | 29 | # JAN8 30 | page.item(:jan_8).src(barcode(:ean_8, '4512345')) 31 | 32 | # QR Code 33 | page.item(:qr_code).src(barcode( 34 | :qr_code, 'http://www.thinreports.org/', ydim: 5, xdim: 5)) 35 | end 36 | -------------------------------------------------------------------------------- /barcode/barcode.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 134.4, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: Barcode" 30 | ] 31 | }, 32 | { 33 | "id": "", 34 | "type": "text", 35 | "display": true, 36 | "description": "", 37 | "x": 20, 38 | "y": 70, 39 | "width": 200, 40 | "height": 21, 41 | "style": { 42 | "font-family": [ 43 | "Helvetica" 44 | ], 45 | "font-size": 18, 46 | "color": "#000000", 47 | "text-align": "left", 48 | "vertical-align": "top", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [] 53 | }, 54 | "texts": [ 55 | "JAN-13(EAN-13)" 56 | ] 57 | }, 58 | { 59 | "id": "jan_13", 60 | "type": "image-block", 61 | "display": true, 62 | "description": "", 63 | "x": 20, 64 | "y": 100, 65 | "width": 300, 66 | "height": 100, 67 | "style": { 68 | "position-x": "center", 69 | "position-y": "top" 70 | } 71 | }, 72 | { 73 | "id": "", 74 | "type": "text", 75 | "display": true, 76 | "description": "", 77 | "x": 20, 78 | "y": 225, 79 | "width": 200, 80 | "height": 21, 81 | "style": { 82 | "font-family": [ 83 | "Helvetica" 84 | ], 85 | "font-size": 18, 86 | "color": "#000000", 87 | "text-align": "left", 88 | "vertical-align": "top", 89 | "line-height": "", 90 | "line-height-ratio": "", 91 | "letter-spacing": "", 92 | "font-style": [] 93 | }, 94 | "texts": [ 95 | "JAN-8(EAN-8)" 96 | ] 97 | }, 98 | { 99 | "id": "jan_8", 100 | "type": "image-block", 101 | "display": true, 102 | "description": "", 103 | "x": 20, 104 | "y": 255, 105 | "width": 300, 106 | "height": 100, 107 | "style": { 108 | "position-x": "center", 109 | "position-y": "top" 110 | } 111 | }, 112 | { 113 | "id": "", 114 | "type": "text", 115 | "display": true, 116 | "description": "", 117 | "x": 20, 118 | "y": 380, 119 | "width": 200, 120 | "height": 21, 121 | "style": { 122 | "font-family": [ 123 | "Helvetica" 124 | ], 125 | "font-size": 18, 126 | "color": "#000000", 127 | "text-align": "left", 128 | "vertical-align": "top", 129 | "line-height": "", 130 | "line-height-ratio": "", 131 | "letter-spacing": "", 132 | "font-style": [] 133 | }, 134 | "texts": [ 135 | "QR Code" 136 | ] 137 | }, 138 | { 139 | "id": "qr_code", 140 | "type": "image-block", 141 | "display": true, 142 | "description": "", 143 | "x": 20, 144 | "y": 410, 145 | "width": 300, 146 | "height": 300, 147 | "style": { 148 | "position-x": "center", 149 | "position-y": "top" 150 | } 151 | } 152 | ], 153 | "state": { 154 | "layout-guides": [] 155 | }, 156 | "title": "Example Barcode", 157 | "report": { 158 | "paper-type": "A4", 159 | "orientation": "portrait", 160 | "margin": [ 161 | 20, 162 | 20, 163 | 20, 164 | 20 165 | ] 166 | } 167 | } -------------------------------------------------------------------------------- /chart/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /chart/README.md: -------------------------------------------------------------------------------- 1 | # Chart using Google Chart API - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `chart.rb`: 10 | 11 | % bundle exec ruby chart.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /chart/chart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/chart/chart.pdf -------------------------------------------------------------------------------- /chart/chart.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | require 'open-uri' 5 | Bundler.require 6 | 7 | def open_chart(*params) 8 | URI.open('http://chart.googleapis.com/chart?' + URI.encode(params.join('&'))) 9 | end 10 | 11 | report = Thinreports::Report.new layout: 'chart.tlf' 12 | report.start_new_page do 13 | # Basic Bar Chart 14 | bar_chart_png = open_chart('cht=bhs', 'chs=240x140', 'chco=4d89f9,c6d9fd', 15 | 'chd=t:10,50,60,80,40|50,60,100,40,20', 'chds=0,160') 16 | item(:bar_chart).src(bar_chart_png) 17 | 18 | # Basic Line Chart 19 | line_chart_png = open_chart('cht=lc', 'chs=240x140', 20 | 'chd=t:40,60,60,45,47,75,70,72') 21 | item(:line_chart).value(line_chart_png) 22 | 23 | # Basic Pie and Radar Chart 24 | pie_chart_png = open_chart('cht=p', 'chs=240x140', 25 | 'chdl=30°|40°|50°|60°', 'chd=s:Uf9a', 'chl=Jan|Feb|Mar|Apr') 26 | radar_chart_png = open_chart('cht=r', 'chs=140x140', 27 | 'chm=B,FF990080,0,0,5', 'chls=3,0,0', 'chxt=x,y', 28 | 'chd=t:80,30,99,60,50,20', 29 | 'chxl=0:|Str|Vit|Agi|Dex|Int|Lux|1:|||||') 30 | values(pie_chart: pie_chart_png, radar_chart: radar_chart_png) 31 | 32 | # 3D-Pie Chart 33 | pie_3d_chart_png = open_chart('cht=p3', 'chs=250x140', 34 | 'chco=0092b9,86ad00,f2b705,bc3603', 35 | 'chd=t:21,55.3,18,5.7', 36 | 'chl=A|B|C|D') 37 | item(:pie_3d_chart).src(pie_3d_chart_png) 38 | 39 | # QR Code 40 | qr_code_png = open_chart('cht=qr', 'chs=150x150', 41 | 'chl=http://www.thinreports.org/') 42 | item(:qr_code).src(qr_code_png) 43 | end 44 | 45 | report.generate filename: 'result.pdf' 46 | -------------------------------------------------------------------------------- /chart/chart.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 207.1, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: Google Chart API" 30 | ] 31 | }, 32 | { 33 | "id": "", 34 | "type": "text", 35 | "display": true, 36 | "description": "", 37 | "x": 20, 38 | "y": 56, 39 | "width": 555.2, 40 | "height": 26.2, 41 | "style": { 42 | "font-family": [ 43 | "Times New Roman" 44 | ], 45 | "font-size": 24, 46 | "color": "#000000", 47 | "text-align": "left", 48 | "vertical-align": "top", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [] 53 | }, 54 | "texts": [ 55 | "Basic Charts" 56 | ] 57 | }, 58 | { 59 | "id": "", 60 | "type": "line", 61 | "display": true, 62 | "description": "", 63 | "style": { 64 | "border-color": "#7f7f7f", 65 | "border-width": 2, 66 | "border-style": "solid" 67 | }, 68 | "x1": 20, 69 | "y1": 80, 70 | "x2": 575.2, 71 | "y2": 80 72 | }, 73 | { 74 | "id": "bar_chart", 75 | "type": "image-block", 76 | "display": true, 77 | "description": "", 78 | "x": 38, 79 | "y": 100, 80 | "width": 250, 81 | "height": 150, 82 | "style": { 83 | "position-x": "center", 84 | "position-y": "middle" 85 | } 86 | }, 87 | { 88 | "id": "line_chart", 89 | "type": "image-block", 90 | "display": true, 91 | "description": "", 92 | "x": 309.1, 93 | "y": 100, 94 | "width": 250, 95 | "height": 150, 96 | "style": { 97 | "position-x": "center", 98 | "position-y": "middle" 99 | } 100 | }, 101 | { 102 | "id": "pie_chart", 103 | "type": "image-block", 104 | "display": true, 105 | "description": "", 106 | "x": 38, 107 | "y": 264, 108 | "width": 250, 109 | "height": 150, 110 | "style": { 111 | "position-x": "center", 112 | "position-y": "middle" 113 | } 114 | }, 115 | { 116 | "id": "", 117 | "type": "text", 118 | "display": true, 119 | "description": "", 120 | "x": 20, 121 | "y": 430, 122 | "width": 555.2, 123 | "height": 26.2, 124 | "style": { 125 | "font-family": [ 126 | "Times New Roman" 127 | ], 128 | "font-size": 24, 129 | "color": "#000000", 130 | "text-align": "left", 131 | "vertical-align": "top", 132 | "line-height": "", 133 | "line-height-ratio": "", 134 | "letter-spacing": "", 135 | "font-style": [] 136 | }, 137 | "texts": [ 138 | "Advanced Charts" 139 | ] 140 | }, 141 | { 142 | "id": "", 143 | "type": "line", 144 | "display": true, 145 | "description": "", 146 | "style": { 147 | "border-color": "#7f7f7f", 148 | "border-width": 2, 149 | "border-style": "solid" 150 | }, 151 | "x1": 20, 152 | "y1": 455, 153 | "x2": 575.2, 154 | "y2": 455 155 | }, 156 | { 157 | "id": "pie_3d_chart", 158 | "type": "image-block", 159 | "display": true, 160 | "description": "", 161 | "x": 35, 162 | "y": 475, 163 | "width": 250, 164 | "height": 150, 165 | "style": { 166 | "position-x": "center", 167 | "position-y": "middle" 168 | } 169 | }, 170 | { 171 | "id": "qr_code", 172 | "type": "image-block", 173 | "display": true, 174 | "description": "", 175 | "x": 306.1, 176 | "y": 475, 177 | "width": 250, 178 | "height": 150, 179 | "style": { 180 | "position-x": "center", 181 | "position-y": "middle" 182 | } 183 | }, 184 | { 185 | "id": "radar_chart", 186 | "type": "image-block", 187 | "display": true, 188 | "description": "", 189 | "x": 309, 190 | "y": 264, 191 | "width": 250, 192 | "height": 150, 193 | "style": { 194 | "position-x": "center", 195 | "position-y": "middle" 196 | } 197 | } 198 | ], 199 | "state": { 200 | "layout-guides": [] 201 | }, 202 | "title": "Example: Graphs", 203 | "report": { 204 | "paper-type": "A4", 205 | "orientation": "portrait", 206 | "margin": [ 207 | 20, 208 | 20, 209 | 20, 210 | 20 211 | ] 212 | } 213 | } -------------------------------------------------------------------------------- /estimate-ja/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /estimate-ja/README.md: -------------------------------------------------------------------------------- 1 | # Sample Estimate (ja) - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `estimate.rb`: 10 | 11 | % bundle exec ruby estimate.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /estimate-ja/estimate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/estimate-ja/estimate.pdf -------------------------------------------------------------------------------- /estimate-ja/estimate.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | # Prepare sample data. 7 | data = [] 8 | 9 | # Sample Data 1 10 | d1 = {:no => 1234, 11 | :created_d => Time.now, 12 | :customer => '㈱テストコム', 13 | :title => 'PC及び関連機器ご購入について', 14 | :price => 1000000, 15 | :tax => 50000, 16 | :total_price => 1050000, 17 | :details => []} 18 | d1[:details] << {:no => 1, 19 | :title => 'ノートパソコン', 20 | :amount => 4, 21 | :unit_price => 200000, 22 | :price => 800000} 23 | d1[:details] << {:no => 2, 24 | :title => 'プリンタ', 25 | :amount => 2, 26 | :unit_price => 100000, 27 | :price => 200000, 28 | :note => 'トナー×2本含む'} 29 | 30 | # Sample Data 2 31 | d2 = {:no => 3456, 32 | :created_d => '2011年1月1日', 33 | :customer => '㈱○○○○', 34 | :title => '□□□□□□□□□', 35 | :price => 100000, 36 | :tax => 5000, 37 | :total_price => 105000, 38 | :note => '△' * 40, 39 | :details => []} 40 | 20.times do |t| 41 | d2[:details] << {:no => t + 1, 42 | :title => '×××××××××', 43 | :amount => 1, 44 | :unit_price => 5000, 45 | :price => 5000} 46 | end 47 | 48 | data << d1 << d2 49 | 50 | # Generate reports. 51 | report = Thinreports::Report.new layout: 'estimate.tlf' 52 | 53 | data.each do |header| 54 | report.start_new_page 55 | 56 | # Set header datas. 57 | report.page.values(no: header[:no], 58 | created_d: header[:created_d], 59 | customer: header[:customer], 60 | title: header[:title], 61 | price: header[:price], 62 | tax: header[:tax], 63 | total_price: header[:total_price], 64 | note: header[:note]) 65 | 66 | report.page.list do |list| 67 | price = 0 68 | total_price = 0 69 | 70 | # Dispatch at list-page-footer insertion. 71 | list.on_page_footer_insert do |page_footer| 72 | # Set price. 73 | page_footer.item(:price).value(price) 74 | # Initialize price to 0. 75 | price = 0 76 | end 77 | 78 | # Dispatch at list-footer insertion. 79 | list.on_footer_insert do |footer| 80 | # Set total_price. 81 | footer.item(:price).value(total_price) 82 | end 83 | 84 | header[:details].each do |detail| 85 | # Add an row of list. 86 | list.add_row(detail) 87 | 88 | # Calculate the amount. 89 | price += detail[:price] 90 | total_price += detail[:price] 91 | end 92 | end 93 | end 94 | 95 | report.generate filename: 'result.pdf' 96 | -------------------------------------------------------------------------------- /estimate/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /estimate/README.md: -------------------------------------------------------------------------------- 1 | # Sample Estimate - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `estimate.rb`: 10 | 11 | % bundle exec ruby estimate.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /estimate/estimate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/estimate/estimate.pdf -------------------------------------------------------------------------------- /estimate/estimate.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | # Prepare sample data. 7 | data = [] 8 | 9 | my_info = { 10 | my_name: 'Matsukei Co., Ltd.', 11 | my_address: '735-211, Nogifukutomicho, Matsue-shi, Shimane, Japan', 12 | my_post_code: '690-0046', 13 | my_tel_number: '+81-854-32-1616', 14 | my_fax_number: '+81-852-32-1629' 15 | } 16 | 17 | # Sample Data 1 18 | d1 = { 19 | no: 1234, 20 | issued_date: Time.now, 21 | customer_name: 'Sample1 Co., Ltd.', 22 | customer_address: '1234, Sample1cho, Sample1-shi, Shimane, Japan', 23 | customer_post_code: '123-4567', 24 | details: [], 25 | notes: 'Estimate exsample1!' 26 | } 27 | 28 | d1.merge!(my_info) 29 | 30 | d1[:details] << { 31 | no: 1, 32 | name: 'iPon6', 33 | rate: 199, 34 | qty: 1, 35 | amount: 199 36 | } 37 | d1[:details] << { 38 | no: 2, 39 | name: 'PearBook Pro 13-inch: 2.9GHz', 40 | rate: 1499, 41 | qty: 2, 42 | amount: 2998 43 | } 44 | 45 | # Sample Data 2 46 | d2 = { 47 | no: 3456, 48 | issued_date: Time.now, 49 | customer_name: 'Sample2 Co., Ltd.', 50 | customer_address: '3456, Sample2cho, Sample2-shi, Shimane, Japan', 51 | customer_post_code: '345-6789', 52 | details: [], 53 | notes: 'Estimate exsample2!' 54 | } 55 | 56 | d2.merge!(my_info) 57 | 58 | 35.times do |t| 59 | d2[:details] << { 60 | no: t + 1, 61 | name: 'xxxxxxxxxx', 62 | rate: 500, 63 | qty: 1, 64 | amount: 500 65 | } 66 | end 67 | 68 | data << d1 << d2 69 | 70 | # Generate reports. 71 | report = Thinreports::Report.new layout: 'estimate.tlf' 72 | 73 | data.each do |header| 74 | report.start_new_page 75 | 76 | # Set header datas. 77 | report.page.values(no: header[:no], 78 | issued_date: header[:issued_date], 79 | customer_name: header[:customer_name], 80 | customer_address: header[:customer_address], 81 | customer_post_code: header[:customer_post_code], 82 | my_name: header[:my_name], 83 | my_address: header[:my_address], 84 | my_post_code: header[:my_post_code], 85 | my_tel_number: header[:my_tel_number], 86 | my_fax_number: header[:my_fax_number], 87 | notes: header[:notes]) 88 | 89 | report.page.list do |list| 90 | sub_total = 0 91 | total = 0 92 | 93 | # Dispatch at list-page-footer insertion. 94 | list.on_page_footer_insert do |page_footer| 95 | # Set subtotal. 96 | page_footer.item(:sub_total).value(sub_total) 97 | # Initialize subtotal to 0. 98 | sub_total = 0 99 | end 100 | 101 | # Dispatch at list-footer insertion. 102 | list.on_footer_insert do |footer| 103 | # Set total. 104 | footer.item(:total).value(total) 105 | end 106 | 107 | header[:details].each do |detail| 108 | # Add an row of list. 109 | list.add_row(detail) 110 | 111 | # Calculate the amount. 112 | sub_total += detail[:amount] 113 | total += detail[:amount] 114 | end 115 | end 116 | end 117 | 118 | report.generate filename: 'result.pdf' 119 | -------------------------------------------------------------------------------- /estimate/estimate.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "line", 7 | "display": true, 8 | "description": "", 9 | "style": { 10 | "border-color": "#a5a5a5", 11 | "border-width": 3, 12 | "border-style": "solid" 13 | }, 14 | "x1": 20, 15 | "y1": 55, 16 | "x2": 575.2, 17 | "y2": 55 18 | }, 19 | { 20 | "id": "", 21 | "type": "line", 22 | "display": true, 23 | "description": "", 24 | "style": { 25 | "border-color": "#a5a5a5", 26 | "border-width": 3, 27 | "border-style": "solid" 28 | }, 29 | "x1": 20, 30 | "y1": 84, 31 | "x2": 575.2, 32 | "y2": 84 33 | }, 34 | { 35 | "id": "", 36 | "type": "text", 37 | "display": true, 38 | "description": "", 39 | "x": 20, 40 | "y": 55, 41 | "width": 555.2, 42 | "height": 30, 43 | "style": { 44 | "font-family": [ 45 | "IPAGothic" 46 | ], 47 | "font-size": 24, 48 | "color": "#7f7f7f", 49 | "text-align": "center", 50 | "vertical-align": "middle", 51 | "line-height": "", 52 | "line-height-ratio": "", 53 | "letter-spacing": 0, 54 | "font-style": [ 55 | "bold" 56 | ] 57 | }, 58 | "texts": [ 59 | "ESTIMATE" 60 | ] 61 | }, 62 | { 63 | "id": "customer_name", 64 | "type": "text-block", 65 | "display": true, 66 | "description": "", 67 | "x": 24, 68 | "y": 113, 69 | "width": 244, 70 | "height": 16, 71 | "style": { 72 | "font-family": [ 73 | "Helvetica" 74 | ], 75 | "font-size": 16, 76 | "color": "#7f7f7f", 77 | "text-align": "left", 78 | "vertical-align": "top", 79 | "line-height": "", 80 | "line-height-ratio": "", 81 | "letter-spacing": "", 82 | "font-style": [], 83 | "overflow": "truncate", 84 | "word-wrap": "none" 85 | }, 86 | "reference-id": "", 87 | "value": "", 88 | "multiple-line": false, 89 | "format": { 90 | "base": "", 91 | "type": "" 92 | } 93 | }, 94 | { 95 | "id": "my_name", 96 | "type": "text-block", 97 | "display": true, 98 | "description": "", 99 | "x": 329, 100 | "y": 100, 101 | "width": 242, 102 | "height": 20, 103 | "style": { 104 | "font-family": [ 105 | "Helvetica" 106 | ], 107 | "font-size": 12, 108 | "color": "#7f7f7f", 109 | "text-align": "left", 110 | "vertical-align": "top", 111 | "line-height": "", 112 | "line-height-ratio": "", 113 | "letter-spacing": "", 114 | "font-style": [], 115 | "overflow": "truncate", 116 | "word-wrap": "none" 117 | }, 118 | "reference-id": "", 119 | "value": "", 120 | "multiple-line": true, 121 | "format": { 122 | "base": "", 123 | "type": "" 124 | } 125 | }, 126 | { 127 | "id": "my_post_code", 128 | "type": "text-block", 129 | "display": true, 130 | "description": "", 131 | "x": 329, 132 | "y": 158, 133 | "width": 242, 134 | "height": 10, 135 | "style": { 136 | "font-family": [ 137 | "Helvetica" 138 | ], 139 | "font-size": 10, 140 | "color": "#7f7f7f", 141 | "text-align": "left", 142 | "vertical-align": "top", 143 | "line-height": "", 144 | "line-height-ratio": "", 145 | "letter-spacing": "", 146 | "font-style": [], 147 | "overflow": "truncate", 148 | "word-wrap": "none" 149 | }, 150 | "reference-id": "", 151 | "value": "", 152 | "multiple-line": false, 153 | "format": { 154 | "base": "", 155 | "type": "" 156 | } 157 | }, 158 | { 159 | "id": "my_address", 160 | "type": "text-block", 161 | "display": true, 162 | "description": "", 163 | "x": 329, 164 | "y": 124, 165 | "width": 242, 166 | "height": 30, 167 | "style": { 168 | "font-family": [ 169 | "Helvetica" 170 | ], 171 | "font-size": 10, 172 | "color": "#7f7f7f", 173 | "text-align": "left", 174 | "vertical-align": "top", 175 | "line-height": "", 176 | "line-height-ratio": "", 177 | "letter-spacing": "", 178 | "font-style": [], 179 | "overflow": "truncate", 180 | "word-wrap": "none" 181 | }, 182 | "reference-id": "", 183 | "value": "", 184 | "multiple-line": true, 185 | "format": { 186 | "base": "", 187 | "type": "" 188 | } 189 | }, 190 | { 191 | "id": "", 192 | "type": "text", 193 | "display": true, 194 | "description": "", 195 | "x": 330, 196 | "y": 178.9, 197 | "width": 26.1, 198 | "height": 13.1, 199 | "style": { 200 | "font-family": [ 201 | "Helvetica" 202 | ], 203 | "font-size": 10, 204 | "color": "#7f7f7f", 205 | "text-align": "left", 206 | "vertical-align": "top", 207 | "line-height": "", 208 | "line-height-ratio": "", 209 | "letter-spacing": "", 210 | "font-style": [] 211 | }, 212 | "texts": [ 213 | "TEL:" 214 | ] 215 | }, 216 | { 217 | "id": "", 218 | "type": "text", 219 | "display": true, 220 | "description": "", 221 | "x": 330, 222 | "y": 194.9, 223 | "width": 26.1, 224 | "height": 13.1, 225 | "style": { 226 | "font-family": [ 227 | "Helvetica" 228 | ], 229 | "font-size": 10, 230 | "color": "#7f7f7f", 231 | "text-align": "left", 232 | "vertical-align": "top", 233 | "line-height": "", 234 | "line-height-ratio": "", 235 | "letter-spacing": "", 236 | "font-style": [] 237 | }, 238 | "texts": [ 239 | "FAX:" 240 | ] 241 | }, 242 | { 243 | "id": "my_tel_number", 244 | "type": "text-block", 245 | "display": true, 246 | "description": "", 247 | "x": 357, 248 | "y": 178.4, 249 | "width": 214, 250 | "height": 10, 251 | "style": { 252 | "font-family": [ 253 | "Helvetica" 254 | ], 255 | "font-size": 10, 256 | "color": "#7f7f7f", 257 | "text-align": "left", 258 | "vertical-align": "top", 259 | "line-height": "", 260 | "line-height-ratio": "", 261 | "letter-spacing": "", 262 | "font-style": [], 263 | "overflow": "truncate", 264 | "word-wrap": "none" 265 | }, 266 | "reference-id": "", 267 | "value": "", 268 | "multiple-line": false, 269 | "format": { 270 | "base": "", 271 | "type": "" 272 | } 273 | }, 274 | { 275 | "id": "my_fax_number", 276 | "type": "text-block", 277 | "display": true, 278 | "description": "", 279 | "x": 357, 280 | "y": 194.9, 281 | "width": 214, 282 | "height": 10, 283 | "style": { 284 | "font-family": [ 285 | "Helvetica" 286 | ], 287 | "font-size": 10, 288 | "color": "#7f7f7f", 289 | "text-align": "left", 290 | "vertical-align": "top", 291 | "line-height": "", 292 | "line-height-ratio": "", 293 | "letter-spacing": "", 294 | "font-style": [], 295 | "overflow": "truncate", 296 | "word-wrap": "none" 297 | }, 298 | "reference-id": "", 299 | "value": "", 300 | "multiple-line": false, 301 | "format": { 302 | "base": "", 303 | "type": "" 304 | } 305 | }, 306 | { 307 | "id": "no", 308 | "type": "text-block", 309 | "display": true, 310 | "description": "", 311 | "x": 487, 312 | "y": 20, 313 | "width": 88, 314 | "height": 10, 315 | "style": { 316 | "font-family": [ 317 | "Helvetica" 318 | ], 319 | "font-size": 10, 320 | "color": "#7f7f7f", 321 | "text-align": "right", 322 | "vertical-align": "top", 323 | "line-height": "", 324 | "line-height-ratio": "", 325 | "letter-spacing": "", 326 | "font-style": [], 327 | "overflow": "truncate", 328 | "word-wrap": "none" 329 | }, 330 | "reference-id": "", 331 | "value": "", 332 | "multiple-line": false, 333 | "format": { 334 | "base": "", 335 | "type": "" 336 | } 337 | }, 338 | { 339 | "id": "default", 340 | "type": "list", 341 | "display": true, 342 | "description": "", 343 | "x": 20, 344 | "y": 300, 345 | "width": 555.2, 346 | "height": 500, 347 | "header": { 348 | "enabled": true, 349 | "height": 15, 350 | "translate": { 351 | "x": 0, 352 | "y": 95.9 353 | }, 354 | "items": [ 355 | { 356 | "id": "", 357 | "type": "rect", 358 | "display": true, 359 | "description": "", 360 | "x": 20, 361 | "y": 204.1, 362 | "width": 555.2, 363 | "height": 15, 364 | "style": { 365 | "border-color": "none", 366 | "border-width": 1, 367 | "border-style": "solid", 368 | "fill-color": "#aaaaaa" 369 | }, 370 | "border-radius": 0 371 | }, 372 | { 373 | "id": "", 374 | "type": "text", 375 | "display": true, 376 | "description": "", 377 | "x": 38.5, 378 | "y": 204.1, 379 | "width": 232.1, 380 | "height": 15, 381 | "style": { 382 | "font-family": [ 383 | "Helvetica" 384 | ], 385 | "font-size": 10, 386 | "color": "#ffffff", 387 | "text-align": "center", 388 | "vertical-align": "middle", 389 | "line-height": "", 390 | "line-height-ratio": "", 391 | "letter-spacing": "", 392 | "font-style": [] 393 | }, 394 | "texts": [ 395 | "Name" 396 | ] 397 | }, 398 | { 399 | "id": "", 400 | "type": "text", 401 | "display": true, 402 | "description": "", 403 | "x": 272, 404 | "y": 204.1, 405 | "width": 110, 406 | "height": 15, 407 | "style": { 408 | "font-family": [ 409 | "Helvetica" 410 | ], 411 | "font-size": 10, 412 | "color": "#ffffff", 413 | "text-align": "center", 414 | "vertical-align": "middle", 415 | "line-height": "", 416 | "line-height-ratio": "", 417 | "letter-spacing": "", 418 | "font-style": [] 419 | }, 420 | "texts": [ 421 | "Rate" 422 | ] 423 | }, 424 | { 425 | "id": "", 426 | "type": "text", 427 | "display": true, 428 | "description": "", 429 | "x": 457.2, 430 | "y": 204.1, 431 | "width": 118, 432 | "height": 15, 433 | "style": { 434 | "font-family": [ 435 | "IPAPGothic" 436 | ], 437 | "font-size": 10, 438 | "color": "#ffffff", 439 | "text-align": "center", 440 | "vertical-align": "middle", 441 | "line-height": "", 442 | "line-height-ratio": "", 443 | "letter-spacing": "", 444 | "font-style": [] 445 | }, 446 | "texts": [ 447 | "Amount" 448 | ] 449 | }, 450 | { 451 | "id": "", 452 | "type": "text", 453 | "display": true, 454 | "description": "", 455 | "x": 382, 456 | "y": 204.1, 457 | "width": 74.2, 458 | "height": 15, 459 | "style": { 460 | "font-family": [ 461 | "Helvetica" 462 | ], 463 | "font-size": 10, 464 | "color": "#ffffff", 465 | "text-align": "center", 466 | "vertical-align": "middle", 467 | "line-height": "", 468 | "line-height-ratio": "", 469 | "letter-spacing": "", 470 | "font-style": [] 471 | }, 472 | "texts": [ 473 | "Qty" 474 | ] 475 | }, 476 | { 477 | "id": "", 478 | "type": "line", 479 | "display": true, 480 | "description": "", 481 | "style": { 482 | "border-color": "#ffffff", 483 | "border-width": 1, 484 | "border-style": "solid" 485 | }, 486 | "x1": 271, 487 | "y1": 204.1, 488 | "x2": 271, 489 | "y2": 219.1 490 | }, 491 | { 492 | "id": "", 493 | "type": "line", 494 | "display": true, 495 | "description": "", 496 | "style": { 497 | "border-color": "#ffffff", 498 | "border-width": 1, 499 | "border-style": "solid" 500 | }, 501 | "x1": 382, 502 | "y1": 204.1, 503 | "x2": 382, 504 | "y2": 219.1 505 | }, 506 | { 507 | "id": "", 508 | "type": "line", 509 | "display": true, 510 | "description": "", 511 | "style": { 512 | "border-color": "#ffffff", 513 | "border-width": 1, 514 | "border-style": "solid" 515 | }, 516 | "x1": 457, 517 | "y1": 204.1, 518 | "x2": 457, 519 | "y2": 219.1 520 | }, 521 | { 522 | "id": "", 523 | "type": "line", 524 | "display": true, 525 | "description": "", 526 | "style": { 527 | "border-color": "#ffffff", 528 | "border-width": 1, 529 | "border-style": "solid" 530 | }, 531 | "x1": 37, 532 | "y1": 204.1, 533 | "x2": 37, 534 | "y2": 219.1 535 | }, 536 | { 537 | "id": "", 538 | "type": "text", 539 | "display": true, 540 | "description": "", 541 | "x": 20, 542 | "y": 204.1, 543 | "width": 17, 544 | "height": 15, 545 | "style": { 546 | "font-family": [ 547 | "Helvetica" 548 | ], 549 | "font-size": 10, 550 | "color": "#ffffff", 551 | "text-align": "center", 552 | "vertical-align": "middle", 553 | "line-height": "", 554 | "line-height-ratio": "", 555 | "letter-spacing": "", 556 | "font-style": [] 557 | }, 558 | "texts": [ 559 | "#" 560 | ] 561 | } 562 | ] 563 | }, 564 | "detail": { 565 | "height": 16, 566 | "translate": { 567 | "x": 0, 568 | "y": 98.5 569 | }, 570 | "items": [ 571 | { 572 | "id": "name", 573 | "type": "text-block", 574 | "display": true, 575 | "description": "", 576 | "x": 41, 577 | "y": 219.5, 578 | "width": 230, 579 | "height": 10, 580 | "style": { 581 | "font-family": [ 582 | "Helvetica" 583 | ], 584 | "font-size": 10, 585 | "color": "#595959", 586 | "text-align": "left", 587 | "vertical-align": "top", 588 | "line-height": "", 589 | "line-height-ratio": "", 590 | "letter-spacing": "", 591 | "font-style": [], 592 | "overflow": "truncate", 593 | "word-wrap": "none" 594 | }, 595 | "reference-id": "", 596 | "value": "", 597 | "multiple-line": false, 598 | "format": { 599 | "base": "", 600 | "type": "" 601 | } 602 | }, 603 | { 604 | "id": "rate", 605 | "type": "text-block", 606 | "display": true, 607 | "description": "", 608 | "x": 272, 609 | "y": 219.5, 610 | "width": 105.1, 611 | "height": 10, 612 | "style": { 613 | "font-family": [ 614 | "Helvetica" 615 | ], 616 | "font-size": 10, 617 | "color": "#595959", 618 | "text-align": "right", 619 | "vertical-align": "top", 620 | "line-height": "", 621 | "line-height-ratio": "", 622 | "letter-spacing": "", 623 | "font-style": [], 624 | "overflow": "truncate", 625 | "word-wrap": "none" 626 | }, 627 | "reference-id": "", 628 | "value": "", 629 | "multiple-line": false, 630 | "format": { 631 | "base": "${value}", 632 | "type": "number", 633 | "number": { 634 | "delimiter": ",", 635 | "precision": 2 636 | } 637 | } 638 | }, 639 | { 640 | "id": "qty", 641 | "type": "text-block", 642 | "display": true, 643 | "description": "", 644 | "x": 382.6, 645 | "y": 219.5, 646 | "width": 69.8, 647 | "height": 10, 648 | "style": { 649 | "font-family": [ 650 | "Helvetica" 651 | ], 652 | "font-size": 10, 653 | "color": "#595959", 654 | "text-align": "right", 655 | "vertical-align": "top", 656 | "line-height": "", 657 | "line-height-ratio": "", 658 | "letter-spacing": "", 659 | "font-style": [], 660 | "overflow": "truncate", 661 | "word-wrap": "none" 662 | }, 663 | "reference-id": "", 664 | "value": "", 665 | "multiple-line": false, 666 | "format": { 667 | "base": "", 668 | "type": "number", 669 | "number": { 670 | "delimiter": ",", 671 | "precision": 0 672 | } 673 | } 674 | }, 675 | { 676 | "id": "amount", 677 | "type": "text-block", 678 | "display": true, 679 | "description": "", 680 | "x": 457.2, 681 | "y": 219.5, 682 | "width": 113.9, 683 | "height": 10, 684 | "style": { 685 | "font-family": [ 686 | "Helvetica" 687 | ], 688 | "font-size": 10, 689 | "color": "#595959", 690 | "text-align": "right", 691 | "vertical-align": "top", 692 | "line-height": "", 693 | "line-height-ratio": "", 694 | "letter-spacing": "", 695 | "font-style": [ 696 | "bold" 697 | ], 698 | "overflow": "truncate", 699 | "word-wrap": "none" 700 | }, 701 | "reference-id": "", 702 | "value": "", 703 | "multiple-line": false, 704 | "format": { 705 | "base": "${value}", 706 | "type": "number", 707 | "number": { 708 | "delimiter": ",", 709 | "precision": 2 710 | } 711 | } 712 | }, 713 | { 714 | "id": "", 715 | "type": "line", 716 | "display": true, 717 | "description": "", 718 | "style": { 719 | "border-color": "#a5a5a5", 720 | "border-width": 1, 721 | "border-style": "solid" 722 | }, 723 | "x1": 271, 724 | "y1": 216.5, 725 | "x2": 271, 726 | "y2": 232.5 727 | }, 728 | { 729 | "id": "", 730 | "type": "line", 731 | "display": true, 732 | "description": "", 733 | "style": { 734 | "border-color": "#a5a5a5", 735 | "border-width": 1, 736 | "border-style": "solid" 737 | }, 738 | "x1": 382, 739 | "y1": 216.5, 740 | "x2": 382, 741 | "y2": 232.5 742 | }, 743 | { 744 | "id": "", 745 | "type": "line", 746 | "display": true, 747 | "description": "", 748 | "style": { 749 | "border-color": "#a5a5a5", 750 | "border-width": 1, 751 | "border-style": "solid" 752 | }, 753 | "x1": 457, 754 | "y1": 216.5, 755 | "x2": 457, 756 | "y2": 232.5 757 | }, 758 | { 759 | "id": "", 760 | "type": "line", 761 | "display": true, 762 | "description": "", 763 | "style": { 764 | "border-color": "#a5a5a5", 765 | "border-width": 1, 766 | "border-style": "solid" 767 | }, 768 | "x1": 20, 769 | "y1": 232.5, 770 | "x2": 575.2, 771 | "y2": 232.5 772 | }, 773 | { 774 | "id": "", 775 | "type": "line", 776 | "display": true, 777 | "description": "", 778 | "style": { 779 | "border-color": "#a5a5a5", 780 | "border-width": 1, 781 | "border-style": "solid" 782 | }, 783 | "x1": 37, 784 | "y1": 216.5, 785 | "x2": 37, 786 | "y2": 232.5 787 | }, 788 | { 789 | "id": "no", 790 | "type": "text-block", 791 | "display": true, 792 | "description": "", 793 | "x": 22, 794 | "y": 219.5, 795 | "width": 12, 796 | "height": 10, 797 | "style": { 798 | "font-family": [ 799 | "Helvetica" 800 | ], 801 | "font-size": 10, 802 | "color": "#595959", 803 | "text-align": "right", 804 | "vertical-align": "top", 805 | "line-height": "", 806 | "line-height-ratio": "", 807 | "letter-spacing": "", 808 | "font-style": [], 809 | "overflow": "truncate", 810 | "word-wrap": "none" 811 | }, 812 | "reference-id": "", 813 | "value": "", 814 | "multiple-line": false, 815 | "format": { 816 | "base": "", 817 | "type": "" 818 | } 819 | }, 820 | { 821 | "id": "", 822 | "type": "line", 823 | "display": true, 824 | "description": "", 825 | "style": { 826 | "border-color": "#a5a5a5", 827 | "border-width": 1, 828 | "border-style": "solid" 829 | }, 830 | "x1": 20, 831 | "y1": 216.5, 832 | "x2": 20, 833 | "y2": 232.5 834 | }, 835 | { 836 | "id": "", 837 | "type": "line", 838 | "display": true, 839 | "description": "", 840 | "style": { 841 | "border-color": "#a5a5a5", 842 | "border-width": 1, 843 | "border-style": "solid" 844 | }, 845 | "x1": 575.2, 846 | "y1": 216.5, 847 | "x2": 575.2, 848 | "y2": 232.5 849 | } 850 | ] 851 | }, 852 | "page-footer": { 853 | "enabled": true, 854 | "height": 16, 855 | "translate": { 856 | "x": 0, 857 | "y": 102.1 858 | }, 859 | "items": [ 860 | { 861 | "id": "", 862 | "type": "rect", 863 | "display": true, 864 | "description": "", 865 | "x": 20, 866 | "y": 229.5, 867 | "width": 437.2, 868 | "height": 15.4, 869 | "style": { 870 | "border-color": "none", 871 | "border-width": 1, 872 | "border-style": "solid", 873 | "fill-color": "#aaaaaa" 874 | }, 875 | "border-radius": 0 876 | }, 877 | { 878 | "id": "", 879 | "type": "text", 880 | "display": true, 881 | "description": "", 882 | "x": 20, 883 | "y": 228.9, 884 | "width": 437.2, 885 | "height": 16, 886 | "style": { 887 | "font-family": [ 888 | "Helvetica" 889 | ], 890 | "font-size": 10, 891 | "color": "#ffffff", 892 | "text-align": "center", 893 | "vertical-align": "middle", 894 | "line-height": "", 895 | "line-height-ratio": "", 896 | "letter-spacing": "", 897 | "font-style": [] 898 | }, 899 | "texts": [ 900 | "Sub Total" 901 | ] 902 | }, 903 | { 904 | "id": "sub_total", 905 | "type": "text-block", 906 | "display": true, 907 | "description": "", 908 | "x": 457.2, 909 | "y": 231.9, 910 | "width": 113.9, 911 | "height": 10, 912 | "style": { 913 | "font-family": [ 914 | "Helvetica" 915 | ], 916 | "font-size": 10, 917 | "color": "#595959", 918 | "text-align": "right", 919 | "vertical-align": "top", 920 | "line-height": "", 921 | "line-height-ratio": "", 922 | "letter-spacing": "", 923 | "font-style": [ 924 | "bold" 925 | ], 926 | "overflow": "truncate", 927 | "word-wrap": "none" 928 | }, 929 | "reference-id": "", 930 | "value": "", 931 | "multiple-line": false, 932 | "format": { 933 | "base": "${value}", 934 | "type": "number", 935 | "number": { 936 | "delimiter": ",", 937 | "precision": 2 938 | } 939 | } 940 | }, 941 | { 942 | "id": "", 943 | "type": "line", 944 | "display": true, 945 | "description": "", 946 | "style": { 947 | "border-color": "#a5a5a5", 948 | "border-width": 1, 949 | "border-style": "solid" 950 | }, 951 | "x1": 20, 952 | "y1": 244.9, 953 | "x2": 575.2, 954 | "y2": 244.9 955 | }, 956 | { 957 | "id": "", 958 | "type": "line", 959 | "display": true, 960 | "description": "", 961 | "style": { 962 | "border-color": "#a5a5a5", 963 | "border-width": 1, 964 | "border-style": "solid" 965 | }, 966 | "x1": 20, 967 | "y1": 228.9, 968 | "x2": 20, 969 | "y2": 244.9 970 | }, 971 | { 972 | "id": "", 973 | "type": "line", 974 | "display": true, 975 | "description": "", 976 | "style": { 977 | "border-color": "#a5a5a5", 978 | "border-width": 1, 979 | "border-style": "solid" 980 | }, 981 | "x1": 575.2, 982 | "y1": 228.9, 983 | "x2": 575.2, 984 | "y2": 244.9 985 | }, 986 | { 987 | "id": "", 988 | "type": "line", 989 | "display": true, 990 | "description": "", 991 | "style": { 992 | "border-color": "#a5a5a5", 993 | "border-width": 1, 994 | "border-style": "solid" 995 | }, 996 | "x1": 457, 997 | "y1": 228.9, 998 | "x2": 457, 999 | "y2": 244.9 1000 | } 1001 | ] 1002 | }, 1003 | "footer": { 1004 | "enabled": true, 1005 | "height": 16, 1006 | "translate": { 1007 | "x": 0, 1008 | "y": 108.8 1009 | }, 1010 | "items": [ 1011 | { 1012 | "id": "", 1013 | "type": "rect", 1014 | "display": true, 1015 | "description": "", 1016 | "x": 20, 1017 | "y": 238.2, 1018 | "width": 437.2, 1019 | "height": 16, 1020 | "style": { 1021 | "border-color": "none", 1022 | "border-width": 1, 1023 | "border-style": "solid", 1024 | "fill-color": "#aaaaaa" 1025 | }, 1026 | "border-radius": 0 1027 | }, 1028 | { 1029 | "id": "", 1030 | "type": "text", 1031 | "display": true, 1032 | "description": "", 1033 | "x": 20, 1034 | "y": 238.2, 1035 | "width": 437.2, 1036 | "height": 16, 1037 | "style": { 1038 | "font-family": [ 1039 | "Helvetica" 1040 | ], 1041 | "font-size": 10, 1042 | "color": "#ffffff", 1043 | "text-align": "center", 1044 | "vertical-align": "middle", 1045 | "line-height": "", 1046 | "line-height-ratio": "", 1047 | "letter-spacing": "", 1048 | "font-style": [] 1049 | }, 1050 | "texts": [ 1051 | "Total" 1052 | ] 1053 | }, 1054 | { 1055 | "id": "total", 1056 | "type": "text-block", 1057 | "display": true, 1058 | "description": "", 1059 | "x": 457.2, 1060 | "y": 241.2, 1061 | "width": 113.9, 1062 | "height": 10, 1063 | "style": { 1064 | "font-family": [ 1065 | "Helvetica" 1066 | ], 1067 | "font-size": 10, 1068 | "color": "#595959", 1069 | "text-align": "right", 1070 | "vertical-align": "top", 1071 | "line-height": "", 1072 | "line-height-ratio": "", 1073 | "letter-spacing": "", 1074 | "font-style": [ 1075 | "bold" 1076 | ], 1077 | "overflow": "truncate", 1078 | "word-wrap": "none" 1079 | }, 1080 | "reference-id": "", 1081 | "value": "", 1082 | "multiple-line": false, 1083 | "format": { 1084 | "base": "${value}", 1085 | "type": "number", 1086 | "number": { 1087 | "delimiter": ",", 1088 | "precision": 2 1089 | } 1090 | } 1091 | }, 1092 | { 1093 | "id": "", 1094 | "type": "line", 1095 | "display": true, 1096 | "description": "", 1097 | "style": { 1098 | "border-color": "#a5a5a5", 1099 | "border-width": 1, 1100 | "border-style": "solid" 1101 | }, 1102 | "x1": 20, 1103 | "y1": 254.2, 1104 | "x2": 575.2, 1105 | "y2": 254.2 1106 | }, 1107 | { 1108 | "id": "", 1109 | "type": "line", 1110 | "display": true, 1111 | "description": "", 1112 | "style": { 1113 | "border-color": "#a5a5a5", 1114 | "border-width": 1, 1115 | "border-style": "solid" 1116 | }, 1117 | "x1": 20, 1118 | "y1": 238.2, 1119 | "x2": 20, 1120 | "y2": 254.2 1121 | }, 1122 | { 1123 | "id": "", 1124 | "type": "line", 1125 | "display": true, 1126 | "description": "", 1127 | "style": { 1128 | "border-color": "#a5a5a5", 1129 | "border-width": 1, 1130 | "border-style": "solid" 1131 | }, 1132 | "x1": 575.2, 1133 | "y1": 238.2, 1134 | "x2": 575.2, 1135 | "y2": 254.2 1136 | }, 1137 | { 1138 | "id": "", 1139 | "type": "line", 1140 | "display": true, 1141 | "description": "", 1142 | "style": { 1143 | "border-color": "#a5a5a5", 1144 | "border-width": 1, 1145 | "border-style": "solid" 1146 | }, 1147 | "x1": 457, 1148 | "y1": 238.2, 1149 | "x2": 457, 1150 | "y2": 254.2 1151 | }, 1152 | { 1153 | "id": "", 1154 | "type": "line", 1155 | "display": true, 1156 | "description": "", 1157 | "style": { 1158 | "border-color": "#ffffff", 1159 | "border-width": 1, 1160 | "border-style": "solid" 1161 | }, 1162 | "x1": 20, 1163 | "y1": 238.2, 1164 | "x2": 457.2, 1165 | "y2": 238.2 1166 | } 1167 | ] 1168 | }, 1169 | "content-height": 485, 1170 | "auto-page-break": true 1171 | }, 1172 | { 1173 | "id": "", 1174 | "type": "text", 1175 | "display": true, 1176 | "description": "", 1177 | "x": 435, 1178 | "y": 20, 1179 | "width": 50, 1180 | "height": 12.2, 1181 | "style": { 1182 | "font-family": [ 1183 | "Helvetica" 1184 | ], 1185 | "font-size": 10, 1186 | "color": "#7f7f7f", 1187 | "text-align": "right", 1188 | "vertical-align": "top", 1189 | "line-height": "", 1190 | "line-height-ratio": "", 1191 | "letter-spacing": "", 1192 | "font-style": [] 1193 | }, 1194 | "texts": [ 1195 | "No:" 1196 | ] 1197 | }, 1198 | { 1199 | "id": "", 1200 | "type": "rect", 1201 | "display": true, 1202 | "description": "", 1203 | "x": 325, 1204 | "y": 96.1, 1205 | "width": 250, 1206 | "height": 115, 1207 | "style": { 1208 | "border-color": "#a5a5a5", 1209 | "border-width": 0.5, 1210 | "border-style": "solid", 1211 | "fill-color": "none" 1212 | }, 1213 | "border-radius": 0 1214 | }, 1215 | { 1216 | "id": "", 1217 | "type": "rect", 1218 | "display": true, 1219 | "description": "", 1220 | "x": 20, 1221 | "y": 96.1, 1222 | "width": 250, 1223 | "height": 85, 1224 | "style": { 1225 | "border-color": "#a5a5a5", 1226 | "border-width": 0.5, 1227 | "border-style": "solid", 1228 | "fill-color": "none" 1229 | }, 1230 | "border-radius": 0 1231 | }, 1232 | { 1233 | "id": "", 1234 | "type": "rect", 1235 | "display": true, 1236 | "description": "", 1237 | "x": 20, 1238 | "y": 96, 1239 | "width": 250, 1240 | "height": 15, 1241 | "style": { 1242 | "border-color": "none", 1243 | "border-width": 1, 1244 | "border-style": "solid", 1245 | "fill-color": "#aaaaaa" 1246 | }, 1247 | "border-radius": 0 1248 | }, 1249 | { 1250 | "id": "", 1251 | "type": "text", 1252 | "display": true, 1253 | "description": "", 1254 | "x": 20, 1255 | "y": 96, 1256 | "width": 250, 1257 | "height": 15, 1258 | "style": { 1259 | "font-family": [ 1260 | "Helvetica" 1261 | ], 1262 | "font-size": 10, 1263 | "color": "#ffffff", 1264 | "text-align": "center", 1265 | "vertical-align": "middle", 1266 | "line-height": "", 1267 | "line-height-ratio": "", 1268 | "letter-spacing": "", 1269 | "font-style": [] 1270 | }, 1271 | "texts": [ 1272 | "Bill To" 1273 | ] 1274 | }, 1275 | { 1276 | "id": "customer_address", 1277 | "type": "text-block", 1278 | "display": true, 1279 | "description": "", 1280 | "x": 24, 1281 | "y": 133, 1282 | "width": 244, 1283 | "height": 30, 1284 | "style": { 1285 | "font-family": [ 1286 | "Helvetica" 1287 | ], 1288 | "font-size": 10, 1289 | "color": "#7f7f7f", 1290 | "text-align": "left", 1291 | "vertical-align": "top", 1292 | "line-height": "", 1293 | "line-height-ratio": "", 1294 | "letter-spacing": "", 1295 | "font-style": [], 1296 | "overflow": "truncate", 1297 | "word-wrap": "none" 1298 | }, 1299 | "reference-id": "", 1300 | "value": "", 1301 | "multiple-line": true, 1302 | "format": { 1303 | "base": "", 1304 | "type": "" 1305 | } 1306 | }, 1307 | { 1308 | "id": "customer_post_code", 1309 | "type": "text-block", 1310 | "display": true, 1311 | "description": "", 1312 | "x": 24, 1313 | "y": 167, 1314 | "width": 244, 1315 | "height": 10, 1316 | "style": { 1317 | "font-family": [ 1318 | "Helvetica" 1319 | ], 1320 | "font-size": 10, 1321 | "color": "#7f7f7f", 1322 | "text-align": "left", 1323 | "vertical-align": "top", 1324 | "line-height": "", 1325 | "line-height-ratio": "", 1326 | "letter-spacing": "", 1327 | "font-style": [], 1328 | "overflow": "truncate", 1329 | "word-wrap": "none" 1330 | }, 1331 | "reference-id": "", 1332 | "value": "", 1333 | "multiple-line": false, 1334 | "format": { 1335 | "base": "", 1336 | "type": "" 1337 | } 1338 | }, 1339 | { 1340 | "id": "issued_date", 1341 | "type": "text-block", 1342 | "display": true, 1343 | "description": "", 1344 | "x": 487.2, 1345 | "y": 35, 1346 | "width": 88, 1347 | "height": 10, 1348 | "style": { 1349 | "font-family": [ 1350 | "Helvetica" 1351 | ], 1352 | "font-size": 10, 1353 | "color": "#7f7f7f", 1354 | "text-align": "right", 1355 | "vertical-align": "top", 1356 | "line-height": "", 1357 | "line-height-ratio": "", 1358 | "letter-spacing": "", 1359 | "font-style": [], 1360 | "overflow": "truncate", 1361 | "word-wrap": "none" 1362 | }, 1363 | "reference-id": "", 1364 | "value": "", 1365 | "multiple-line": false, 1366 | "format": { 1367 | "base": "", 1368 | "type": "datetime", 1369 | "datetime": { 1370 | "format": "%Y-%m-%d" 1371 | } 1372 | } 1373 | }, 1374 | { 1375 | "id": "", 1376 | "type": "text", 1377 | "display": true, 1378 | "description": "", 1379 | "x": 428, 1380 | "y": 35, 1381 | "width": 59, 1382 | "height": 12.2, 1383 | "style": { 1384 | "font-family": [ 1385 | "Helvetica" 1386 | ], 1387 | "font-size": 10, 1388 | "color": "#7f7f7f", 1389 | "text-align": "right", 1390 | "vertical-align": "top", 1391 | "line-height": "", 1392 | "line-height-ratio": "", 1393 | "letter-spacing": "", 1394 | "font-style": [] 1395 | }, 1396 | "texts": [ 1397 | "Issued Date:" 1398 | ] 1399 | }, 1400 | { 1401 | "id": "", 1402 | "type": "rect", 1403 | "display": true, 1404 | "description": "", 1405 | "x": 512, 1406 | "y": 220, 1407 | "width": 63, 1408 | "height": 50, 1409 | "style": { 1410 | "border-color": "#a5a5a5", 1411 | "border-width": 0.5, 1412 | "border-style": "solid", 1413 | "fill-color": "#FFFFFF" 1414 | }, 1415 | "border-radius": 0 1416 | }, 1417 | { 1418 | "id": "", 1419 | "type": "rect", 1420 | "display": true, 1421 | "description": "", 1422 | "x": 449, 1423 | "y": 220, 1424 | "width": 63, 1425 | "height": 50, 1426 | "style": { 1427 | "border-color": "#a5a5a5", 1428 | "border-width": 0.5, 1429 | "border-style": "solid", 1430 | "fill-color": "#FFFFFF" 1431 | }, 1432 | "border-radius": 0 1433 | }, 1434 | { 1435 | "id": "", 1436 | "type": "rect", 1437 | "display": true, 1438 | "description": "", 1439 | "x": 386, 1440 | "y": 220, 1441 | "width": 63, 1442 | "height": 50, 1443 | "style": { 1444 | "border-color": "#a5a5a5", 1445 | "border-width": 0.5, 1446 | "border-style": "solid", 1447 | "fill-color": "#FFFFFF" 1448 | }, 1449 | "border-radius": 0 1450 | }, 1451 | { 1452 | "id": "", 1453 | "type": "rect", 1454 | "display": true, 1455 | "description": "", 1456 | "x": 325, 1457 | "y": 220, 1458 | "width": 63, 1459 | "height": 50, 1460 | "style": { 1461 | "border-color": "#a5a5a5", 1462 | "border-width": 0.5, 1463 | "border-style": "solid", 1464 | "fill-color": "#FFFFFF" 1465 | }, 1466 | "border-radius": 0 1467 | }, 1468 | { 1469 | "id": "notes", 1470 | "type": "text-block", 1471 | "display": true, 1472 | "description": "", 1473 | "x": 25, 1474 | "y": 207, 1475 | "width": 240, 1476 | "height": 60, 1477 | "style": { 1478 | "font-family": [ 1479 | "Helvetica" 1480 | ], 1481 | "font-size": 10, 1482 | "color": "#7f7f7f", 1483 | "text-align": "left", 1484 | "vertical-align": "top", 1485 | "line-height": "", 1486 | "line-height-ratio": "", 1487 | "letter-spacing": "", 1488 | "font-style": [], 1489 | "overflow": "fit", 1490 | "word-wrap": "none" 1491 | }, 1492 | "reference-id": "", 1493 | "value": "", 1494 | "multiple-line": true, 1495 | "format": { 1496 | "base": "", 1497 | "type": "" 1498 | } 1499 | }, 1500 | { 1501 | "id": "", 1502 | "type": "text", 1503 | "display": true, 1504 | "description": "", 1505 | "x": 20, 1506 | "y": 190, 1507 | "width": 39.5, 1508 | "height": 12.2, 1509 | "style": { 1510 | "font-family": [ 1511 | "Helvetica" 1512 | ], 1513 | "font-size": 10, 1514 | "color": "#7f7f7f", 1515 | "text-align": "left", 1516 | "vertical-align": "top", 1517 | "line-height": "", 1518 | "line-height-ratio": "", 1519 | "letter-spacing": "", 1520 | "font-style": [] 1521 | }, 1522 | "texts": [ 1523 | "Notes" 1524 | ] 1525 | }, 1526 | { 1527 | "id": "", 1528 | "type": "rect", 1529 | "display": true, 1530 | "description": "", 1531 | "x": 20, 1532 | "y": 202.5, 1533 | "width": 250, 1534 | "height": 68, 1535 | "style": { 1536 | "border-color": "#a5a5a5", 1537 | "border-width": 0.5, 1538 | "border-style": "solid", 1539 | "fill-color": "none" 1540 | }, 1541 | "border-radius": 0 1542 | } 1543 | ], 1544 | "state": { 1545 | "layout-guides": [ 1546 | { 1547 | "type": "x", 1548 | "position": 0 1549 | }, 1550 | { 1551 | "type": "x", 1552 | "position": 457.2 1553 | }, 1554 | { 1555 | "type": "x", 1556 | "position": 356.1 1557 | }, 1558 | { 1559 | "type": "y", 1560 | "position": 270.1 1561 | } 1562 | ] 1563 | }, 1564 | "title": "estimate", 1565 | "report": { 1566 | "paper-type": "A4", 1567 | "orientation": "portrait", 1568 | "margin": [ 1569 | 20, 1570 | 20, 1571 | 20, 1572 | 20 1573 | ] 1574 | } 1575 | } -------------------------------------------------------------------------------- /eudc/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /eudc/README.md: -------------------------------------------------------------------------------- 1 | # Use External-Character - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `eudc.rb`: 10 | 11 | % bundle exec ruby eudc.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## How to get EUDC.ttf 16 | 17 | 1. Windows の外字エディタで外字を作る 18 | 2. 作成された `EUDC.TTE` をコピー 19 | 3. 拡張子を `ttf` へ変更 20 | 21 | ## Requirements 22 | 23 | * ruby >= 1.9.3 24 | * thinreports 0.9.0 25 | -------------------------------------------------------------------------------- /eudc/eudc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/eudc/eudc.pdf -------------------------------------------------------------------------------- /eudc/eudc.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | Thinreports.configure do |config| 7 | config.fallback_fonts = 'eudc.ttf' 8 | end 9 | 10 | Thinreports::Report.generate filename: 'result.pdf', layout: 'eudc.tlf' do 11 | start_new_page 12 | 13 | # "□" is External Character (Gaiji) 14 | page.item(:eudc).value("日本で生まれ世界が育てた言語\nuby") 15 | end 16 | -------------------------------------------------------------------------------- /eudc/eudc.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "eudc", 6 | "type": "text-block", 7 | "display": true, 8 | "description": "", 9 | "x": 40, 10 | "y": 160, 11 | "width": 767.8, 12 | "height": 283.8, 13 | "style": { 14 | "font-family": [ 15 | "IPAMincho" 16 | ], 17 | "font-size": 52, 18 | "color": "#000000", 19 | "text-align": "center", 20 | "vertical-align": "middle", 21 | "line-height": 78, 22 | "line-height-ratio": 1.5, 23 | "letter-spacing": "", 24 | "font-style": [], 25 | "overflow": "truncate", 26 | "word-wrap": "none" 27 | }, 28 | "reference-id": "", 29 | "value": "", 30 | "multiple-line": true, 31 | "format": { 32 | "base": "", 33 | "type": "" 34 | } 35 | } 36 | ], 37 | "state": { 38 | "layout-guides": [] 39 | }, 40 | "title": "Example EUDC", 41 | "report": { 42 | "paper-type": "A4", 43 | "orientation": "landscape", 44 | "margin": [ 45 | 20, 46 | 20, 47 | 20, 48 | 20 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /eudc/eudc.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/eudc/eudc.ttf -------------------------------------------------------------------------------- /event/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /event/README.md: -------------------------------------------------------------------------------- 1 | # Use Event Hooks - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `event.rb`: 10 | 11 | % bundle exec ruby event.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /event/event.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/event/event.pdf -------------------------------------------------------------------------------- /event/event.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | Thinreports::Report.generate filename: 'result.pdf', layout: 'event' do |report| 7 | # It will be called before finalizing each page 8 | report.on_page_create do |page| 9 | page.item(:event_page_create).value('Dispatched at before page creating.') 10 | 11 | # Set page-number. 12 | page.item(:page).value(page.no) 13 | end 14 | 15 | 3.times { report.start_new_page } 16 | 17 | report.pages.each do |page| 18 | page.item(:event_generate).value('Dispatch at before report generating.') 19 | 20 | # Set total-page-number. 21 | page.item(:total).value(report.page_count) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /event/event.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "page", 6 | "type": "text-block", 7 | "display": true, 8 | "description": "", 9 | "x": 180, 10 | "y": 330, 11 | "width": 87, 12 | "height": 36, 13 | "style": { 14 | "font-family": [ 15 | "Helvetica" 16 | ], 17 | "font-size": 36, 18 | "color": "#000000", 19 | "text-align": "center", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [], 25 | "overflow": "truncate", 26 | "word-wrap": "none" 27 | }, 28 | "reference-id": "", 29 | "value": "", 30 | "multiple-line": false, 31 | "format": { 32 | "base": "", 33 | "type": "" 34 | } 35 | }, 36 | { 37 | "id": "total", 38 | "type": "text-block", 39 | "display": true, 40 | "description": "", 41 | "x": 315, 42 | "y": 330, 43 | "width": 87, 44 | "height": 36, 45 | "style": { 46 | "font-family": [ 47 | "Helvetica" 48 | ], 49 | "font-size": 36, 50 | "color": "#000000", 51 | "text-align": "center", 52 | "vertical-align": "top", 53 | "line-height": "", 54 | "line-height-ratio": "", 55 | "letter-spacing": "", 56 | "font-style": [], 57 | "overflow": "truncate", 58 | "word-wrap": "none" 59 | }, 60 | "reference-id": "", 61 | "value": "", 62 | "multiple-line": false, 63 | "format": { 64 | "base": "", 65 | "type": "" 66 | } 67 | }, 68 | { 69 | "id": "", 70 | "type": "line", 71 | "display": true, 72 | "description": "", 73 | "style": { 74 | "border-color": "#000000", 75 | "border-width": 1, 76 | "border-style": "solid" 77 | }, 78 | "x1": 281, 79 | "y1": 369.9, 80 | "x2": 301, 81 | "y2": 329.9 82 | }, 83 | { 84 | "id": "event_page_create", 85 | "type": "text-block", 86 | "display": true, 87 | "description": "", 88 | "x": 20, 89 | "y": 140, 90 | "width": 555.2, 91 | "height": 26, 92 | "style": { 93 | "font-family": [ 94 | "Times New Roman" 95 | ], 96 | "font-size": 24, 97 | "color": "#000000", 98 | "text-align": "center", 99 | "vertical-align": "top", 100 | "line-height": "", 101 | "line-height-ratio": "", 102 | "letter-spacing": "", 103 | "font-style": [], 104 | "overflow": "truncate", 105 | "word-wrap": "none" 106 | }, 107 | "reference-id": "", 108 | "value": "", 109 | "multiple-line": false, 110 | "format": { 111 | "base": "", 112 | "type": "" 113 | } 114 | }, 115 | { 116 | "id": "", 117 | "type": "text", 118 | "display": true, 119 | "description": "", 120 | "x": 20, 121 | "y": 20, 122 | "width": 228.2, 123 | "height": 20, 124 | "style": { 125 | "font-family": [ 126 | "Times New Roman" 127 | ], 128 | "font-size": 18, 129 | "color": "#7f7f7f", 130 | "text-align": "left", 131 | "vertical-align": "top", 132 | "line-height": "", 133 | "line-height-ratio": "", 134 | "letter-spacing": "", 135 | "font-style": [ 136 | "italic" 137 | ] 138 | }, 139 | "texts": [ 140 | "Example: Using Events" 141 | ] 142 | }, 143 | { 144 | "id": "event_generate", 145 | "type": "text-block", 146 | "display": true, 147 | "description": "", 148 | "x": 20, 149 | "y": 180, 150 | "width": 555.2, 151 | "height": 26, 152 | "style": { 153 | "font-family": [ 154 | "Times New Roman" 155 | ], 156 | "font-size": 24, 157 | "color": "#000000", 158 | "text-align": "center", 159 | "vertical-align": "top", 160 | "line-height": "", 161 | "line-height-ratio": "", 162 | "letter-spacing": "", 163 | "font-style": [], 164 | "overflow": "truncate", 165 | "word-wrap": "none" 166 | }, 167 | "reference-id": "", 168 | "value": "", 169 | "multiple-line": false, 170 | "format": { 171 | "base": "", 172 | "type": "" 173 | } 174 | }, 175 | { 176 | "id": "", 177 | "type": "text", 178 | "display": true, 179 | "description": "", 180 | "x": 20, 181 | "y": 260, 182 | "width": 555.2, 183 | "height": 40, 184 | "style": { 185 | "font-family": [ 186 | "Times New Roman" 187 | ], 188 | "font-size": 36, 189 | "color": "#000000", 190 | "text-align": "left", 191 | "vertical-align": "top", 192 | "line-height": "", 193 | "line-height-ratio": "", 194 | "letter-spacing": "", 195 | "font-style": [] 196 | }, 197 | "texts": [ 198 | "Draw Total-Page-Number" 199 | ] 200 | }, 201 | { 202 | "id": "", 203 | "type": "line", 204 | "display": true, 205 | "description": "", 206 | "style": { 207 | "border-color": "#7f7f7f", 208 | "border-width": 3, 209 | "border-style": "solid" 210 | }, 211 | "x1": 20, 212 | "y1": 300.9, 213 | "x2": 575.2, 214 | "y2": 300.9 215 | }, 216 | { 217 | "id": "", 218 | "type": "text", 219 | "display": true, 220 | "description": "", 221 | "x": 20, 222 | "y": 75, 223 | "width": 555.2, 224 | "height": 40, 225 | "style": { 226 | "font-family": [ 227 | "Times New Roman" 228 | ], 229 | "font-size": 36, 230 | "color": "#000000", 231 | "text-align": "left", 232 | "vertical-align": "top", 233 | "line-height": "", 234 | "line-height-ratio": "", 235 | "letter-spacing": "", 236 | "font-style": [] 237 | }, 238 | "texts": [ 239 | "Basic Report Events" 240 | ] 241 | }, 242 | { 243 | "id": "", 244 | "type": "line", 245 | "display": true, 246 | "description": "", 247 | "style": { 248 | "border-color": "#7f7f7f", 249 | "border-width": 3, 250 | "border-style": "solid" 251 | }, 252 | "x1": 20, 253 | "y1": 116.1, 254 | "x2": 575.2, 255 | "y2": 116.1 256 | } 257 | ], 258 | "state": { 259 | "layout-guides": [] 260 | }, 261 | "title": "", 262 | "report": { 263 | "paper-type": "A4", 264 | "orientation": "portrait", 265 | "margin": [ 266 | 20, 267 | 20, 268 | 20, 269 | 20 270 | ] 271 | } 272 | } -------------------------------------------------------------------------------- /image-block/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /image-block/README.md: -------------------------------------------------------------------------------- 1 | # ImageBlock Tool - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `image_block.rb`: 10 | 11 | % bundle exec ruby image_block.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /image-block/file/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/image-block/file/image.png -------------------------------------------------------------------------------- /image-block/image_block.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/image-block/image_block.pdf -------------------------------------------------------------------------------- /image-block/image_block.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | require 'open-uri' 7 | 8 | require 'base64' 9 | require 'stringio' 10 | 11 | report = Thinreports::Report.new layout: 'image_block.tlf' 12 | report.start_new_page do |page| 13 | page.item(:local_image).src('file/image.png') 14 | page.item(:remote_image).value(URI.open('http://www.thinreports.org/assets/logos/thinreports-logo-v.png')) 15 | 16 | red_dot = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4' + 17 | '//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' 18 | base64_image = StringIO.new(Base64.decode64(red_dot)) 19 | page.item(:base64_image).value(base64_image) 20 | end 21 | 22 | report.generate filename: 'result.pdf' 23 | -------------------------------------------------------------------------------- /image-block/image_block.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "local_image", 6 | "type": "image-block", 7 | "display": true, 8 | "description": "", 9 | "x": 115.5, 10 | "y": 70, 11 | "width": 374.2, 12 | "height": 222.1, 13 | "style": { 14 | "position-x": "center", 15 | "position-y": "middle" 16 | } 17 | }, 18 | { 19 | "id": "", 20 | "type": "text", 21 | "display": true, 22 | "description": "", 23 | "x": 115, 24 | "y": 45, 25 | "width": 149.1, 26 | "height": 18, 27 | "style": { 28 | "font-family": [ 29 | "Helvetica" 30 | ], 31 | "font-size": 16, 32 | "color": "#000000", 33 | "text-align": "left", 34 | "vertical-align": "top", 35 | "line-height": "", 36 | "line-height-ratio": "", 37 | "letter-spacing": "", 38 | "font-style": [] 39 | }, 40 | "texts": [ 41 | "file/image.png" 42 | ] 43 | }, 44 | { 45 | "id": "remote_image", 46 | "type": "image-block", 47 | "display": true, 48 | "description": "", 49 | "x": 115.5, 50 | "y": 330, 51 | "width": 374.2, 52 | "height": 222.1, 53 | "style": { 54 | "position-x": "center", 55 | "position-y": "middle" 56 | } 57 | }, 58 | { 59 | "id": "", 60 | "type": "text", 61 | "display": true, 62 | "description": "", 63 | "x": 115, 64 | "y": 305, 65 | "width": 460.2, 66 | "height": 18, 67 | "style": { 68 | "font-family": [ 69 | "Helvetica" 70 | ], 71 | "font-size": 16, 72 | "color": "#000000", 73 | "text-align": "left", 74 | "vertical-align": "top", 75 | "line-height": "", 76 | "line-height-ratio": "", 77 | "letter-spacing": "", 78 | "font-style": [] 79 | }, 80 | "texts": [ 81 | "http://www.thinreports.org/assets/logos/thinreports-logo-v.png" 82 | ] 83 | }, 84 | { 85 | "id": "base64_image", 86 | "type": "image-block", 87 | "display": true, 88 | "description": "", 89 | "x": 115.5, 90 | "y": 600, 91 | "width": 374.2, 92 | "height": 222.1, 93 | "style": { 94 | "position-x": "center", 95 | "position-y": "middle" 96 | } 97 | }, 98 | { 99 | "id": "", 100 | "type": "text", 101 | "display": true, 102 | "description": "", 103 | "x": 115, 104 | "y": 580, 105 | "width": 374.3, 106 | "height": 18, 107 | "style": { 108 | "font-family": [ 109 | "Helvetica" 110 | ], 111 | "font-size": 16, 112 | "color": "#000000", 113 | "text-align": "left", 114 | "vertical-align": "top", 115 | "line-height": "", 116 | "line-height-ratio": "", 117 | "letter-spacing": "", 118 | "font-style": [] 119 | }, 120 | "texts": [ 121 | "Red dot(Base64)" 122 | ] 123 | } 124 | ], 125 | "state": { 126 | "layout-guides": [] 127 | }, 128 | "title": "", 129 | "report": { 130 | "paper-type": "A4", 131 | "orientation": "portrait", 132 | "margin": [ 133 | 20, 134 | 20, 135 | 20, 136 | 20 137 | ] 138 | } 139 | } -------------------------------------------------------------------------------- /list/README.md: -------------------------------------------------------------------------------- 1 | # List Tool Examples - Thinreports Examples 2 | 3 | Examples and Tips of the List Tool. 4 | 5 | ## Feature Examples 6 | 7 | * [Basic List](basic/) 8 | * [Advanced List](advanced/) 9 | 10 | ## Tips 11 | 12 | * [Group Rows](group-rows/) 13 | -------------------------------------------------------------------------------- /list/advanced/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /list/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced List - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | And execute `advanced_list.rb`: 10 | 11 | % bundle exec ruby advanced_list.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /list/advanced/advanced_list.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/list/advanced/advanced_list.pdf -------------------------------------------------------------------------------- /list/advanced/advanced_list.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | report = Thinreports::Report.new layout: 'advanced_list' 7 | 8 | report.list do |list| 9 | # Define the variables used in list. 10 | row_count = 0 11 | total_row_count = 0 12 | 13 | list.on_page_footer_insert do |page_footer| 14 | page_footer.item(:page_footer).value("Page row count: #{row_count}") 15 | 16 | total_row_count += row_count 17 | row_count = 0 18 | end 19 | 20 | # Dispatched at list-footer insertion. 21 | list.on_footer_insert do |footer| 22 | footer.item(:footer).value("Row count: #{total_row_count}") 23 | end 24 | 25 | 30.times do |t| 26 | # Internaly #start_new_page() method is called, 27 | # the page break automatically. 28 | list.add_row detail: "Detail##{t}" 29 | row_count += 1 30 | end 31 | end 32 | 33 | report.generate filename: 'result.pdf' 34 | -------------------------------------------------------------------------------- /list/advanced/advanced_list.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 555.2, 12 | "height": 40, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 36, 18 | "color": "#000000", 19 | "text-align": "center", 20 | "vertical-align": "middle", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [] 25 | }, 26 | "texts": [ 27 | "List" 28 | ] 29 | }, 30 | { 31 | "id": "default", 32 | "type": "list", 33 | "display": true, 34 | "description": "", 35 | "x": 20, 36 | "y": 72, 37 | "width": 555.2, 38 | "height": 749.8, 39 | "header": { 40 | "enabled": true, 41 | "height": 43, 42 | "translate": { 43 | "x": 0, 44 | "y": 0 45 | }, 46 | "items": [ 47 | { 48 | "id": "", 49 | "type": "line", 50 | "display": true, 51 | "description": "", 52 | "style": { 53 | "border-color": "#000000", 54 | "border-width": 3, 55 | "border-style": "solid" 56 | }, 57 | "x1": 20, 58 | "y1": 115, 59 | "x2": 575.2, 60 | "y2": 115 61 | }, 62 | { 63 | "id": "header", 64 | "type": "text-block", 65 | "display": true, 66 | "description": "", 67 | "x": 210.1, 68 | "y": 80, 69 | "width": 175, 70 | "height": 24, 71 | "style": { 72 | "font-family": [ 73 | "Times New Roman" 74 | ], 75 | "font-size": 22, 76 | "color": "#000000", 77 | "text-align": "center", 78 | "vertical-align": "top", 79 | "line-height": "", 80 | "line-height-ratio": "", 81 | "letter-spacing": "", 82 | "font-style": [], 83 | "overflow": "truncate", 84 | "word-wrap": "none" 85 | }, 86 | "reference-id": "", 87 | "value": "", 88 | "multiple-line": false, 89 | "format": { 90 | "base": "", 91 | "type": "" 92 | } 93 | } 94 | ] 95 | }, 96 | "detail": { 97 | "height": 32, 98 | "translate": { 99 | "x": 0, 100 | "y": -36.2 101 | }, 102 | "items": [ 103 | { 104 | "id": "detail", 105 | "type": "text-block", 106 | "display": true, 107 | "description": "", 108 | "x": 210.1, 109 | "y": 158.2, 110 | "width": 175, 111 | "height": 19, 112 | "style": { 113 | "font-family": [ 114 | "Times New Roman" 115 | ], 116 | "font-size": 18, 117 | "color": "#000000", 118 | "text-align": "center", 119 | "vertical-align": "top", 120 | "line-height": "", 121 | "line-height-ratio": "", 122 | "letter-spacing": "", 123 | "font-style": [], 124 | "overflow": "truncate", 125 | "word-wrap": "none" 126 | }, 127 | "reference-id": "", 128 | "value": "", 129 | "multiple-line": false, 130 | "format": { 131 | "base": "", 132 | "type": "" 133 | } 134 | }, 135 | { 136 | "id": "", 137 | "type": "line", 138 | "display": true, 139 | "description": "", 140 | "style": { 141 | "border-color": "#000000", 142 | "border-width": 1, 143 | "border-style": "solid" 144 | }, 145 | "x1": 20, 146 | "y1": 183.2, 147 | "x2": 575.2, 148 | "y2": 183.2 149 | } 150 | ] 151 | }, 152 | "page-footer": { 153 | "enabled": true, 154 | "height": 32, 155 | "translate": { 156 | "x": 0, 157 | "y": -83.4 158 | }, 159 | "items": [ 160 | { 161 | "id": "page_footer", 162 | "type": "text-block", 163 | "display": true, 164 | "description": "", 165 | "x": 210.1, 166 | "y": 236.4, 167 | "width": 175, 168 | "height": 19, 169 | "style": { 170 | "font-family": [ 171 | "Times New Roman" 172 | ], 173 | "font-size": 18, 174 | "color": "#000000", 175 | "text-align": "center", 176 | "vertical-align": "top", 177 | "line-height": "", 178 | "line-height-ratio": "", 179 | "letter-spacing": "", 180 | "font-style": [], 181 | "overflow": "truncate", 182 | "word-wrap": "none" 183 | }, 184 | "reference-id": "", 185 | "value": "", 186 | "multiple-line": false, 187 | "format": { 188 | "base": "", 189 | "type": "" 190 | } 191 | }, 192 | { 193 | "id": "", 194 | "type": "line", 195 | "display": true, 196 | "description": "", 197 | "style": { 198 | "border-color": "#000000", 199 | "border-width": 1, 200 | "border-style": "solid" 201 | }, 202 | "x1": 20, 203 | "y1": 262.4, 204 | "x2": 575.2, 205 | "y2": 262.4 206 | } 207 | ] 208 | }, 209 | "footer": { 210 | "enabled": true, 211 | "height": 32, 212 | "translate": { 213 | "x": 0, 214 | "y": -110.8 215 | }, 216 | "items": [ 217 | { 218 | "id": "footer", 219 | "type": "text-block", 220 | "display": true, 221 | "description": "", 222 | "x": 210.1, 223 | "y": 295.8, 224 | "width": 175, 225 | "height": 19, 226 | "style": { 227 | "font-family": [ 228 | "Times New Roman" 229 | ], 230 | "font-size": 18, 231 | "color": "#000000", 232 | "text-align": "center", 233 | "vertical-align": "top", 234 | "line-height": "", 235 | "line-height-ratio": "", 236 | "letter-spacing": "", 237 | "font-style": [], 238 | "overflow": "truncate", 239 | "word-wrap": "none" 240 | }, 241 | "reference-id": "", 242 | "value": "", 243 | "multiple-line": false, 244 | "format": { 245 | "base": "", 246 | "type": "" 247 | } 248 | }, 249 | { 250 | "id": "", 251 | "type": "line", 252 | "display": true, 253 | "description": "", 254 | "style": { 255 | "border-color": "#000000", 256 | "border-width": 1, 257 | "border-style": "solid" 258 | }, 259 | "x1": 20, 260 | "y1": 321.8, 261 | "x2": 575.2, 262 | "y2": 321.8 263 | } 264 | ] 265 | }, 266 | "content-height": 706.8, 267 | "auto-page-break": true 268 | }, 269 | { 270 | "id": "", 271 | "type": "text", 272 | "display": true, 273 | "description": "", 274 | "x": 20, 275 | "y": 20, 276 | "width": 186.2, 277 | "height": 20, 278 | "style": { 279 | "font-family": [ 280 | "Times New Roman" 281 | ], 282 | "font-size": 18, 283 | "color": "#7f7f7f", 284 | "text-align": "left", 285 | "vertical-align": "top", 286 | "line-height": "", 287 | "line-height-ratio": "", 288 | "letter-spacing": "", 289 | "font-style": [ 290 | "italic" 291 | ] 292 | }, 293 | "texts": [ 294 | "Example: Advanced List" 295 | ] 296 | } 297 | ], 298 | "state": { 299 | "layout-guides": [] 300 | }, 301 | "title": "", 302 | "report": { 303 | "paper-type": "A4", 304 | "orientation": "portrait", 305 | "margin": [ 306 | 20, 307 | 20, 308 | 20, 309 | 20 310 | ] 311 | } 312 | } -------------------------------------------------------------------------------- /list/basic/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /list/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic List - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | And execute `basic_list.rb`: 10 | 11 | % bundle exec ruby basic_list.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /list/basic/basic_list.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/list/basic/basic_list.pdf -------------------------------------------------------------------------------- /list/basic/basic_list.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | report = Thinreports::Report.new layout: 'basic_list.tlf' 7 | 8 | 30.times do |t| 9 | # Internaly #start_new_page() method is called, 10 | # the page break automatically. 11 | # 12 | # [NOTE] In thinreports < 0.7.5: 13 | # report.page.list(:default).add_row do |row| 14 | # : 15 | report.list.add_row do |row| 16 | row.item(:detail).value("row##{t}") 17 | end 18 | end 19 | 20 | # [NOTE] In thinreports < 0.7.7: 21 | # report.generate_file 'basic_list.pdf' 22 | report.generate filename: 'result.pdf' 23 | -------------------------------------------------------------------------------- /list/basic/basic_list.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 555.2, 12 | "height": 40, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 36, 18 | "color": "#000000", 19 | "text-align": "center", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [] 25 | }, 26 | "texts": [ 27 | "List" 28 | ] 29 | }, 30 | { 31 | "id": "default", 32 | "type": "list", 33 | "display": true, 34 | "description": "", 35 | "x": 20, 36 | "y": 72, 37 | "width": 555.2, 38 | "height": 749.8, 39 | "header": { 40 | "enabled": true, 41 | "height": 43, 42 | "translate": { 43 | "x": 0, 44 | "y": 0 45 | }, 46 | "items": [ 47 | { 48 | "id": "", 49 | "type": "line", 50 | "display": true, 51 | "description": "", 52 | "style": { 53 | "border-color": "#000000", 54 | "border-width": 3, 55 | "border-style": "solid" 56 | }, 57 | "x1": 20, 58 | "y1": 115, 59 | "x2": 575.2, 60 | "y2": 115 61 | }, 62 | { 63 | "id": "", 64 | "type": "text", 65 | "display": true, 66 | "description": "", 67 | "x": 20, 68 | "y": 72, 69 | "width": 555.2, 70 | "height": 43, 71 | "style": { 72 | "font-family": [ 73 | "Times New Roman" 74 | ], 75 | "font-size": 22, 76 | "color": "#000000", 77 | "text-align": "center", 78 | "vertical-align": "middle", 79 | "line-height": "", 80 | "line-height-ratio": "", 81 | "letter-spacing": "", 82 | "font-style": [] 83 | }, 84 | "texts": [ 85 | "Header" 86 | ] 87 | } 88 | ] 89 | }, 90 | "detail": { 91 | "height": 31, 92 | "translate": { 93 | "x": 0, 94 | "y": -36.2 95 | }, 96 | "items": [ 97 | { 98 | "id": "detail", 99 | "type": "text-block", 100 | "display": true, 101 | "description": "", 102 | "x": 210.1, 103 | "y": 156.2, 104 | "width": 175, 105 | "height": 19, 106 | "style": { 107 | "font-family": [ 108 | "Times New Roman" 109 | ], 110 | "font-size": 18, 111 | "color": "#000000", 112 | "text-align": "center", 113 | "vertical-align": "top", 114 | "line-height": "", 115 | "line-height-ratio": "", 116 | "letter-spacing": "", 117 | "font-style": [], 118 | "overflow": "truncate", 119 | "word-wrap": "none" 120 | }, 121 | "reference-id": "", 122 | "value": "", 123 | "multiple-line": false, 124 | "format": { 125 | "base": "", 126 | "type": "" 127 | } 128 | }, 129 | { 130 | "id": "", 131 | "type": "line", 132 | "display": true, 133 | "description": "", 134 | "style": { 135 | "border-color": "#000000", 136 | "border-width": 1, 137 | "border-style": "solid" 138 | }, 139 | "x1": 20, 140 | "y1": 182.2, 141 | "x2": 575.2, 142 | "y2": 182.2 143 | } 144 | ] 145 | }, 146 | "page-footer": { 147 | "enabled": false, 148 | "height": 0, 149 | "translate": { 150 | "x": 0, 151 | "y": -84.4 152 | }, 153 | "items": [] 154 | }, 155 | "footer": { 156 | "enabled": false, 157 | "height": 0, 158 | "translate": { 159 | "x": 0, 160 | "y": -143.8 161 | }, 162 | "items": [] 163 | }, 164 | "content-height": 706.8, 165 | "auto-page-break": true 166 | }, 167 | { 168 | "id": "", 169 | "type": "text", 170 | "display": true, 171 | "description": "", 172 | "x": 20, 173 | "y": 20, 174 | "width": 158.2, 175 | "height": 20, 176 | "style": { 177 | "font-family": [ 178 | "Times New Roman" 179 | ], 180 | "font-size": 18, 181 | "color": "#7f7f7f", 182 | "text-align": "left", 183 | "vertical-align": "top", 184 | "line-height": "", 185 | "line-height-ratio": "", 186 | "letter-spacing": "", 187 | "font-style": [ 188 | "italic" 189 | ] 190 | }, 191 | "texts": [ 192 | "Example: Basic List" 193 | ] 194 | } 195 | ], 196 | "state": { 197 | "layout-guides": [] 198 | }, 199 | "title": "", 200 | "report": { 201 | "paper-type": "A4", 202 | "orientation": "portrait", 203 | "margin": [ 204 | 20, 205 | 20, 206 | 20, 207 | 20 208 | ] 209 | } 210 | } -------------------------------------------------------------------------------- /list/group-rows/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /list/group-rows/README.md: -------------------------------------------------------------------------------- 1 | # Group List Rows - Thinreports Examples 2 | 3 | ![Goal](group_rows.png) 4 | 5 | ## How to run 6 | 7 | Bundle in this directory: 8 | 9 | % bundle install 10 | 11 | And execute `group_rows.rb`: 12 | 13 | % bundle exec ruby group_rows.rb 14 | 15 | `result.pdf` will be created. 16 | 17 | ## Requirements 18 | 19 | * ruby >= 1.9.3 20 | * thinreports 0.9.0 21 | -------------------------------------------------------------------------------- /list/group-rows/group_rows.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/list/group-rows/group_rows.pdf -------------------------------------------------------------------------------- /list/group-rows/group_rows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/list/group-rows/group_rows.png -------------------------------------------------------------------------------- /list/group-rows/group_rows.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | Person = Struct.new :name, :blood_type, :age 7 | 8 | people = [ 9 | Person.new('Smith', 'A', 21), 10 | Person.new('Johnson', 'B', 35), 11 | Person.new('James', 'A', 18), 12 | Person.new('Linda', 'O', 25), 13 | Person.new('Robert', 'B', 24), 14 | Person.new('Mary', 'O', 39) 15 | ] 16 | 17 | # Sort people by :blood_type 18 | people.sort_by!(&:blood_type) 19 | 20 | def insert_header(list, blood_group) 21 | list.add_row blood_group: blood_group do |row| 22 | row.item(:border).hide 23 | end 24 | end 25 | 26 | blood_group = nil 27 | 28 | report = Thinreports::Report.new layout: 'group_rows.tlf' 29 | 30 | people.each do |person| 31 | # Insert group header when blood type has changed 32 | unless blood_group == person.blood_type 33 | blood_group = person.blood_type 34 | insert_header(report.list, blood_group) 35 | end 36 | 37 | report.list.add_row do |row| 38 | row.item(:name).value(person.name) 39 | row.item(:age).value(person.age) 40 | end 41 | end 42 | 43 | report.generate filename: 'result.pdf' 44 | -------------------------------------------------------------------------------- /list/group-rows/group_rows.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "default", 6 | "type": "list", 7 | "display": true, 8 | "description": "", 9 | "x": 45, 10 | "y": 110, 11 | "width": 503.2, 12 | "height": 577.2, 13 | "header": { 14 | "enabled": true, 15 | "height": 50, 16 | "translate": { 17 | "x": -1, 18 | "y": 0 19 | }, 20 | "items": [ 21 | { 22 | "id": "", 23 | "type": "line", 24 | "display": true, 25 | "description": "", 26 | "style": { 27 | "border-color": "#000000", 28 | "border-width": 3, 29 | "border-style": "solid" 30 | }, 31 | "x1": 46, 32 | "y1": 160, 33 | "x2": 547.2, 34 | "y2": 160 35 | }, 36 | { 37 | "id": "", 38 | "type": "text", 39 | "display": true, 40 | "description": "", 41 | "x": 65, 42 | "y": 110, 43 | "width": 124.1, 44 | "height": 50, 45 | "style": { 46 | "font-family": [ 47 | "Helvetica" 48 | ], 49 | "font-size": 20, 50 | "color": "#000000", 51 | "text-align": "left", 52 | "vertical-align": "middle", 53 | "line-height": "", 54 | "line-height-ratio": "", 55 | "letter-spacing": "", 56 | "font-style": [] 57 | }, 58 | "texts": [ 59 | "Name" 60 | ] 61 | }, 62 | { 63 | "id": "", 64 | "type": "text", 65 | "display": true, 66 | "description": "", 67 | "x": 415, 68 | "y": 110, 69 | "width": 124.1, 70 | "height": 50, 71 | "style": { 72 | "font-family": [ 73 | "Helvetica" 74 | ], 75 | "font-size": 20, 76 | "color": "#000000", 77 | "text-align": "center", 78 | "vertical-align": "middle", 79 | "line-height": "", 80 | "line-height-ratio": "", 81 | "letter-spacing": "", 82 | "font-style": [] 83 | }, 84 | "texts": [ 85 | "Age" 86 | ] 87 | } 88 | ] 89 | }, 90 | "detail": { 91 | "height": 49.1, 92 | "translate": { 93 | "x": -1, 94 | "y": -7.4 95 | }, 96 | "items": [ 97 | { 98 | "id": "", 99 | "type": "line", 100 | "display": true, 101 | "description": "", 102 | "style": { 103 | "border-color": "#000000", 104 | "border-width": 1, 105 | "border-style": "solid" 106 | }, 107 | "x1": 46, 108 | "y1": 216.5, 109 | "x2": 547.2, 110 | "y2": 216.5 111 | }, 112 | { 113 | "id": "border", 114 | "type": "line", 115 | "display": true, 116 | "description": "", 117 | "style": { 118 | "border-color": "#000000", 119 | "border-width": 1, 120 | "border-style": "solid" 121 | }, 122 | "x1": 403, 123 | "y1": 167.4, 124 | "x2": 403, 125 | "y2": 216.5 126 | }, 127 | { 128 | "id": "name", 129 | "type": "text-block", 130 | "display": true, 131 | "description": "", 132 | "x": 63, 133 | "y": 183, 134 | "width": 322.1, 135 | "height": 18, 136 | "style": { 137 | "font-family": [ 138 | "Helvetica" 139 | ], 140 | "font-size": 18, 141 | "color": "#000000", 142 | "text-align": "left", 143 | "vertical-align": "top", 144 | "line-height": "", 145 | "line-height-ratio": "", 146 | "letter-spacing": "", 147 | "font-style": [], 148 | "overflow": "truncate", 149 | "word-wrap": "none" 150 | }, 151 | "reference-id": "", 152 | "value": "", 153 | "multiple-line": false, 154 | "format": { 155 | "base": "", 156 | "type": "" 157 | } 158 | }, 159 | { 160 | "id": "age", 161 | "type": "text-block", 162 | "display": true, 163 | "description": "", 164 | "x": 430, 165 | "y": 183, 166 | "width": 96.1, 167 | "height": 18, 168 | "style": { 169 | "font-family": [ 170 | "Helvetica" 171 | ], 172 | "font-size": 18, 173 | "color": "#000000", 174 | "text-align": "center", 175 | "vertical-align": "top", 176 | "line-height": "", 177 | "line-height-ratio": "", 178 | "letter-spacing": "", 179 | "font-style": [], 180 | "overflow": "truncate", 181 | "word-wrap": "none" 182 | }, 183 | "reference-id": "", 184 | "value": "", 185 | "multiple-line": false, 186 | "format": { 187 | "base": "", 188 | "type": "" 189 | } 190 | }, 191 | { 192 | "id": "blood_group", 193 | "type": "text-block", 194 | "display": true, 195 | "description": "", 196 | "x": 205.1, 197 | "y": 179, 198 | "width": 185.1, 199 | "height": 26, 200 | "style": { 201 | "font-family": [ 202 | "Helvetica" 203 | ], 204 | "font-size": 26, 205 | "color": "#000000", 206 | "text-align": "center", 207 | "vertical-align": "top", 208 | "line-height": "", 209 | "line-height-ratio": "", 210 | "letter-spacing": "", 211 | "font-style": [ 212 | "bold" 213 | ], 214 | "overflow": "truncate", 215 | "word-wrap": "none" 216 | }, 217 | "reference-id": "", 218 | "value": "", 219 | "multiple-line": false, 220 | "format": { 221 | "base": "Blood type: {value}", 222 | "type": "" 223 | } 224 | } 225 | ] 226 | }, 227 | "page-footer": { 228 | "enabled": false, 229 | "height": 0, 230 | "translate": { 231 | "x": -1, 232 | "y": -15.7 233 | }, 234 | "items": [] 235 | }, 236 | "footer": { 237 | "enabled": false, 238 | "height": 0, 239 | "translate": { 240 | "x": -1, 241 | "y": -58.8 242 | }, 243 | "items": [] 244 | }, 245 | "content-height": 527.2, 246 | "auto-page-break": true 247 | }, 248 | { 249 | "id": "", 250 | "type": "text", 251 | "display": true, 252 | "description": "", 253 | "x": 20, 254 | "y": 50, 255 | "width": 555.2, 256 | "height": 37, 257 | "style": { 258 | "font-family": [ 259 | "Helvetica" 260 | ], 261 | "font-size": 26, 262 | "color": "#000000", 263 | "text-align": "center", 264 | "vertical-align": "middle", 265 | "line-height": "", 266 | "line-height-ratio": "", 267 | "letter-spacing": "", 268 | "font-style": [] 269 | }, 270 | "texts": [ 271 | "People" 272 | ] 273 | } 274 | ], 275 | "state": { 276 | "layout-guides": [] 277 | }, 278 | "title": "", 279 | "report": { 280 | "paper-type": "A4", 281 | "orientation": "portrait", 282 | "margin": [ 283 | 20, 284 | 20, 285 | 20, 286 | 20 287 | ] 288 | } 289 | } -------------------------------------------------------------------------------- /multiple-layout/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /multiple-layout/README.md: -------------------------------------------------------------------------------- 1 | # Use Multiple Layouts - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `multiple_layout.rb`: 10 | 11 | % bundle exec ruby multiple_layout.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | -------------------------------------------------------------------------------- /multiple-layout/multiple_layout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/multiple-layout/multiple_layout.pdf -------------------------------------------------------------------------------- /multiple-layout/multiple_layout.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | report = Thinreports::Report.create do 7 | use_layout 'multiple_layout_default', default: true 8 | use_layout 'multiple_layout_cover', id: :cover 9 | 10 | # Add :cover layout (using multiple_layouts_cover.tlf). 11 | start_new_page layout: :cover 12 | 13 | # Add 5 page using :default layout (multiple_layouts_default.tlf). 14 | 5.times do |t| 15 | start_new_page do |page| 16 | page.item(:content).value(t + 1) 17 | end 18 | end 19 | 20 | # Add "multiple_layouts_back_cover.tlf" layout. 21 | start_new_page layout: 'multiple_layout_back_cover.tlf' 22 | end 23 | 24 | report.generate filename: 'result.pdf' 25 | -------------------------------------------------------------------------------- /multiple-layout/multiple_layout_back_cover.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 196.3, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: Multiple Layouts" 30 | ] 31 | }, 32 | { 33 | "id": "", 34 | "type": "text", 35 | "display": true, 36 | "description": "", 37 | "x": 20, 38 | "y": 374.9, 39 | "width": 555.2, 40 | "height": 92, 41 | "style": { 42 | "font-family": [ 43 | "Times New Roman" 44 | ], 45 | "font-size": 60, 46 | "color": "#000000", 47 | "text-align": "center", 48 | "vertical-align": "middle", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [] 53 | }, 54 | "texts": [ 55 | "Back Cover" 56 | ] 57 | } 58 | ], 59 | "state": { 60 | "layout-guides": [] 61 | }, 62 | "title": "", 63 | "report": { 64 | "paper-type": "A4", 65 | "orientation": "portrait", 66 | "margin": [ 67 | 20, 68 | 20, 69 | 20, 70 | 20 71 | ] 72 | } 73 | } -------------------------------------------------------------------------------- /multiple-layout/multiple_layout_cover.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 374.9, 11 | "width": 555.2, 12 | "height": 92, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 60, 18 | "color": "#000000", 19 | "text-align": "center", 20 | "vertical-align": "middle", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [] 25 | }, 26 | "texts": [ 27 | "Cover" 28 | ] 29 | }, 30 | { 31 | "id": "", 32 | "type": "text", 33 | "display": true, 34 | "description": "", 35 | "x": 20, 36 | "y": 20, 37 | "width": 196.3, 38 | "height": 20, 39 | "style": { 40 | "font-family": [ 41 | "Times New Roman" 42 | ], 43 | "font-size": 18, 44 | "color": "#7f7f7f", 45 | "text-align": "left", 46 | "vertical-align": "top", 47 | "line-height": "", 48 | "line-height-ratio": "", 49 | "letter-spacing": "", 50 | "font-style": [ 51 | "italic" 52 | ] 53 | }, 54 | "texts": [ 55 | "Example: Multiple Layouts" 56 | ] 57 | } 58 | ], 59 | "state": { 60 | "layout-guides": [] 61 | }, 62 | "title": "", 63 | "report": { 64 | "paper-type": "A4", 65 | "orientation": "portrait", 66 | "margin": [ 67 | 20, 68 | 20, 69 | 20, 70 | 20 71 | ] 72 | } 73 | } -------------------------------------------------------------------------------- /multiple-layout/multiple_layout_default.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 196.3, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: Multiple Layouts" 30 | ] 31 | }, 32 | { 33 | "id": "content", 34 | "type": "text-block", 35 | "display": true, 36 | "description": "", 37 | "x": 265, 38 | "y": 264.1, 39 | "width": 320.2, 40 | "height": 67, 41 | "style": { 42 | "font-family": [ 43 | "Times New Roman" 44 | ], 45 | "font-size": 60, 46 | "color": "#000000", 47 | "text-align": "center", 48 | "vertical-align": "top", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [], 53 | "overflow": "truncate", 54 | "word-wrap": "none" 55 | }, 56 | "reference-id": "", 57 | "value": "", 58 | "multiple-line": false, 59 | "format": { 60 | "base": "", 61 | "type": "" 62 | } 63 | } 64 | ], 65 | "state": { 66 | "layout-guides": [] 67 | }, 68 | "title": "", 69 | "report": { 70 | "paper-type": "A4", 71 | "orientation": "landscape", 72 | "margin": [ 73 | 20, 74 | 20, 75 | 20, 76 | 20 77 | ] 78 | } 79 | } -------------------------------------------------------------------------------- /permission/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /permission/README.md: -------------------------------------------------------------------------------- 1 | # Security and Permission - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `permisson.rb`: 10 | 11 | % bundle exec ruby permission.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | 20 | ## References 21 | 22 | * [Prawn::Document#encrypt_document](http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Document/Security.html#method-i-encrypt_document) 23 | -------------------------------------------------------------------------------- /permission/permission.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/permission/permission.pdf -------------------------------------------------------------------------------- /permission/permission.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | report = Thinreports::Report.new layout: 'permission.tlf' 7 | report.start_new_page 8 | 9 | # See more details: 10 | # [Prawn Documentation] 11 | # http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Document/Security.html#method-i-encrypt_document 12 | security_settings = { 13 | user_password: 'foo', 14 | owner_password: :random, 15 | permissions: { 16 | print_document: false, 17 | modify_contents: false, 18 | copy_contents: false 19 | } 20 | } 21 | 22 | report.generate filename: 'result.pdf', security: security_settings 23 | -------------------------------------------------------------------------------- /permission/permission.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 172.2, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: PDF Security" 30 | ] 31 | }, 32 | { 33 | "id": "", 34 | "type": "text", 35 | "display": true, 36 | "description": "", 37 | "x": 130, 38 | "y": 131, 39 | "width": 239, 40 | "height": 55, 41 | "style": { 42 | "font-family": [ 43 | "Helvetica" 44 | ], 45 | "font-size": 36, 46 | "color": "#000000", 47 | "text-align": "left", 48 | "vertical-align": "middle", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [] 53 | }, 54 | "texts": [ 55 | "Encryption" 56 | ] 57 | }, 58 | { 59 | "id": "", 60 | "type": "image", 61 | "display": true, 62 | "description": "", 63 | "x": 60, 64 | "y": 131, 65 | "width": 55, 66 | "height": 55, 67 | "data": { 68 | "mime-type": "image/png", 69 | "base64": "iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8wOC8xMd+oxXIAAAAfdEVYdFNvZnR3YXJlAE1hY3JvbWVkaWEgRmlyZXdvcmtzIDi1aNJ4AAAM00lEQVRogd2aeZBUx33HP93vzZvZnb2XvViWSwgBuhAGYwhChzFYRUBCVoQkQhE7lVipyErFLscpuewqOXJKJSeVw/kjd1mlUg7LiqSSiLBkIIIUlpBZpCCJQ8By7LLsPTs7MzvzXh/5472ZXQyOAC1XflU986am59e/b/fvnhbWWsv/U3KvtADnQxaLQBQ/UHxMqxSd6ZMEfkBDWROTq1tLv9DWIq6pk4uAjaocLxx+jtdPvkJn9iTKBNQ7DSyqvJ2H525kdsvccOo1BQ4Y9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W/zWKHR2mCUjmxIh8/WoAPQKYlVYLVBa4PSGmUUSmsKvk9DVR0n9vUwT322lGKFq04ssF8BboysBceTPHr317hPbqL7/X4KJo+xtgRMq+JQBEahjCJQhkBbAm0ItEErQ973qfTK0VmF+p8465duIFF5CQztfMEhQifgxB2+uuL3uT++iZ6PUhRsHm3DWBUYjTKaQFuUMuHQGqU0QQQ+CBTGQG2ymq53B1nReh9z5t1wSYF9IjjB2B0P13N49K7HuTexkd7DQ4ySD917YAmUJlAaHYRDKU2gFFqpyPUH1JQn6e8apKnvBlYvWwPOJcd2/hWgtRbpCb56+2N80XmQ/mPDBPgoE6CVQWlVGloFaK1QShH4AViLA2T3wgPzH6G+ueYSQhqj8y9vRejRvITH15Z9nduDVfR1DRAQAQoCVGlEn/0Av+BTmSind/8wS+JfYNnCJSE/O9Z5vlR03uAEolSLlSfL+cayJ5ifXUJfbx9KF0qglFLhu2/wA4XruORH8tSemML9Sx/ALXcp5iGX+tLZhTUmxt2zqq+r51u/9idMH57DYDqFMTa0sSB0KoEK0FojYpbMIcXaGeuZNXtWkVF0rWni3f94uui+pcUyrXkq31rwPar7Gkjlh8NYpnyCICBQPkIaUqdGuLWwlJWLv3hZnMh4+tRN2c9cv5A/mPsEplsylB9C6RBYwfqkcyNUdDTy4PwN1DRXTYS8F0QX3agYr1JrbltHupDmh/ufoa+sEzcWI/ADqk40sH7ml1m0YNGECHvBMk7kZdKf79/Fv+55lmOpI9Toeu6ZupY1d91HRU1yopa4IJoQcMWmKkCQU/QN9lIWL6O2rvay29l4+l9vy4FwMBJ3KwAAAABJRU5ErkJggg==" 70 | } 71 | }, 72 | { 73 | "id": "", 74 | "type": "text", 75 | "display": true, 76 | "description": "", 77 | "x": 130, 78 | "y": 202.1, 79 | "width": 324, 80 | "height": 55, 81 | "style": { 82 | "font-family": [ 83 | "Helvetica" 84 | ], 85 | "font-size": 36, 86 | "color": "#000000", 87 | "text-align": "left", 88 | "vertical-align": "middle", 89 | "line-height": "", 90 | "line-height-ratio": "", 91 | "letter-spacing": "", 92 | "font-style": [] 93 | }, 94 | "texts": [ 95 | "Password Protected" 96 | ] 97 | }, 98 | { 99 | "id": "", 100 | "type": "image", 101 | "display": true, 102 | "description": "", 103 | "x": 60, 104 | "y": 202.1, 105 | "width": 55, 106 | "height": 55, 107 | "data": { 108 | "mime-type": "image/png", 109 | "base64": "iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8wOC8xMd+oxXIAAAAfdEVYdFNvZnR3YXJlAE1hY3JvbWVkaWEgRmlyZXdvcmtzIDi1aNJ4AAAM00lEQVRogd2aeZBUx33HP93vzZvZnb2XvViWSwgBuhAGYwhChzFYRUBCVoQkQhE7lVipyErFLscpuewqOXJKJSeVw/kjd1mlUg7LiqSSiLBkIIIUlpBZpCCJQ8By7LLsPTs7MzvzXh/5472ZXQyOAC1XflU986am59e/b/fvnhbWWsv/U3KvtADnQxaLQBQ/UHxMqxSd6ZMEfkBDWROTq1tLv9DWIq6pk4uAjaocLxx+jtdPvkJn9iTKBNQ7DSyqvJ2H525kdsvccOo1BQ4Y9lM8+c4f8WrXj3EcB9f1EFJircL3FTMKs/n2wj9l+dy7rg1wRbXMqizf2/1N/qPzX6gqqyEmYyBChRUIrGMZHk1x/eDN/M09/3xt2JxAYLH87Qd/waunfkJ9chKuDEUXQiCEKM2tra6lY+QgOz7acW2AA3jj5MvszmymprIaaV1c6YQnGp2cFeEmSCGIJWIMZYeQV1roc5PFYiGymPbe3ewYfpG6uipcYjiORDoSKaMRPQtH4MYliXQlbWWtV+vJCcCCEHSPdPGfPT9iNJHi4xM9SFfiSglIQCCEAQlWQ7IiTmagwE2ZBXx29pKrFVyoYnmV56WTPyJT1k1Hbz9KBHiOB8KW7EzgoKylvNIlQRy5v55Ni36XlqmTry5wYRgbC9lbjr/ECbed09kUqXyGuOch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fR1DRAQAQoCVGlEn/0Av+BTmSind/8wS+JfYNnCJSE/O9Z5vlR03uAEolSLlSfL+cayJ5ifXUJfbx9KF0qglFLhu2/wA4XruORH8tSemML9Sx/ALXcp5iGX+tLZhTUmxt2zqq+r51u/9idMH57DYDqFMTa0sSB0KoEK0FojYpbMIcXaGeuZNXtWkVF0rWni3f94uui+pcUyrXkq31rwPar7Gkjlh8NYpnyCICBQPkIaUqdGuLWwlJWLv3hZnMh4+tRN2c9cv5A/mPsEplsylB9C6RBYwfqkcyNUdDTy4PwN1DRXTYS8F0QX3agYr1JrbltHupDmh/ufoa+sEzcWI/ADqk40sH7ml1m0YNGECHvBMk7kZdKf79/Fv+55lmOpI9Toeu6ZupY1d91HRU1yopa4IJoQcMWmKkCQU/QN9lIWL6O2rvay29l4+l9vy4FwMBJ3KwAAAABJRU5ErkJggg==" 110 | } 111 | }, 112 | { 113 | "id": "", 114 | "type": "text", 115 | "display": true, 116 | "description": "", 117 | "x": 130, 118 | "y": 275.1, 119 | "width": 239, 120 | "height": 55, 121 | "style": { 122 | "font-family": [ 123 | "Helvetica" 124 | ], 125 | "font-size": 36, 126 | "color": "#000000", 127 | "text-align": "left", 128 | "vertical-align": "middle", 129 | "line-height": "", 130 | "line-height-ratio": "", 131 | "letter-spacing": "", 132 | "font-style": [] 133 | }, 134 | "texts": [ 135 | "Printing" 136 | ] 137 | }, 138 | { 139 | "id": "", 140 | "type": "image", 141 | "display": true, 142 | "description": "", 143 | "x": 60, 144 | "y": 275.1, 145 | "width": 52.9, 146 | "height": 55, 147 | "data": { 148 | "mime-type": "image/png", 149 | "base64": "iVBORw0KGgoAAAANSUhEUgAAADUAAAA2CAYAAABnctHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAA+FSURBVGiBxZprjFxl3cB/z3PO3Heme3GvvWwrbVe2chEjxeYlCEZCUgE1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kSNkKhXalaI6M4OTzxONRIhEoz5Eix+ZloVbqXDINHEfeYRPfPazTb50WiiAfz3xBMZPfkJlbg6vMewuN4KWQLK9nfbVq0l0deHGYhj49SP4tp7QNFJSorsuTrlMrVDAq1SIaJqfWHUdrUEzenC0HAe1uMjRWo3ivffyyZ07iUQiy1rEaXfn9/7wh5R/9COEaeIs0yVqLEyFlH4Tx3XRdJ1ILEY0mUSPx33fAP8FENtGOY4/eV33R2OEC4568J1hWUjDYMy2WfzGN7h8504/EbeY3RlDAfzrqaeYuP9+VtVq2EGgOBVU45JdsrQwbAzPIYBsOA9BZAOQAgzTJGJZHE4kEN/8Jh+/4QYikcgpgc4YCmD0r3/l4D33kD5yBMfzILhoU5Xd6NyNPbmWgrVxLVT/HJpaUPtZjoNnWXiuy9GhITruu4+LrriiDv5BclbvJuWnp/nPww9TfOYZVgU1l9S0ev5qrNuW7fa0tLRazU0Ige15uLaN5rpMahpqxw7W79rFmjVr6r85nZzTW2QjL73E2OOPY//zn7S5rp/LgifeqC3Roi1tGe2EL2q5nodyXTSlmFUK75praL/lFoa3bTutuZ0XKICaYTD+0ktMPPMMxVdeocMw0FnyobrfNGglBA1F+RNAAiZQTKfRr7qK9A03sHHbNjKZTHPq+G9DheK6Ltn33iP3t7+Rf/VVavv3I+fmSAm/DdzUZAmGEgIbqAD09xPdsoXktm20b9vG4ObN9fciziSB/1egGsUwDI5PTlI5coTq2BjViQmcQgG3WkW5rr8Lkk4T6eoivnYtifXrSQ0O0jcwQCqVWprUWWqmVc4r1HLieR5OuKOC//RP93rPSuV/Aere+qLgrhBbAAAAAElFTkSuQmCC" 150 | } 151 | }, 152 | { 153 | "id": "", 154 | "type": "text", 155 | "display": true, 156 | "description": "", 157 | "x": 130, 158 | "y": 346.1, 159 | "width": 394.1, 160 | "height": 55, 161 | "style": { 162 | "font-family": [ 163 | "Helvetica" 164 | ], 165 | "font-size": 36, 166 | "color": "#000000", 167 | "text-align": "left", 168 | "vertical-align": "middle", 169 | "line-height": "", 170 | "line-height-ratio": "", 171 | "letter-spacing": "", 172 | "font-style": [] 173 | }, 174 | "texts": [ 175 | "Changing the Document" 176 | ] 177 | }, 178 | { 179 | "id": "", 180 | "type": "image", 181 | "display": true, 182 | "description": "", 183 | "x": 60, 184 | "y": 346.1, 185 | "width": 52.9, 186 | "height": 55, 187 | "data": { 188 | "mime-type": "image/png", 189 | "base64": "iVBORw0KGgoAAAANSUhEUgAAADUAAAA2CAYAAABnctHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAA+FSURBVGiBxZprjFxl3cB/z3PO3Heme3GvvWwrbVe2chEjxeYlCEZCUgE1USsUhHL54IcaDEGMCiLihQjEfhDUiJqQqIHwwYghxMjFKJSAIJZettvtdvbazs7szm3n3J/3wzlndma6pZet7/tPnpwzs7PnPL/zvz7/5willOI8SnlyksXRUczZWYy5OVSthmua4HkoKdHicWQqRbSri/jAAMlNm8j09p7PKSDOB1T+7bcpv/MOtbEx3FKJhKYR1XUE4DoOyvNQgBACKSWapuEpRc00sYRAdnWR2LiRVVdcQeemTf9/UJ7nMfvCCxTfeAOvUKAjncao1agsLGAWizi1Gp5tg1L+gKWjEEhdR08kSKxaRVt7O5FolPlaDW31atJXXsmaq6/+v4Wa+stfKL/2GknbRilFYXoaI59H2TYimDSNxwBMNcKFn10X5XnIaJRUVxedfX0sOg52Xx+d27cz8MlP/nehitkss7/7HbH5eQByY2PYpRIC37RUOOFQWmEavqPlt0oplOuiXJdYJkPP2rUUbRvtsstYd+edZFatOv9QUy++SPGFF+hIp5kZHcWYm0NKWZ/QB8K0aAhY/gGE4nl4tk2yo4Pu/n7yqRQ9d93F6o9//PxBjT39NN477wCQO3QI4bog5dLEWyZUn/ByMC0gIjg2TSL8reeB59HT309Z18ns2sWm669fOdShn/2MtslJCrkc5WwWqWlLk/O85om0mJoMJi2FqH/veZ5vaq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jKZTHPq+G9DheK6Ltn33iP3t7+Rf/VVavv3I+fmSAm/DdzUZAmGEgIbqAD09xPdsoXktm20b9vG4ObN9fciziSB/1egGsUwDI5PTlI5coTq2BjViQmcQgG3WkW5rr8Lkk4T6eoivnYtifXrSQ0O0jcwQCqVWprUWWqmVc4r1HLieR5OuKOC//RP93rPSuV/Aere+qLgrhBbAAAAAElFTkSuQmCC" 190 | } 191 | }, 192 | { 193 | "id": "", 194 | "type": "text", 195 | "display": true, 196 | "description": "", 197 | "x": 130, 198 | "y": 422.1, 199 | "width": 272, 200 | "height": 55, 201 | "style": { 202 | "font-family": [ 203 | "Helvetica" 204 | ], 205 | "font-size": 36, 206 | "color": "#000000", 207 | "text-align": "left", 208 | "vertical-align": "middle", 209 | "line-height": "", 210 | "line-height-ratio": "", 211 | "letter-spacing": "", 212 | "font-style": [] 213 | }, 214 | "texts": [ 215 | "Content Copying" 216 | ] 217 | }, 218 | { 219 | "id": "", 220 | "type": "image", 221 | "display": true, 222 | "description": "", 223 | "x": 60, 224 | "y": 422.1, 225 | "width": 52.9, 226 | "height": 55, 227 | "data": { 228 | "mime-type": "image/png", 229 | "base64": "iVBORw0KGgoAAAANSUhEUgAAADUAAAA2CAYAAABnctHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAA+FSURBVGiBxZprjFxl3cB/z3PO3Heme3GvvWwrbVe2chEjxeYlCEZCUgE1USsUhHL54IcaDEGMCiLihQjEfhDUiJqQqIHwwYghxMjFKJSAIJZettvtdvbazs7szm3n3J/3wzlndma6pZet7/tPnpwzs7PnPL/zvz7/5willOI8SnlyksXRUczZWYy5OVSthmua4HkoKdHicWQqRbSri/jAAMlNm8j09p7PKSDOB1T+7bcpv/MOtbEx3FKJhKYR1XUE4DoOyvNQgBACKSWapuEpRc00sYRAdnWR2LiRVVdcQeemTf9/UJ7nMfvCCxT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C4568J1hWUjDYMy2WfzGN7h8504/EbeY3RlDAfzrqaeYuP9+VtVq2EGgOBVU45JdsrQwbAzPIYBsOA9BZAOQAgzTJGJZHE4kEN/8Jh+/4QYikcgpgc4YCmD0r3/l4D33kD5yBMfzILhoU5Xd6NyNPbmWgrVxLVT/HJpaUPtZjoNnWXiuy9GhITruu4+LrriiDv5BclbvJuWnp/nPww9TfOYZVgU1l9S0ev5qrNuW7fa0tLRazU0Ige15uLaN5rpMahpqxw7W79rFmjVr6r85nZzTW2QjL73E2OOPY//zn7S5rp/LgifeqC3Roi1tGe2EL2q5nodyXTSlmFUK75praL/lFoa3bTutuZ0XKICaYTD+0ktMPPMMxVdeocMw0FnyobrfNGglBA1F+RNAAiZQTKfRr7qK9A03sHHbNjKZTHPq+G9DheK6Ltn33iP3t7+Rf/VVavv3I+fmSAm/DdzUZAmGEgIbqAD09xPdsoXktm20b9vG4ObN9fciziSB/1egGsUwDI5PTlI5coTq2BjViQmcQgG3WkW5rr8Lkk4T6eoivnYtifXrSQ0O0jcwQCqVWprUWWqmVc4r1HLieR5OuKOC//RP93rPSuV/Aere+qLgrhBbAAAAAElFTkSuQmCC" 230 | } 231 | } 232 | ], 233 | "state": { 234 | "layout-guides": [] 235 | }, 236 | "title": "Example Security", 237 | "report": { 238 | "paper-type": "A4", 239 | "orientation": "portrait", 240 | "margin": [ 241 | 20, 242 | 20, 243 | 20, 244 | 20 245 | ] 246 | } 247 | } -------------------------------------------------------------------------------- /text-block/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'thinreports' 4 | -------------------------------------------------------------------------------- /text-block/README.md: -------------------------------------------------------------------------------- 1 | # TextBlock Tool - Thinreports Examples 2 | 3 | ## How to run 4 | 5 | Bundle in this directory: 6 | 7 | % bundle install 8 | 9 | Then execute `text_block.rb`: 10 | 11 | % bundle exec ruby text_block.rb 12 | 13 | `result.pdf` will be created. 14 | 15 | ## Requirements 16 | 17 | * ruby >= 1.9.3 18 | * thinreports 0.9.0 19 | 20 | ## Tips 21 | 22 | ### Rotation of the TextBlock 23 | 24 | See this [article](http://qiita.com/hidakatsuya/items/27c98d69e29d20056a69) (Japanese) 25 | -------------------------------------------------------------------------------- /text-block/text_block.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinreports/thinreports-examples/c1183f9aee8a0b4df47a1cd9ccde68c4087efb08/text-block/text_block.pdf -------------------------------------------------------------------------------- /text-block/text_block.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | require 'bundler' 4 | Bundler.require 5 | 6 | Thinreports::Report.generate filename: 'result.pdf', layout: 'text_block.tlf' do 7 | start_new_page 8 | 9 | # Basic Features 10 | page.item(:single_line_left).value('Left(Default)') 11 | page[:single_line_center].value = 'Center' 12 | # Item#set(value, style_settings = {}) 13 | page.item('single_line_right').set('Right') 14 | page.item(:multi_line).value("Thinreports Text Block Tool.\n" + "Thinreports Text Block Tool.") 15 | 16 | # Simple Format 17 | page.values datetime_format: Time.now, 18 | number_format: 99999.9999, padding_format: 999, basic_format: 1980 19 | 20 | # Dynamic Style 21 | page.values bold_and_italic: "To bold from normal.\nTo italic from normal.", 22 | underline_and_linethrough: "To underline from normal.\nTo line-through from normal.", 23 | font_size_12: 'To 18 from 12', font_color_black: 'To red from black.', 24 | text_align_and_vertical_align: "To right from left.\nTo bottom from top." 25 | 26 | # Item#style(:visible, true) == Item#show or Item.visible(true) 27 | page.item(:show_text_block).style(:visible, true).value = 'To true from false.' 28 | page.item(:bold_and_italic).styles(bold: true, italic: true) 29 | page.item(:underline_and_linethrough).styles(underline: true, linethrough: true) 30 | page.item(:font_size_12).style(:font_size, 18) 31 | page.item(:font_color_black).style(:color, 'red') 32 | page.item(:text_align_and_vertical_align).styles(align: :right, valign: :bottom) 33 | end 34 | -------------------------------------------------------------------------------- /text-block/text_block.tlf: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.9.0", 3 | "items": [ 4 | { 5 | "id": "", 6 | "type": "text", 7 | "display": true, 8 | "description": "", 9 | "x": 20, 10 | "y": 20, 11 | "width": 231.2, 12 | "height": 20, 13 | "style": { 14 | "font-family": [ 15 | "Times New Roman" 16 | ], 17 | "font-size": 18, 18 | "color": "#7f7f7f", 19 | "text-align": "left", 20 | "vertical-align": "top", 21 | "line-height": "", 22 | "line-height-ratio": "", 23 | "letter-spacing": "", 24 | "font-style": [ 25 | "italic" 26 | ] 27 | }, 28 | "texts": [ 29 | "Example: Text Block Tool" 30 | ] 31 | }, 32 | { 33 | "id": "", 34 | "type": "text", 35 | "display": true, 36 | "description": "", 37 | "x": 20, 38 | "y": 395, 39 | "width": 200, 40 | "height": 26.2, 41 | "style": { 42 | "font-family": [ 43 | "Times New Roman" 44 | ], 45 | "font-size": 24, 46 | "color": "#000000", 47 | "text-align": "right", 48 | "vertical-align": "middle", 49 | "line-height": "", 50 | "line-height-ratio": "", 51 | "letter-spacing": "", 52 | "font-style": [] 53 | }, 54 | "texts": [ 55 | "Datetime Format:" 56 | ] 57 | }, 58 | { 59 | "id": "datetime_format", 60 | "type": "text-block", 61 | "display": true, 62 | "description": "", 63 | "x": 233, 64 | "y": 395, 65 | "width": 342.2, 66 | "height": 26, 67 | "style": { 68 | "font-family": [ 69 | "Times New Roman" 70 | ], 71 | "font-size": 24, 72 | "color": "#000000", 73 | "text-align": "left", 74 | "vertical-align": "top", 75 | "line-height": "", 76 | "line-height-ratio": "", 77 | "letter-spacing": "", 78 | "font-style": [], 79 | "overflow": "truncate", 80 | "word-wrap": "none" 81 | }, 82 | "reference-id": "", 83 | "value": "", 84 | "multiple-line": false, 85 | "format": { 86 | "base": "", 87 | "type": "datetime", 88 | "datetime": { 89 | "format": "%Y/%m/%d" 90 | } 91 | } 92 | }, 93 | { 94 | "id": "", 95 | "type": "text", 96 | "display": true, 97 | "description": "", 98 | "x": 20, 99 | "y": 335, 100 | "width": 555.2, 101 | "height": 40, 102 | "style": { 103 | "font-family": [ 104 | "Times New Roman" 105 | ], 106 | "font-size": 36, 107 | "color": "#000000", 108 | "text-align": "left", 109 | "vertical-align": "top", 110 | "line-height": "", 111 | "line-height-ratio": "", 112 | "letter-spacing": "", 113 | "font-style": [] 114 | }, 115 | "texts": [ 116 | "Simple Format" 117 | ] 118 | }, 119 | { 120 | "id": "", 121 | "type": "line", 122 | "display": true, 123 | "description": "", 124 | "style": { 125 | "border-color": "#7f7f7f", 126 | "border-width": 3, 127 | "border-style": "solid" 128 | }, 129 | "x1": 20, 130 | "y1": 376.1, 131 | "x2": 575.2, 132 | "y2": 376.1 133 | }, 134 | { 135 | "id": "", 136 | "type": "text", 137 | "display": true, 138 | "description": "", 139 | "x": 20, 140 | "y": 430, 141 | "width": 200, 142 | "height": 26.2, 143 | "style": { 144 | "font-family": [ 145 | "Times New Roman" 146 | ], 147 | "font-size": 24, 148 | "color": "#000000", 149 | "text-align": "right", 150 | "vertical-align": "middle", 151 | "line-height": "", 152 | "line-height-ratio": "", 153 | "letter-spacing": "", 154 | "font-style": [] 155 | }, 156 | "texts": [ 157 | "Number Format:" 158 | ] 159 | }, 160 | { 161 | "id": "number_format", 162 | "type": "text-block", 163 | "display": true, 164 | "description": "", 165 | "x": 233, 166 | "y": 430, 167 | "width": 342.2, 168 | "height": 26, 169 | "style": { 170 | "font-family": [ 171 | "Times New Roman" 172 | ], 173 | "font-size": 24, 174 | "color": "#000000", 175 | "text-align": "left", 176 | "vertical-align": "top", 177 | "line-height": "", 178 | "line-height-ratio": "", 179 | "letter-spacing": "", 180 | "font-style": [], 181 | "overflow": "truncate", 182 | "word-wrap": "none" 183 | }, 184 | "reference-id": "", 185 | "value": "", 186 | "multiple-line": false, 187 | "format": { 188 | "base": "", 189 | "type": "number", 190 | "number": { 191 | "delimiter": ",", 192 | "precision": 3 193 | } 194 | } 195 | }, 196 | { 197 | "id": "", 198 | "type": "text", 199 | "display": true, 200 | "description": "", 201 | "x": 20, 202 | "y": 465, 203 | "width": 200, 204 | "height": 26.2, 205 | "style": { 206 | "font-family": [ 207 | "Times New Roman" 208 | ], 209 | "font-size": 24, 210 | "color": "#000000", 211 | "text-align": "right", 212 | "vertical-align": "middle", 213 | "line-height": "", 214 | "line-height-ratio": "", 215 | "letter-spacing": "", 216 | "font-style": [] 217 | }, 218 | "texts": [ 219 | "Padding Format:" 220 | ] 221 | }, 222 | { 223 | "id": "padding_format", 224 | "type": "text-block", 225 | "display": true, 226 | "description": "", 227 | "x": 233, 228 | "y": 465, 229 | "width": 342.2, 230 | "height": 26, 231 | "style": { 232 | "font-family": [ 233 | "Times New Roman" 234 | ], 235 | "font-size": 24, 236 | "color": "#000000", 237 | "text-align": "left", 238 | "vertical-align": "top", 239 | "line-height": "", 240 | "line-height-ratio": "", 241 | "letter-spacing": "", 242 | "font-style": [], 243 | "overflow": "truncate", 244 | "word-wrap": "none" 245 | }, 246 | "reference-id": "", 247 | "value": "", 248 | "multiple-line": false, 249 | "format": { 250 | "base": "", 251 | "type": "padding", 252 | "padding": { 253 | "length": 10, 254 | "char": "0", 255 | "direction": "L" 256 | } 257 | } 258 | }, 259 | { 260 | "id": "", 261 | "type": "text", 262 | "display": true, 263 | "description": "", 264 | "x": 20, 265 | "y": 55, 266 | "width": 555.2, 267 | "height": 40, 268 | "style": { 269 | "font-family": [ 270 | "Times New Roman" 271 | ], 272 | "font-size": 36, 273 | "color": "#000000", 274 | "text-align": "left", 275 | "vertical-align": "top", 276 | "line-height": "", 277 | "line-height-ratio": "", 278 | "letter-spacing": "", 279 | "font-style": [] 280 | }, 281 | "texts": [ 282 | "Basic Features" 283 | ] 284 | }, 285 | { 286 | "id": "", 287 | "type": "line", 288 | "display": true, 289 | "description": "", 290 | "style": { 291 | "border-color": "#7f7f7f", 292 | "border-width": 3, 293 | "border-style": "solid" 294 | }, 295 | "x1": 20, 296 | "y1": 96.1, 297 | "x2": 575.2, 298 | "y2": 96.1 299 | }, 300 | { 301 | "id": "", 302 | "type": "text", 303 | "display": true, 304 | "description": "", 305 | "x": 20, 306 | "y": 110, 307 | "width": 200, 308 | "height": 26.2, 309 | "style": { 310 | "font-family": [ 311 | "Times New Roman" 312 | ], 313 | "font-size": 24, 314 | "color": "#000000", 315 | "text-align": "right", 316 | "vertical-align": "middle", 317 | "line-height": "", 318 | "line-height-ratio": "", 319 | "letter-spacing": "", 320 | "font-style": [] 321 | }, 322 | "texts": [ 323 | "Single Line:" 324 | ] 325 | }, 326 | { 327 | "id": "single_line_left", 328 | "type": "text-block", 329 | "display": true, 330 | "description": "", 331 | "x": 233, 332 | "y": 110, 333 | "width": 342.2, 334 | "height": 26, 335 | "style": { 336 | "font-family": [ 337 | "Times New Roman" 338 | ], 339 | "font-size": 24, 340 | "color": "#000000", 341 | "text-align": "left", 342 | "vertical-align": "top", 343 | "line-height": "", 344 | "line-height-ratio": "", 345 | "letter-spacing": "", 346 | "font-style": [], 347 | "overflow": "truncate", 348 | "word-wrap": "none" 349 | }, 350 | "reference-id": "", 351 | "value": "", 352 | "multiple-line": false, 353 | "format": { 354 | "base": "", 355 | "type": "datetime", 356 | "datetime": { 357 | "format": "%Y/%m/%d" 358 | } 359 | } 360 | }, 361 | { 362 | "id": "single_line_center", 363 | "type": "text-block", 364 | "display": true, 365 | "description": "", 366 | "x": 233, 367 | "y": 145, 368 | "width": 342.2, 369 | "height": 26, 370 | "style": { 371 | "font-family": [ 372 | "Times New Roman" 373 | ], 374 | "font-size": 24, 375 | "color": "#000000", 376 | "text-align": "center", 377 | "vertical-align": "top", 378 | "line-height": "", 379 | "line-height-ratio": "", 380 | "letter-spacing": "", 381 | "font-style": [], 382 | "overflow": "truncate", 383 | "word-wrap": "none" 384 | }, 385 | "reference-id": "", 386 | "value": "", 387 | "multiple-line": false, 388 | "format": { 389 | "base": "", 390 | "type": "datetime", 391 | "datetime": { 392 | "format": "%Y/%m/%d" 393 | } 394 | } 395 | }, 396 | { 397 | "id": "single_line_right", 398 | "type": "text-block", 399 | "display": true, 400 | "description": "", 401 | "x": 233, 402 | "y": 180, 403 | "width": 342.2, 404 | "height": 26, 405 | "style": { 406 | "font-family": [ 407 | "Times New Roman" 408 | ], 409 | "font-size": 24, 410 | "color": "#000000", 411 | "text-align": "right", 412 | "vertical-align": "top", 413 | "line-height": "", 414 | "line-height-ratio": "", 415 | "letter-spacing": "", 416 | "font-style": [], 417 | "overflow": "truncate", 418 | "word-wrap": "none" 419 | }, 420 | "reference-id": "", 421 | "value": "", 422 | "multiple-line": false, 423 | "format": { 424 | "base": "", 425 | "type": "datetime", 426 | "datetime": { 427 | "format": "%Y/%m/%d" 428 | } 429 | } 430 | }, 431 | { 432 | "id": "", 433 | "type": "text", 434 | "display": true, 435 | "description": "", 436 | "x": 20, 437 | "y": 215, 438 | "width": 200, 439 | "height": 26.2, 440 | "style": { 441 | "font-family": [ 442 | "Times New Roman" 443 | ], 444 | "font-size": 24, 445 | "color": "#000000", 446 | "text-align": "right", 447 | "vertical-align": "middle", 448 | "line-height": "", 449 | "line-height-ratio": "", 450 | "letter-spacing": "", 451 | "font-style": [] 452 | }, 453 | "texts": [ 454 | "Multi Line:" 455 | ] 456 | }, 457 | { 458 | "id": "multi_line", 459 | "type": "text-block", 460 | "display": true, 461 | "description": "", 462 | "x": 233, 463 | "y": 215, 464 | "width": 342.2, 465 | "height": 104.1, 466 | "style": { 467 | "font-family": [ 468 | "Times New Roman" 469 | ], 470 | "font-size": 24, 471 | "color": "#000000", 472 | "text-align": "left", 473 | "vertical-align": "top", 474 | "line-height": "", 475 | "line-height-ratio": "", 476 | "letter-spacing": "", 477 | "font-style": [], 478 | "overflow": "truncate", 479 | "word-wrap": "none" 480 | }, 481 | "reference-id": "", 482 | "value": "", 483 | "multiple-line": true, 484 | "format": { 485 | "base": "", 486 | "type": "datetime", 487 | "datetime": { 488 | "format": "%Y/%m/%d" 489 | } 490 | } 491 | }, 492 | { 493 | "id": "", 494 | "type": "text", 495 | "display": true, 496 | "description": "", 497 | "x": 20, 498 | "y": 515, 499 | "width": 200, 500 | "height": 26.2, 501 | "style": { 502 | "font-family": [ 503 | "Times New Roman" 504 | ], 505 | "font-size": 24, 506 | "color": "#000000", 507 | "text-align": "right", 508 | "vertical-align": "middle", 509 | "line-height": "", 510 | "line-height-ratio": "", 511 | "letter-spacing": "", 512 | "font-style": [] 513 | }, 514 | "texts": [ 515 | "Basic Format:" 516 | ] 517 | }, 518 | { 519 | "id": "basic_format", 520 | "type": "text-block", 521 | "display": true, 522 | "description": "", 523 | "x": 233, 524 | "y": 515, 525 | "width": 342.2, 526 | "height": 24, 527 | "style": { 528 | "font-family": [ 529 | "IPAMincho" 530 | ], 531 | "font-size": 24, 532 | "color": "#000000", 533 | "text-align": "left", 534 | "vertical-align": "top", 535 | "line-height": "", 536 | "line-height-ratio": "", 537 | "letter-spacing": "", 538 | "font-style": [], 539 | "overflow": "truncate", 540 | "word-wrap": "none" 541 | }, 542 | "reference-id": "", 543 | "value": "", 544 | "multiple-line": false, 545 | "format": { 546 | "base": "¥ {value}", 547 | "type": "number", 548 | "number": { 549 | "delimiter": ",", 550 | "precision": 0 551 | } 552 | } 553 | }, 554 | { 555 | "id": "", 556 | "type": "text", 557 | "display": true, 558 | "description": "", 559 | "x": 20, 560 | "y": 565, 561 | "width": 555.2, 562 | "height": 40, 563 | "style": { 564 | "font-family": [ 565 | "Times New Roman" 566 | ], 567 | "font-size": 36, 568 | "color": "#000000", 569 | "text-align": "left", 570 | "vertical-align": "top", 571 | "line-height": "", 572 | "line-height-ratio": "", 573 | "letter-spacing": "", 574 | "font-style": [] 575 | }, 576 | "texts": [ 577 | "Dynamic Style" 578 | ] 579 | }, 580 | { 581 | "id": "", 582 | "type": "line", 583 | "display": true, 584 | "description": "", 585 | "style": { 586 | "border-color": "#7f7f7f", 587 | "border-width": 3, 588 | "border-style": "solid" 589 | }, 590 | "x1": 20, 591 | "y1": 606.1, 592 | "x2": 575.2, 593 | "y2": 606.1 594 | }, 595 | { 596 | "id": "show_text_block", 597 | "type": "text-block", 598 | "display": false, 599 | "description": "", 600 | "x": 92.3, 601 | "y": 610.5, 602 | "width": 482.9, 603 | "height": 25, 604 | "style": { 605 | "font-family": [ 606 | "IPAMincho" 607 | ], 608 | "font-size": 12, 609 | "color": "#000000", 610 | "text-align": "left", 611 | "vertical-align": "middle", 612 | "line-height": "", 613 | "line-height-ratio": "", 614 | "letter-spacing": "", 615 | "font-style": [], 616 | "overflow": "truncate", 617 | "word-wrap": "none" 618 | }, 619 | "reference-id": "", 620 | "value": "", 621 | "multiple-line": true, 622 | "format": { 623 | "base": "", 624 | "type": "" 625 | } 626 | }, 627 | { 628 | "id": "", 629 | "type": "text", 630 | "display": true, 631 | "description": "", 632 | "x": 20, 633 | "y": 610, 634 | "width": 212.7, 635 | "height": 26, 636 | "style": { 637 | "font-family": [ 638 | "Times New Roman" 639 | ], 640 | "font-size": 16, 641 | "color": "#000000", 642 | "text-align": "left", 643 | "vertical-align": "middle", 644 | "line-height": "", 645 | "line-height-ratio": "", 646 | "letter-spacing": "", 647 | "font-style": [] 648 | }, 649 | "texts": [ 650 | "Visibility:" 651 | ] 652 | }, 653 | { 654 | "id": "", 655 | "type": "text", 656 | "display": true, 657 | "description": "", 658 | "x": 20, 659 | "y": 645, 660 | "width": 274.7, 661 | "height": 20.5, 662 | "style": { 663 | "font-family": [ 664 | "Times New Roman" 665 | ], 666 | "font-size": 16, 667 | "color": "#000000", 668 | "text-align": "left", 669 | "vertical-align": "top", 670 | "line-height": "", 671 | "line-height-ratio": "", 672 | "letter-spacing": "", 673 | "font-style": [] 674 | }, 675 | "texts": [ 676 | "Bold and Italic Style:" 677 | ] 678 | }, 679 | { 680 | "id": "", 681 | "type": "text", 682 | "display": true, 683 | "description": "", 684 | "x": 20, 685 | "y": 710, 686 | "width": 274.7, 687 | "height": 20, 688 | "style": { 689 | "font-family": [ 690 | "Times New Roman" 691 | ], 692 | "font-size": 16, 693 | "color": "#000000", 694 | "text-align": "left", 695 | "vertical-align": "top", 696 | "line-height": "", 697 | "line-height-ratio": "", 698 | "letter-spacing": "", 699 | "font-style": [] 700 | }, 701 | "texts": [ 702 | "Font Size:" 703 | ] 704 | }, 705 | { 706 | "id": "", 707 | "type": "text", 708 | "display": true, 709 | "description": "", 710 | "x": 294.7, 711 | "y": 645.5, 712 | "width": 254.4, 713 | "height": 20, 714 | "style": { 715 | "font-family": [ 716 | "Times New Roman" 717 | ], 718 | "font-size": 16, 719 | "color": "#000000", 720 | "text-align": "left", 721 | "vertical-align": "top", 722 | "line-height": "", 723 | "line-height-ratio": "", 724 | "letter-spacing": "", 725 | "font-style": [] 726 | }, 727 | "texts": [ 728 | "Underline and Line-Through Style:" 729 | ] 730 | }, 731 | { 732 | "id": "bold_and_italic", 733 | "type": "text-block", 734 | "display": true, 735 | "description": "", 736 | "x": 20, 737 | "y": 665.5, 738 | "width": 274.7, 739 | "height": 36, 740 | "style": { 741 | "font-family": [ 742 | "Times New Roman" 743 | ], 744 | "font-size": 12, 745 | "color": "#000000", 746 | "text-align": "left", 747 | "vertical-align": "top", 748 | "line-height": "", 749 | "line-height-ratio": "", 750 | "letter-spacing": "", 751 | "font-style": [], 752 | "overflow": "truncate", 753 | "word-wrap": "none" 754 | }, 755 | "reference-id": "", 756 | "value": "", 757 | "multiple-line": true, 758 | "format": { 759 | "base": "", 760 | "type": "" 761 | } 762 | }, 763 | { 764 | "id": "underline_and_linethrough", 765 | "type": "text-block", 766 | "display": true, 767 | "description": "", 768 | "x": 294.7, 769 | "y": 665.5, 770 | "width": 280.5, 771 | "height": 36, 772 | "style": { 773 | "font-family": [ 774 | "IPAMincho" 775 | ], 776 | "font-size": 12, 777 | "color": "#000000", 778 | "text-align": "left", 779 | "vertical-align": "top", 780 | "line-height": "", 781 | "line-height-ratio": "", 782 | "letter-spacing": "", 783 | "font-style": [], 784 | "overflow": "truncate", 785 | "word-wrap": "none" 786 | }, 787 | "reference-id": "", 788 | "value": "", 789 | "multiple-line": true, 790 | "format": { 791 | "base": "", 792 | "type": "" 793 | } 794 | }, 795 | { 796 | "id": "font_size_12", 797 | "type": "text-block", 798 | "display": true, 799 | "description": "", 800 | "x": 20, 801 | "y": 730, 802 | "width": 274.7, 803 | "height": 36, 804 | "style": { 805 | "font-family": [ 806 | "IPAMincho" 807 | ], 808 | "font-size": 12, 809 | "color": "#000000", 810 | "text-align": "left", 811 | "vertical-align": "top", 812 | "line-height": "", 813 | "line-height-ratio": "", 814 | "letter-spacing": "", 815 | "font-style": [], 816 | "overflow": "truncate", 817 | "word-wrap": "none" 818 | }, 819 | "reference-id": "", 820 | "value": "", 821 | "multiple-line": true, 822 | "format": { 823 | "base": "", 824 | "type": "" 825 | } 826 | }, 827 | { 828 | "id": "", 829 | "type": "text", 830 | "display": true, 831 | "description": "", 832 | "x": 294.7, 833 | "y": 710, 834 | "width": 274.7, 835 | "height": 20, 836 | "style": { 837 | "font-family": [ 838 | "Times New Roman" 839 | ], 840 | "font-size": 16, 841 | "color": "#000000", 842 | "text-align": "left", 843 | "vertical-align": "top", 844 | "line-height": "", 845 | "line-height-ratio": "", 846 | "letter-spacing": "", 847 | "font-style": [] 848 | }, 849 | "texts": [ 850 | "Text Align and Vertical Align:" 851 | ] 852 | }, 853 | { 854 | "id": "text_align_and_vertical_align", 855 | "type": "text-block", 856 | "display": true, 857 | "description": "", 858 | "x": 294.7, 859 | "y": 730, 860 | "width": 274.7, 861 | "height": 36, 862 | "style": { 863 | "font-family": [ 864 | "IPAMincho" 865 | ], 866 | "font-size": 12, 867 | "color": "#000000", 868 | "text-align": "left", 869 | "vertical-align": "top", 870 | "line-height": "", 871 | "line-height-ratio": "", 872 | "letter-spacing": "", 873 | "font-style": [], 874 | "overflow": "truncate", 875 | "word-wrap": "none" 876 | }, 877 | "reference-id": "", 878 | "value": "", 879 | "multiple-line": true, 880 | "format": { 881 | "base": "", 882 | "type": "" 883 | } 884 | }, 885 | { 886 | "id": "", 887 | "type": "text", 888 | "display": true, 889 | "description": "", 890 | "x": 20, 891 | "y": 775, 892 | "width": 274.7, 893 | "height": 20, 894 | "style": { 895 | "font-family": [ 896 | "Times New Roman" 897 | ], 898 | "font-size": 16, 899 | "color": "#000000", 900 | "text-align": "left", 901 | "vertical-align": "top", 902 | "line-height": "", 903 | "line-height-ratio": "", 904 | "letter-spacing": "", 905 | "font-style": [] 906 | }, 907 | "texts": [ 908 | "Font Color:" 909 | ] 910 | }, 911 | { 912 | "id": "font_color_black", 913 | "type": "text-block", 914 | "display": true, 915 | "description": "", 916 | "x": 20, 917 | "y": 795, 918 | "width": 274.7, 919 | "height": 13, 920 | "style": { 921 | "font-family": [ 922 | "IPAMincho" 923 | ], 924 | "font-size": 12, 925 | "color": "#000000", 926 | "text-align": "left", 927 | "vertical-align": "top", 928 | "line-height": "", 929 | "line-height-ratio": "", 930 | "letter-spacing": "", 931 | "font-style": [], 932 | "overflow": "truncate", 933 | "word-wrap": "none" 934 | }, 935 | "reference-id": "", 936 | "value": "", 937 | "multiple-line": false, 938 | "format": { 939 | "base": "", 940 | "type": "" 941 | } 942 | } 943 | ], 944 | "state": { 945 | "layout-guides": [ 946 | { 947 | "type": "x", 948 | "position": 294.7 949 | }, 950 | { 951 | "type": "y", 952 | "position": 688.2 953 | } 954 | ] 955 | }, 956 | "title": "", 957 | "report": { 958 | "paper-type": "A4", 959 | "orientation": "portrait", 960 | "margin": [ 961 | 20, 962 | 20, 963 | 20, 964 | 20 965 | ] 966 | } 967 | } --------------------------------------------------------------------------------