Skip to content

Edit PDFs on your own device: text, signatures, form filling, highlights, white-out, merge, split, reorder and rotate pages. In the browser or as a Windows app. English and Turkish.

1.0.1: Turkish letters in form fields preview correctly

Talkdedsec202afca87d5a
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 0745d28..5f9061f 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,9 +1,13 @@
version: 2
updates:
+ # Bumps wait two weeks after a release. pdfjs-dist, pdf-lib, fflate and the
+ # fonts also need `npm run vendor`; the tests fail until that is committed.
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
+ cooldown:
+ default-days: 14
groups:
npm:
patterns: ["*"]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cd8bca..c037e81 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog
+## 1.0.1
+
+- Form fields with Turkish letters such as ş, ğ and ı now preview at the right size, in the same font the saved file uses. Before, the preview switched to an oversized fallback font (the saved file was already correct).
+- Fields that stay fillable after saving embed the complete font, so other programs can type any letter into them later.
+- The text box no longer hides the first letter while you type.
+- README demos for English and Turkish.
+
## 1.0.0
First release, in the browser and as a Windows app.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0cb6a53..403dff0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -35,7 +35,7 @@ The web app has no build step: edit the files in `web/` and reload.
- New interface text exists in English and Turkish.
- User-visible changes are listed in `CHANGELOG.md`.
- If you changed a dependency version, run `npm run vendor` and commit the files it updates.
-- If the interface changed visibly, run `npm run assets` to refresh the screenshots.
+- If the interface changed visibly, run `npm run assets` to refresh the screenshots and `npm run demo` for the demo videos (needs ffmpeg).
## Releases
diff --git a/README.md b/README.md
index 8ba3cf2..d0cd7f5 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,9 @@ TLK PDF is a PDF editor for the everyday jobs: fill in a form, sign it, add a no
Everything happens on your device: in the browser through GitHub Pages (installable, works offline), or as a Windows program. There is no account, no upload, no watermark and no page limit. The interface is in **English and Turkish**.
-![Filling in a form in TLK PDF](docs/screenshot.png)
+![TLK PDF: fill in a form, highlight, add a note, sign and save](docs/demo.gif)
+
+<sub>Also as [video](docs/demo.mp4) · [dark theme](docs/screenshot-dark.png)</sub>
## Start in 10 seconds
@@ -107,6 +109,7 @@ npm run test:desktop # the desktop app with a PDF on the command line
npm start # desktop app
npm run dist # Windows portable + installer into release/
npm run assets # icons, screenshots and the social image
+npm run demo # record the README demos (needs ffmpeg)
npm run vendor # copy pdf.js, pdf-lib, fontkit, fflate and fonts into web/
npm run sample # rebuild the sample form
```
diff --git a/README.tr.md b/README.tr.md
index 811d2e2..3601da1 100644
--- a/README.tr.md
+++ b/README.tr.md
@@ -21,7 +21,9 @@ TLK PDF günlük PDF işleri için bir düzenleyici: form doldur, imzala, not ek
Her şey kendi cihazında olur: tarayıcıda GitHub Pages üzerinden (kurulabilir, internetsiz çalışır) ya da Windows programı olarak. Hesap, yükleme, filigran ve sayfa sınırı yok. Arayüz **Türkçe ve İngilizce**.
-![TLK PDF ile form doldurma](docs/screenshot-tr.png)
+![TLK PDF: form doldur, vurgula, not ekle, imzala ve kaydet](docs/demo-tr.gif)
+
+<sub>[Video olarak](docs/demo-tr.mp4) · [koyu tema](docs/screenshot-dark.png)</sub>
## 10 saniyede başla
@@ -107,6 +109,7 @@ npm run test:desktop # komut satırından PDF verilen masaüstü uygulaması
npm start # masaüstü uygulaması
npm run dist # release/ içine Windows portable + kurulum
npm run assets # ikonlar, ekran görüntüleri ve sosyal görsel
+npm run demo # README demolarını kaydet (ffmpeg gerekir)
npm run vendor # pdf.js, pdf-lib, fontkit, fflate ve fontları web/'e kopyala
npm run sample # örnek formu yeniden üret
```
diff --git a/docs/demo-poster.jpg b/docs/demo-poster.jpg
new file mode 100644
index 0000000..d8aa4a4
Binary files /dev/null and b/docs/demo-poster.jpg differ
diff --git a/docs/demo-tr-poster.jpg b/docs/demo-tr-poster.jpg
new file mode 100644
index 0000000..9836f3a
Binary files /dev/null and b/docs/demo-tr-poster.jpg differ
diff --git a/docs/demo-tr.gif b/docs/demo-tr.gif
new file mode 100644
index 0000000..80258d3
Binary files /dev/null and b/docs/demo-tr.gif differ
diff --git a/docs/demo-tr.mp4 b/docs/demo-tr.mp4
new file mode 100644
index 0000000..e8232b2
Binary files /dev/null and b/docs/demo-tr.mp4 differ
diff --git a/docs/demo.gif b/docs/demo.gif
new file mode 100644
index 0000000..3b3fde4
Binary files /dev/null and b/docs/demo.gif differ
diff --git a/docs/demo.mp4 b/docs/demo.mp4
new file mode 100644
index 0000000..0115620
Binary files /dev/null and b/docs/demo.mp4 differ
diff --git a/docs/screenshot-dark.png b/docs/screenshot-dark.png
index cb4b564..3f8d718 100644
Binary files a/docs/screenshot-dark.png and b/docs/screenshot-dark.png differ
diff --git a/docs/screenshot-sign.png b/docs/screenshot-sign.png
index 6701dc0..cc2973c 100644
Binary files a/docs/screenshot-sign.png and b/docs/screenshot-sign.png differ
diff --git a/docs/screenshot-tr.png b/docs/screenshot-tr.png
index 7dae47b..ef1d647 100644
Binary files a/docs/screenshot-tr.png and b/docs/screenshot-tr.png differ
diff --git a/docs/screenshot.png b/docs/screenshot.png
index b481b2a..4cc6ef1 100644
Binary files a/docs/screenshot.png and b/docs/screenshot.png differ
diff --git a/package-lock.json b/package-lock.json
index c9ca573..c491419 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,13 @@
{
"name": "tlk-pdf",
- "version": "1.0.0",
+ "version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tlk-pdf",
- "version": "1.0.0",
+ "version": "1.0.1",
+ "license": "MIT",
"devDependencies": {
"@fontsource/caveat": "5.3.0",
"@ibm/plex-mono": "2.5.0",
diff --git a/package.json b/package.json
index d497c9a..368dcfb 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "tlk-pdf",
"productName": "TLK PDF",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Free, open-source PDF editor that runs on your device: text, signatures, form filling, highlights, drawing, white-out, merge, split, reorder and rotate pages.",
"license": "MIT",
"author": "Talkdedsec",
@@ -23,7 +23,8 @@
"vendor": "node scripts/vendor.mjs",
"sample": "node scripts/make-sample.mjs",
"assets": "node scripts/render-assets.mjs",
- "dist": "electron-builder --win --x64 --publish never"
+ "dist": "electron-builder --win --x64 --publish never",
+ "demo": "node scripts/render-demo.mjs en && node scripts/render-demo.mjs tr"
},
"build": {
"appId": "com.talkdedsec.tlkpdf",
diff --git a/scripts/render-demo.mjs b/scripts/render-demo.mjs
new file mode 100644
index 0000000..b9233cf
--- /dev/null
+++ b/scripts/render-demo.mjs
@@ -0,0 +1,150 @@
+// Records the README demo from the real app: open the sample, fill in the
+// form, highlight, add a note, sign and save. Writes docs/demo.{mp4,gif}
+// and docs/demo-poster.jpg in English, docs/demo-tr.* in Turkish.
+// Needs ffmpeg on PATH. Usage: node scripts/render-demo.mjs [en|tr]
+import { chromium } from 'playwright-core';
+import { execFileSync } from 'node:child_process';
+import { mkdtemp, readdir, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { existsSync } from 'node:fs';
+import { serve } from './serve.mjs';
+
+const root = (p) => fileURLToPath(new URL('../' + p, import.meta.url));
+const W = 1280, H = 800;
+const lang = process.argv[2] === 'tr' ? 'tr' : 'en';
+const suffix = lang === 'tr' ? '-tr' : '';
+const say = lang === 'tr' ? { name: 'Ayşe Yılmaz', mail: '[email protected]', note: 'Kimlik görüldü, dosyaya hazır', sign: 'Ayşe Y.' } : { name: 'Ada Lovelace', mail: '[email protected]', note: 'ID checked, ready to file', sign: 'A. Lovelace' };
+const exe = process.env.BROWSER_PATH || [
+ 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
+ 'C:/Program Files/Google/Chrome/Application/chrome.exe',
+ '/usr/bin/google-chrome'
+].find((p) => existsSync(p));
+
+const server = await serve(0);
+const url = `http://127.0.0.1:${server.address().port}/`;
+const dir = await mkdtemp(join(tmpdir(), 'tlk-pdf-demo-'));
+const browser = await chromium.launch({ executablePath: exe, headless: true });
+const context = await browser.newContext({ viewport: { width: W, height: H }, recordVideo: { dir, size: { width: W, height: H } }, colorScheme: 'light', locale: lang === 'tr' ? 'tr-TR' : 'en-US' });
+const page = await context.newPage();
+
+// Headless browsers draw no pointer, so the demo draws its own.
+await page.addInitScript(() => {
+ addEventListener('DOMContentLoaded', () => {
+ const c = document.createElement('div');
+ c.innerHTML = '<svg width="22" height="22" viewBox="0 0 24 24"><path d="M5 3.5 19 11l-6.2 1.7-3 6Z" fill="#111" stroke="#fff" stroke-width="1.6" stroke-linejoin="round"/></svg>';
+ Object.assign(c.style, { position: 'fixed', left: '0', top: '0', zIndex: 99999, pointerEvents: 'none', transform: 'translate(-4px,-3px)', transition: 'none' });
+ document.body.append(c);
+ const ring = document.createElement('div');
+ Object.assign(ring.style, { position: 'fixed', width: '34px', height: '34px', margin: '-17px 0 0 -17px', borderRadius: '50%', border: '3px solid rgba(36,73,201,.55)', zIndex: 99998, pointerEvents: 'none', opacity: '0', transition: 'opacity .35s, transform .35s', transform: 'scale(.5)' });
+ document.body.append(ring);
+ addEventListener('pointermove', (e) => { c.style.left = e.clientX + 'px'; c.style.top = e.clientY + 'px'; }, true);
+ addEventListener('pointerdown', (e) => {
+ Object.assign(ring.style, { left: e.clientX + 'px', top: e.clientY + 'px', transition: 'none', opacity: '1', transform: 'scale(.5)' });
+ requestAnimationFrame(() => Object.assign(ring.style, { transition: 'opacity .45s, transform .45s', opacity: '0', transform: 'scale(1.3)' }));
+ }, true);
+ });
+});
+
+const pause = (ms) => page.waitForTimeout(ms);
+let mx = W / 2, my = H / 2;
+async function moveTo(x, y, steps = 18) { await page.mouse.move(x, y, { steps }); mx = x; my = y; }
+async function clickAt(x, y) { await moveTo(x, y); await pause(120); await page.mouse.click(x, y); }
+async function clickEl(sel) { const b = await page.locator(sel).first().boundingBox(); await clickAt(b.x + b.width / 2, b.y + b.height / 2); }
+
+await page.goto(url);
+await page.evaluate(() => window.TLKPDF.ready);
+await page.evaluate(async (text) => {
+ // A signature saved earlier on this device.
+ localStorage.setItem('tlk-pdf-lang', document.documentElement.lang);
+ await document.fonts.load('170px "TLK Script"');
+ const c = document.createElement('canvas');
+ c.width = 900; c.height = 260;
+ const g = c.getContext('2d');
+ g.fillStyle = '#1E3A8A';
+ g.font = '170px "TLK Script"';
+ g.textBaseline = 'middle';
+ g.fillText(text, 20, 130);
+ localStorage.setItem('tlk-pdf-signatures', JSON.stringify([c.toDataURL('image/png')]));
+}, say.sign);
+await page.mouse.move(mx, my);
+await pause(900);
+
+await clickEl('#e-sample');
+await page.waitForFunction(() => window.TLKPDF.doc.pages.length === 2);
+await page.waitForFunction(() => window.TLKPDF.rendered());
+await pause(700);
+
+// Fill in the form from the side panel.
+await clickEl('#tab-forms');
+await pause(300);
+const inputs = page.locator('#p-forms input.inp');
+await clickEl('#p-forms input.inp >> nth=0');
+await page.keyboard.type(say.name, { delay: 55 });
+await clickEl('#p-forms input.inp >> nth=2');
+await page.keyboard.type(say.mail, { delay: 40 });
+void inputs;
+await clickEl('#p-forms select >> nth=1');
+await page.locator('#p-forms select').nth(1).selectOption('Yearly');
+await clickEl('#p-forms input[type="checkbox"]');
+await pause(600);
+
+// Highlight the instruction line.
+const sheet = await page.locator('.sheet').first().boundingBox();
+const s = sheet.width / 595.28;
+await page.keyboard.press('h');
+await moveTo(sheet.x + 54 * s, sheet.y + 128 * s);
+await page.mouse.down();
+await moveTo(sheet.x + 354 * s, sheet.y + 140 * s, 30);
+await page.mouse.up();
+await pause(500);
+
+// A note in blue.
+await clickEl('.tool[data-tool="text"]');
+await clickEl('#p-tool .swatch[title="#2449C9"]');
+await clickAt(sheet.x + 352 * s, sheet.y + 190 * s);
+await page.keyboard.type(say.note, { delay: 45 });
+await page.keyboard.press('Escape');
+await pause(500);
+
+// Sign page 2.
+await clickEl('.tool[data-tool="signature"]');
+await pause(400);
+await page.evaluate(() => {
+ const st = document.getElementById('stage');
+ const sh = document.querySelectorAll('.sheet')[1];
+ st.scrollTo({ top: sh.offsetTop + sh.offsetHeight - 760, behavior: 'smooth' });
+});
+await pause(1100);
+const line = await page.evaluate(async () => {
+ const pg = await window.TLKPDF.sources[0].pdf.getPage(2);
+ const label = (await pg.getTextContent()).items.find((i) => i.str === 'SIGNATURE');
+ return label.transform[5];
+});
+const sheet2 = await page.locator('.sheet').nth(1).boundingBox();
+await clickAt(sheet2.x + 150 * s, sheet2.y + (841.89 - line - 38) * s);
+await pause(700);
+await page.keyboard.press('Escape');
+await pause(300);
+
+// Save.
+await clickEl('#b-save');
+await pause(1800);
+await moveTo(W / 2 + 120, H / 2 + 80, 25);
+await pause(900);
+
+const video = page.video();
+await context.close();
+await browser.close();
+server.close();
+
+const webm = await video.path();
+const mp4 = root(`docs/demo${suffix}.mp4`);
+const gif = root(`docs/demo${suffix}.gif`);
+// Trim the white frames before the app has loaded.
+execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-ss', '0.4', '-i', webm, '-vf', 'scale=1280:-2', '-c:v', 'libx264', '-preset', 'slow', '-crf', '26', '-pix_fmt', 'yuv420p', '-movflags', '+faststart', '-an', mp4]);
+execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-i', mp4, '-vf', 'fps=12,scale=960:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=128:stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=4:diff_mode=rectangle', gif]);
+execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-sseof', '-1.2', '-i', mp4, '-frames:v', '1', '-q:v', '3', root(`docs/demo${suffix}-poster.jpg`)]);
+await rm(dir, { recursive: true, force: true });
+console.log(`docs/demo${suffix}.mp4, .gif and -poster.jpg written`, (await readdir(root('docs'))).join(', '));
diff --git a/scripts/smoke.mjs b/scripts/smoke.mjs
index 6004c29..75b384a 100644
--- a/scripts/smoke.mjs
+++ b/scripts/smoke.mjs
@@ -15,6 +15,18 @@ const pdfjs = await import('pdfjs-dist/legacy/build/pdf.mjs');
const failures = [];
const check = (ok, msg) => { if (!ok) failures.push(msg); console.log((ok ? ' ok ' : ' FAIL ') + msg); };
+// The app runs the copies in web/vendor, not node_modules. A dependency bump
+// without `npm run vendor` would test one version and ship another.
+{
+ const vendored = JSON.parse(await readFile(new URL('web/vendor/VERSIONS.json', ROOT), 'utf8'));
+ const stale = [];
+ for (const [name, v] of Object.entries(vendored)) {
+ const installed = JSON.parse(await readFile(new URL(`node_modules/${name}/package.json`, ROOT), 'utf8')).version;
+ if (installed !== v) stale.push(`${name} ${v} → ${installed}`);
+ }
+ check(!stale.length, stale.length ? `vendored files are out of date (${stale.join(', ')}); run npm run vendor` : 'vendored libraries and fonts match package.json');
+}
+
async function pdfText(bytes) {
const task = pdfjs.getDocument({ data: new Uint8Array(bytes), useSystemFonts: false, verbosity: 0 });
const d = await task.promise;
diff --git a/web/icons/og.png b/web/icons/og.png
index 0351f30..a238f05 100644
Binary files a/web/icons/og.png and b/web/icons/og.png differ
diff --git a/web/js/app.js b/web/js/app.js
index 1fb3860..1641e66 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -9,7 +9,7 @@ import {
import { viewport, mul, localToUser, viewBounds, boxFromView, moveBy, pointAt, dirs, clamp, ASCENT, LINE, MARKS } from './geometry.js';
import {
openPdf, openImage, blankPage, drawPage, buildPdf, pdfToPngs, stampsFor, syncFormPreview,
- fieldValue, formKey, Cancelled, forgetPages
+ fieldValue, formKey, Cancelled, forgetPages, formStamps
} from './pdfio.js';
import { openSignatureDialog, listSignatures, removeSignature } from './signature.js';
@@ -412,7 +412,7 @@ function drawOverlay(pageId) {
const vp = vpOf(p);
const n = doc.pages.indexOf(p) + 1;
let html = '';
- for (const st of stampsFor(p, n, doc.pages.length, measure)) html += itemSvg(st, vp, true);
+ for (const st of [...formStamps(p, measure), ...stampsFor(p, n, doc.pages.length, measure)]) html += itemSvg(st, vp, true);
for (const raw of itemsOf(pageId)) {
if (editing && editing.itemId === raw.id) continue;
html += itemSvg(preview.get(raw.id) || raw, vp);
@@ -674,6 +674,8 @@ function startText(pageId, item, x, y) {
ta.style.height = '0px';
ta.style.width = Math.max(40, ta.scrollWidth + 8) + 'px';
ta.style.height = ta.scrollHeight + 'px';
+ // Shrinking to measure scrolls the text sideways; put it back.
+ ta.scrollLeft = 0;
};
ta.addEventListener('input', fit);
ta.addEventListener('keydown', (e) => {
@@ -1407,6 +1409,7 @@ onChange((what) => {
if (ui.sel && !findItem(ui.sel.pageId, ui.sel.itemId)) ui.sel = null;
if (what.forms) {
syncFormPreview();
+ if (!what.pages) drawAllOverlays();
clearTimeout(formTimer);
formTimer = setTimeout(() => { ui.formVersion++; scheduleRender(); renderThumbs(); }, 120);
}
diff --git a/web/js/pdfio.js b/web/js/pdfio.js
index fed1309..107ee8e 100644
--- a/web/js/pdfio.js
+++ b/web/js/pdfio.js
@@ -70,7 +70,8 @@ async function readFields(pdf) {
(out[a.fieldName] ||= []).push({
id: a.id, type, value, page: i - 1, readOnly: !!a.readOnly,
exportValues: a.buttonValue ?? a.exportValue ?? null,
- items: a.options || [], multiline: !!a.multiLine, password: !!a.password, charLimit: a.maxLen || 0
+ items: a.options || [], multiline: !!a.multiLine, password: !!a.password, charLimit: a.maxLen || 0,
+ rect: a.rect, size: a.defaultAppearanceData?.fontSize || 0, align: a.textAlignment || 0
});
}
}
@@ -168,6 +169,15 @@ export function fieldValue(src, name) {
// Mirrors edited form values into pdf.js so rendered pages show them.
// Fields the user has not touched keep the appearance stored in the file.
+// Edited text fields and drop-downs are blanked here and drawn by the editor
+// instead (see formStamps), in the font the saved file will use: pdf.js
+// switches to an oversized fallback when the field's own font cannot encode
+// letters such as ş, ğ or ı.
+// Letters outside Latin-1 are the ones a standard PDF font cannot encode.
+const needsOwnFont = (t) => /[^\u0000-\u00ff]/.test(String(t ?? ''));
+const choiceLabel = (w, v) => (w.items.find((o) => o.exportValue === v) || {}).displayValue ?? v;
+const drawnByEditor = (w, v) => w.type === 'text' || (w.type === 'combobox' && needsOwnFont(choiceLabel(w, v)));
+
export function syncFormPreview() {
for (const src of sources) {
if (!src.fields) continue;
@@ -179,13 +189,46 @@ export function syncFormPreview() {
if (!edited) { store.remove?.(w.id); continue; }
if (w.type === 'checkbox') store.setValue(w.id, { value: !!v });
else if (w.type === 'radiobutton') store.setValue(w.id, { value: v === w.exportValues });
- else if (w.type === 'combobox' || w.type === 'listbox') store.setValue(w.id, { value: v ? [v] : [] });
- else store.setValue(w.id, { value: String(v ?? '') });
+ else if (w.type === 'combobox') store.setValue(w.id, { value: drawnByEditor(w, v) || !v ? [] : [v] });
+ else if (w.type === 'listbox') store.setValue(w.id, { value: v ? [v] : [] });
+ else store.setValue(w.id, { value: '' });
}
}
}
}
+// Text for the edited text fields and drop-downs on page `p`, laid out the
+// way pdf-lib writes field appearances: 2 pt padding, one line centred
+// vertically, several lines from the top.
+export function formStamps(p, measure) {
+ const src = p.src ? source(p.src) : null;
+ if (!src?.fields) return [];
+ const out = [];
+ for (const [name, widgets] of Object.entries(src.fields)) {
+ if (!(formKey(src.id, name) in doc.forms)) continue;
+ let text = fieldValue(src, name);
+ for (const w of widgets) {
+ if (w.page !== p.index || !drawnByEditor(w, text) || !w.rect) continue;
+ if (w.type === 'combobox') text = choiceLabel(w, text);
+ text = String(text ?? '');
+ if (w.password) text = '•'.repeat(text.length);
+ if (!text) continue;
+ const [x0, y0, x1, y1] = w.rect;
+ const rw = x1 - x0, rh = y1 - y0;
+ const lines = w.multiline ? text.split('\n') : [text.replace(/\n/g, ' ')];
+ const size = w.size || Math.max(4, Math.min(12, (w.multiline ? 12 : (rh - 4) * 0.72)));
+ const tw = measure(lines.join('\n'), size, 'sans', false);
+ const h = lines.length * size * LINE;
+ let x = x0 + 2;
+ if (!w.multiline && w.align === 1) x = x0 + (rw - tw) / 2;
+ else if (!w.multiline && w.align === 2) x = x1 - 2 - tw;
+ const y = w.multiline ? y1 - 2 - h + size * 0.15 : (y0 + y1) / 2 - size * 0.65;
+ out.push({ type: 'text', stamp: true, text: lines.join('\n'), x, y, w: tw, h, rot: 0, size, font: 'sans', bold: false, color: '#000000', opacity: 1 });
+ }
+ }
+ return out;
+}
+
/* ---------------------------------------------------------------- stamps */
// Page numbers and the watermark are not stored per page; they are computed
@@ -289,7 +332,9 @@ export async function buildPdf(list, { progress = () => {} } = {}) {
try { form = lib.getForm(); } catch { continue; }
if (changed) {
lib.registerFontkit(window.fontkit);
- const font = await lib.embedFont(await loadFontBytes('sans/0'), { subset: true });
+ // Fields that stay fillable get the whole font, so other programs can
+ // type any letter into them later; flattened fields only need a subset.
+ const font = await lib.embedFont(await loadFontBytes('sans/0'), { subset: !inPlace });
for (const [key, val] of Object.entries(doc.forms)) {
if (!key.startsWith(id + '|')) continue;
const name = key.slice(id.length + 1);
diff --git a/web/js/version.js b/web/js/version.js
index 059488a..e96d287 100644
--- a/web/js/version.js
+++ b/web/js/version.js
@@ -1 +1 @@
-export const VERSION = '1.0.0';
+export const VERSION = '1.0.1';
diff --git a/web/sw.js b/web/sw.js
index 15387b6..63f3560 100644
--- a/web/sw.js
+++ b/web/sw.js
@@ -1,7 +1,7 @@
// Offline support for the hosted app: the app shell is cached on install,
// everything else (pdf.js data files, fonts) is cached the first time it is
// used. A new version gets a new cache name.
-const CACHE = 'tlk-pdf-1.0.0';
+const CACHE = 'tlk-pdf-1.0.1';
const SHELL = [
'./', 'index.html', 'css/app.css', 'manifest.webmanifest', 'icons/icon.svg', 'icons/icon-192.png',
'js/app.js', 'js/i18n.js', 'js/store.js', 'js/geometry.js', 'js/pdfio.js', 'js/signature.js', 'js/version.js',