Add support for rounded corners on table borders.
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- tooling
調査の方向性
PDFKit Browser Demo と、例に示されている既存の roundedRect およびテーブル描画のエントリポイントから始めます。外側の角を丸める場合に、ヘッダー、フッター、内部の行線および列線とどのように共存させるべきかを定義し、要求されたテーブル境界線のケースについて生成された PDF を検証します。
索引モデルが issue の本文から書いたものです。
説明
Feature Request
🧩 Use Case
When generating PDFs with tables, we often want to improve the aesthetics by applying rounded corners to just the outer border of the table — for example, applying a radius to:
Top-left and top-right corners of the table header
Bottom-left and bottom-right corners of the table footer or last row
Or the entire table if it’s wrapped in a border
📌 Current Workaround
Right now, we work around this by:
Drawing a roundedRect manually around the table
Then manually drawing all the internal horizontal and vertical lines
Carefully avoiding overlapping the outer rounded corners with rect or lineTo calls
While this works, it’s tedious and error-prone, especially for dynamic tables with variable rows and columns.
Feature description
Example of a hacky solution to execute on the PDFKit Browser Demo
// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
// ========== Clean Table with Rounded Outer Border Only ==========
const table = {
headers: ['Name', 'Age'],
rows: [
['Alice', 30],
['Bob', 25],
]
};
const startX = 100;
let startY = 420;
const rowHeight = 30;
const colWidths = [200, 100];
const radius = 8;
const totalWidth = colWidths.reduce((a, b) => a + b, 0);
const totalHeight = rowHeight * (1 + table.rows.length); // header + rows
// Draw outer rounded border only
doc
.roundedRect(startX, startY, totalWidth, totalHeight, radius)
.stroke();
// Draw horizontal lines (rows)
for (let i = 1; i < table.rows.length + 1; i++) {
const y = startY + i * rowHeight;
doc.moveTo(startX, y).lineTo(startX + totalWidth, y).stroke();
}
// Draw vertical lines (columns)
let colX = startX;
for (let i = 0; i < colWidths.length - 1; i++) {
colX += colWidths[i];
doc.moveTo(colX, startY).lineTo(colX, startY + totalHeight).stroke();
}
// Add text
let textY = startY + 10;
// Header
let textX = startX;
table.headers.forEach((header, i) => {
doc.text(header, textX + 5, textY);
textX += colWidths[i];
});
// Rows
startY += rowHeight;
table.rows.forEach((row) => {
textX = startX;
row.forEach((cell, i) => {
doc.text(cell.toString(), textX + 5, startY + 10);
textX += colWidths[i];
});
startY += rowHeight;
});
// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
iframe.src = stream.toBlobURL('application/pdf');
});
`
<!-- You have examples or an idea how it can be implemented? -->
- 主要言語
- JavaScript
- スター
- 10.7k
- フォーク
- 1.2k
- 平均マージ
- 21時間 41分
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
foliojs/pdfkit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
foliojs/pdfkit#1804 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
PDFKit crashes when providing fonts as Buffer in table対応中かも @ykw9263 が 133 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
foliojs/pdfkit#1743 · コメント 13 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
foliojs/pdfkit#1635 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
foliojs/pdfkit#1512 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Upgrade codemirrorオープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
cdx-audit output written to a pipe is cut off at 64 KiB再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug mode:cli
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Build produces empty forge.min.js: package.json lists "forge" instead of "node-forge"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Fei2411/DeepSeek-Bot#963 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Miaotofu01/Study-Mate#244 ·
メンテナーはふだん 1 日以内に返信
-
test-reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/azure-sdk-for-js#40672 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信