Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.
/ html-chohyo Public archive

Try to implement printing feature using HTML and CSS (Page Media) for 第3回フロントエンド勉強会 in 山陰

Notifications You must be signed in to change notification settings

hidakatsuya/html-chohyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML帳票

第3回フロントエンド勉強会 in 山陰で発表した際のサンプルコード。

  • フロントエンド技術のみによる帳票印刷機能を作ってみる
  • 印刷プレビュー画面
  • Paged Media (CSS3) による用紙、印刷のコントロール

Presentation

https://speakerdeck.com/hidakatsuya/frontend-study-group-in-sannin-3rd (Speaker Deck)

Usage

  1. index.html をブラウザで開く
  2. Cmd+P などで印刷ダイアログを開き印刷する

Changing the paper size

index.html の

<!DOCTYPE html>
<html lang="ja">

<head>
  <meta charset="utf-8">
  <title>請求書 - 印刷プレビュー</title>
  <link rel="stylesheet" href="style.css" type="text/css">
  <style>@page { size: A4 }</style>
</head>

<body class="A4">
  <section class="sheet">

@page { size: A4 }<body class="A4"> を変更する。

Note

実用したい場合は https://github.com/cognitom/paper-css を使えば良いと思います。

Copyright

2017 (c) Katsuya Hidaka.

About

Try to implement printing feature using HTML and CSS (Page Media) for 第3回フロントエンド勉強会 in 山陰

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published