Phase 5: the Immigration Bureau's forms, filled in from the records
A Forms tab on each person fills in TM.7, STM.2, STM.9, STM.11 and STM.1 for an extension of stay, TM.47 for a 90-day report and TM.8 for a re-entry permit. The Bureau's blank pages (forms/, with their sources and checksums) go unchanged into a new PDF, and the values are written on the dotted lines in Sarabun; boxes are ticked and the title circled where a form asks. scripts/gen_layout.py measures the blanks into src/papers/layout.rs. The tab says what would stay blank and links to where it is added. What only the application says (the date, the office, the reason, the days, a trip) is carried in the links and never stored. The extension's five forms also come in one PDF. Opening or downloading a form is audited as entity "form" with the forms' codes, never their values. Migration 0005 adds what STM.1 and STM.11 ask of the company (capital, revenue, equity, staff, a coordinator), a work permit's salary and contract dates, and where an arrival came from. The Nix package now takes forms/.
This commit is contained in:
1 parent
2a6e972b68
commit
a2cedcdd7e
40 files changed
+3404
-35
No files matched your search
@@ -0,0 +1,47 @@
|
||||
# The blank forms
|
||||
|
||||
The Immigration Bureau's forms that the app fills in (`src/papers`), kept
|
||||
unchanged as the Bureau publishes them. The app lays each page into a new PDF
|
||||
and writes the values on its dotted lines, so a filled-in form looks like one
|
||||
filled in by hand, only legible.
|
||||
|
||||
They come from the downloads of Immigration Division 1 at
|
||||
https://bangkok.immigration.go.th/en/downloads_en/, fetched on November 18,
|
||||
2026. The STM forms are the versions of 2025. The forms are the Bureau's own,
|
||||
for every immigration office; Chiang Mai Immigration's website offers no
|
||||
downloads of its own.
|
||||
|
||||
| Form | File | What it is | SHA-256 |
|
||||
| ---- | ---- | ---------- | ------- |
|
||||
| [TM.7](https://bangkok.immigration.go.th/wp-content/uploads/2021/06/14%E0%B8%84%E0%B8%B3%E0%B8%82%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B8%B8%E0%B8%8D%E0%B8%B2%E0%B8%95%E0%B9%80%E0%B8%9E%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%AD%E0%B8%A2%E0%B8%B9%E0%B9%88%E0%B9%83%E0%B8%99%E0%B8%A3%E0%B8%B2%E0%B8%8A%E0%B8%AD%E0%B8%B2%E0%B8%93%E0%B8%B2%E0%B8%88%E0%B8%B1%E0%B8%81%E0%B8%A3%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%8A%E0%B8%B1%E0%B9%88%E0%B8%A7%E0%B8%84%E0%B8%A3%E0%B8%B2%E0%B8%A7%E0%B8%95%E0%B9%88%E0%B8%AD%E0%B9%84%E0%B8%9B-%E0%B8%95%E0%B8%A1.7.pdf) | `tm7.pdf` | Application for extension of temporary stay | `93bcd4b4fda4a9e88329e313112a6bd6d17a8f604f16392734f72a647fc8b62d` |
|
||||
| [STM.2](https://bangkok.immigration.go.th/wp-content/uploads/STM-2-FORM-2025.pdf) | `stm2.pdf` | Acknowledgment of the conditions of a temporary stay | `0675fcd31ad6ee5ad50ca38f0ba115a82378e81faa7cab1aea22dbfb5335c35e` |
|
||||
| [STM.9](https://bangkok.immigration.go.th/wp-content/uploads/STM-9-FORM-2025.pdf) | `stm9.pdf` | Acknowledgment of the penalties for overstay | `c9939371a18e4b8cd74b2a8bc88377ac39f53d9a8049dc28b832917e300eccb6` |
|
||||
| [STM.11](https://bangkok.immigration.go.th/wp-content/uploads/STM-11-FORM-2025.pdf) | `stm11.pdf` | Consent to the checking of the application | `41b86da3094ec86837512f0d3b84871dd75ffed8c70fcd415a33d26704d74612` |
|
||||
| [STM.1](https://bangkok.immigration.go.th/wp-content/uploads/STM-1-FORM-2025.pdf) | `stm1.pdf` | Certificate of employment, from the employer | `591484049f81d8c3c86bc118413b85521fa8935e2d00a7b85c48747e3d790cf1` |
|
||||
| [TM.47](https://bangkok.immigration.go.th/wp-content/uploads/Form-TM-47.pdf) | `tm47.pdf` | Notification of staying longer than 90 days | `2208dc2aa65f82dc8e2129759d6eb2e8bf1185b271c4e02c3803a527dd5ccbac` |
|
||||
| [TM.8](https://bangkok.immigration.go.th/wp-content/uploads/2021/06/15%E0%B8%84%E0%B8%B3%E0%B8%82%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B8%B8%E0%B8%8D%E0%B8%B2%E0%B8%95%E0%B9%80%E0%B8%9E%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B1%E0%B8%9A%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A1%E0%B8%B2%E0%B9%83%E0%B8%99%E0%B8%A3%E0%B8%B2%E0%B8%8A%E0%B8%AD%E0%B8%B2%E0%B8%93%E0%B8%B2%E0%B8%88%E0%B8%B1%E0%B8%81%E0%B8%A3%E0%B8%AD%E0%B8%B5%E0%B8%81-%E0%B8%95%E0%B8%A1.8.pdf) | `tm8.pdf` | Application for a re-entry permit | `2bcd666622f0aa99e16e4bcbac8d3eec8c06566d620e3a3d7d9799aaab41920a` |
|
||||
|
||||
## Where the values go
|
||||
|
||||
`scripts/gen_layout.py` finds the dotted lines and the boxes in these PDFs and
|
||||
writes `src/papers/layout.rs`, which says where each value goes. TM.47 has no
|
||||
dotted lines, so its blanks are measured from the lines drawn on it.
|
||||
`scripts/form_blanks.py` lists a form's dotted lines with their labels, which
|
||||
helps when a form changes:
|
||||
|
||||
```sh
|
||||
uv run --with pymupdf python scripts/form_blanks.py forms/tm7.pdf
|
||||
uv run --with pymupdf python scripts/gen_layout.py
|
||||
```
|
||||
|
||||
`gen_layout.py` formats its output with rustfmt, so a rerun on the same forms
|
||||
gives the same file. When the Bureau publishes a new version of a form,
|
||||
replace the file, run `gen_layout.py` again, update the table above, and check every page of the
|
||||
filled-in form against the blank before the change goes live.
|
||||
|
||||
## The font
|
||||
|
||||
The values are written in Sarabun Regular (`fonts/Sarabun-Regular.ttf`), the
|
||||
font the forms themselves use, by Cadson Demak, under the SIL Open Font
|
||||
License 1.1 (`fonts/OFL.txt`), from
|
||||
https://github.com/google/fonts/tree/main/ofl/sarabun.
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2018 The Sarabun Project Authors (https://github.com/cadsondemak/Sarabun)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user