mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2024-11-27 18:23:36 +01:00
35 lines
779 B
TypeScript
35 lines
779 B
TypeScript
import Item from 'src/Item';
|
|
|
|
export function items(page: number, data: object[]): Item[] {
|
|
return data.map((data) => new Item(page, data));
|
|
}
|
|
|
|
export function item(page: number, data: object): Item {
|
|
return new Item(page, data);
|
|
}
|
|
|
|
export function idItems(page: number, ids: string[]): Item[] {
|
|
return ids.map((id) => new Item(page, { id }));
|
|
}
|
|
|
|
export function idItem(page: number, id: string): Item {
|
|
return new Item(page, { id });
|
|
}
|
|
|
|
export function realisticItems(page: number, data: object[]): Item[] {
|
|
return data.map(
|
|
(data, idx) =>
|
|
new Item(page, {
|
|
line: idx,
|
|
x: idx,
|
|
y: idx,
|
|
str: `text ${idx}`,
|
|
fontName: 'g_d0_f2',
|
|
dir: 'ltr',
|
|
width: 10,
|
|
height: 10,
|
|
...data,
|
|
}),
|
|
);
|
|
}
|