En pocas palabras
Un librito de tapa dura con un cuento de Poe, cuya cubierta estampada tiene un agujero oval. Por el agujero se ve la cara del retrato impreso en la portada de debajo.
Lo que vas a componer
El retrato oval, el cuento de Edgar Allan Poe de 1842 en el texto más breve que publicó en 1845, como un librito de tapa dura de diez páginas en 130 × 195 mm. La cubierta es un damasco antiguo con una ventana oval troquelada. Debajo está la portada, el retrato mismo en su marco dorado a la morisca, y la ventana está puesta para que su borde caiga sobre el dorado: cerrado, el libro enseña el rostro pintado enmarcado dos veces, por el oro y por el corte. El cuento sigue en papel crema con una capitular, y la contracubierta repite el damasco con el texto sobre un panel oscuro. El PDF de imprenta lleva el contorno de la ventana en una planilla propia.
Esta receta responde a
- ¿Cómo troquelo una ventana en la cubierta que enmarque la portada de debajo?
- ¿Cómo entrego al troquelador la línea de troquel en una plancha propia del PDF?
La respuesta corta
// The window is cut through the first leaf, so the closed book shows page 3 through it.
// Its size is measured on the title-page painting: a little wider than the frame's opening,
// so the cut edge falls on the gilt and the face sits in the middle of the hole.
const dieCuts = {
shapes: [{ id: 'window', name: t({ en: 'Oval window', es: 'Ventana oval' }),
shape: 'ellipse', x: mm(26), y: mm(15.7), width: mm(78), height: mm(102) }],
pages: [{ pages: '1', die: 'window' }], // page 1, the front board
};
Ingredientes
- Funciones
- Agujeros troqueladosLínea de troquel en el PDFVisor de libro en 3D (Folio)Estilos de títuloImágenes en los diseños de páginaTextos, filetes y cajas en los diseños de páginaMetadatos del documentoEstilos de párrafoCapitulares en las aperturasSangrado y marcas de cortePDF en CMYK y en escala de grisesExportación a PDFFiguras y tablas como recursosPaleta de color semánticaPáginas en un canvas
- También usa
- Capitulares en párrafos de textoPapel, encuadernación, mesa y luz (Folio)Atributos de títuloAperturas diseñadasColor del papelCabeceras según el tipo de páginaColores por parteFuentes incrustadas en el PDFGeometría por secciónCabeceras por secciónCapítulos sin número
- Tipografía
- EB Garamond, Cormorant Garamond (SIL OFL 1.1)
- Recursos
damask.jpgportrait.jpg- Cubierta y contracubierta: un damasco de granadas (Generated With Diffusion Models, original)
- Portada: el retrato oval sobre una pared de terciopelo (Generated With Diffusion Models, original)
Elaboración
#1 · Una ventana en registro con el marco
El código es la respuesta corta de arriba. La ventana es una ellipse en la página 1, colocada desde la esquina superior izquierda del corte. Un agujero en la página 1 da a la página 3, así que se mide sobre la pintura de la portada: aquí la abertura del marco y su borde exterior se leyeron en píxeles sobre la imagen y se pasaron a milímetros, y la ventana se puso a un tercio de la banda dorada, para que dentro del corte asome un aro fino de oro.
#2 · Pinturas colgadas del corte
// Both paintings are placed in trim millimetres, the same frame the die is measured in. The
// portrait is set a little larger than the page so the frame is centred on it (and on the
// window); the cover type sits on a dark cartouche below the window.
const bleed = (x, y, width, height) => ({ kind: 'image', id: 'painting',
resourceId: '{attr.picture}', fit: 'cover', placement: at('page', 'top-left', x, y,
{ width: mm(width), height: mm(height) }) });
const sheet = bleed(-BLEED, -BLEED, WIDTH + 2 * BLEED, HEIGHT + 2 * BLEED);
const portrait = bleed(-3.6, -BLEED, 140, 210); // its oval centred at x = WIDTH / 2
const box = (id, y, h) => ({ kind: 'box', id, placement: at('page', 'top-left', 17, y,
{ width: mm(WIDTH - 34), height: mm(h) }), style: { backgroundColor: col('plate'),
borderColor: col('gold'), borderWidth: pt(0.75) } });
const type = (id, content, y, size, extra = {}) => ({ kind: 'text', id, content,
fontFamily: DISPLAY, fontSize: pt(size), lineHeight: 1.1, color: col('gold'),
align: 'center', placement: at('page', 'top-left', 17, y, { width: mm(WIDTH - 34) }),
...extra });
const caps = { fontWeight: 600, textTransform: 'uppercase', letterSpacing: pt(2.2) };
const full = (elements) => ({ enabled: true, minHeight: mm(HEIGHT - TOP),
slot: { elements } });
const bare = { numbered: false, toc: false, header: { elements: [] },
footer: { elements: [] } };
// A plate's section drops the foot margin, so its design reaches the foot of the page.
const flush = (top = TOP, side = 0) => ({ margins: { top: mm(top), bottom: mm(0),
left: mm(INNER + side), right: mm(OUTER + side) } });
const dark = { palette: { paper: palette.velvet }, marginTop: pt(0), marginBottom: pt(0) };
const behind = (el) => ({ ...el, reserve: false }); // painted under the section's text
const headingStyles = [
{ id: 'cover', ...bare, ...dark, ...flush(), advancedDesign: full([sheet,
box('plate', 130, 44), type('title', '{title}', 138, 27, { italic: true, fontWeight: 500 }),
type('author', '{author}', 159, 9.5, caps)]) },
{ id: 'titlepage', ...bare, ...dark, ...flush(), breakBefore: { enabled: true, parity: 'odd' },
advancedDesign: full([portrait, type('title', '{title}', 146, 30,
{ italic: true, fontWeight: 500 }), type('author', '{author}', 166, 10, caps)]) },
{ id: 'colophon', ...bare, hidden: true, ...flush(132), breakBefore: { parity: 'any' },
bodyStyle: { fontSize: pt(9), lineHeight: pt(12.5), color: col('muted'), textAlign: 'left' } },
{ id: 'tale', numbered: false, toc: true, breakBefore: { enabled: true, parity: 'odd' },
marginTop: mm(30), marginBottom: pt(28),
dropCap: { lines: 3, fontFamily: DISPLAY, color: col('ink'), gap: mm(1.2) } },
// The back: the damask again, and the copy set in gold on a cartouche.
{ id: 'back', ...bare, ...dark, ...flush(74, 10), breakBefore: { enabled: true,
parity: 'even' }, advancedDesign: { enabled: true, slot: { elements: [behind(sheet),
behind(box('plate', 62, 78))] } } },
];
El troquel se mide en milímetros desde el corte, y las pinturas también. El damasco sobrepasa el corte en todo el sangrado; el retrato va unos milímetros más ancho, para que el marco del cuadro quede centrado en la página y en la ventana. La cubierta y la portada quitan el margen inferior, así que su diseño llega al pie de la página, y cada una imprime título y autor desde el frontmatter.
#3 · La línea de troquel en su planilla
print: { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false,
dieLine: { output: 'page', ink: 'Die', width: pt(0.5) } },
El PDF imprime la cubierta entera y traza el contorno de la ventana en una separación Die en sobreimpresión que nunca se entinta: el troquelador lee la forma en ella y la máquina la omite. convertImages: false deja las pinturas como JPEG sRGB, que PDF/X-4 admite, y el archivo se queda por debajo del megabyte.
#4 · El libro cerrado en la mesa
folio: {
tilt: 34, yaw: 0,
paper: { type: 'bookWove', shade: '#f6efe2' },
binding: { type: 'hardcover', cover: 'pages', coverMaterial: 'paper' },
surface: { type: 'walnut' },
lighting: { environment: 'lamp', intensity: 1.15 },
},
Con binding.cover: 'pages' la primera página es la tapa delantera, así que Folio enseña el libro cerrado, con el rostro en la ventana y las paredes del corte recogiendo la luz de la lámpara. Pasa la cubierta para ver la portada entera.
#5 · La cubierta plana que deja ver
const under = new Map();
const beneath = (i) => {
if (!under.has(i) && doc.pages[i]) {
const canvas = document.createElement('canvas');
under.set(i, canvas);
renderPageToCanvas(doc.pages[i], doc, canvas, { scale: 1, beneath });
}
return under.get(i);
};
En el canvas, beneath da al renderizador la página 3 para la ventana de la cubierta, y la cubierta plana enseña también el rostro. El interior de la cubierta no tiene nada debajo, así que su agujero muestra el fondo.
La receta completa
// ═══ Postext Cookbook · Nº 194 · A window cover that frames the title page ═══════════════
// https://postext.dev/en/cookbook/die-cut-window-cover
// Code: MIT · Text: Poe (PD) · Translation: CC BY 4.0 · Paintings: diffusion models
// Fonts: EB Garamond, Cormorant Garamond (SIL OFL 1.1) · Needs postext ≥ 1.84.0
//
// Poe's tale of a portrait in an oval frame, as a small hardback whose damask cover has an
// oval window cut through it. Closed, the book shows the face of the portrait on the title
// page through the window; the window's edge falls on the gilt of the painted frame.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createFolioFromDocument } from 'https://esm.sh/postext-folio';
const LANG = 'es'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'die-cut-window-cover';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: ink on cream inside; gold on a near-black for the cover and its plates
const palette = {
ink: '#2b2320', // the text
paper: '#f6efe2', // a cream book wove
velvet: '#2a0d10', // the wall behind the portrait, and the endpapers
plate: '#160c0b', // the cartouches on the damask
gold: '#d9b36c', // the title type, the colour of the painted frame
muted: '#6f6158', // the note on the text
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
{ id: 'main-color', name: 'gold (defaults)', value: { hex: palette.gold, model: 'hex' } },
];
// #endregion
const [WIDTH, HEIGHT, BLEED] = [130, 195, 3]; // mm: a small hardback, and its bleed
const [TOP, FOOT, INNER, OUTER] = [18, 24, 16, 19];
const [TEXT, DISPLAY] = ['EB Garamond', 'Cormorant Garamond'];
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
// #region answer: one oval die through the cover, in register with the frame beneath
// The window is cut through the first leaf, so the closed book shows page 3 through it.
// Its size is measured on the title-page painting: a little wider than the frame's opening,
// so the cut edge falls on the gilt and the face sits in the middle of the hole.
const dieCuts = {
shapes: [{ id: 'window', name: t({ en: 'Oval window', es: 'Ventana oval' }),
shape: 'ellipse', x: mm(26), y: mm(15.7), width: mm(78), height: mm(102) }],
pages: [{ pages: '1', die: 'window' }], // page 1, the front board
};
El script.js compuesto funciona tal cual: pégalo como script de módulo en cualquier página o abre la receta en CodePen. Carpeta de la receta en GitHub ↗ (se abre en una nueva pestaña)
Variantes
#Llama a la planilla como la espera la máquina de corte
Las mesas de corte digital buscan una tinta plana llamada CutContour, casi siempre magenta, y un trazo finísimo.
- dieLine: { output: 'page', ink: 'Die', width: pt(0.5) } },
+ dieLine: { output: 'page', ink: 'CutContour', cmyk: { c: 0, m: 100, y: 0, k: 0 },
+ width: pt(0.25) } },#Una ventana redonda
Un círculo enseña solo el rostro; el marco queda oculto bajo la cubierta hasta que se pasa.
- shape: 'ellipse', x: mm(26), y: mm(15.7), width: mm(78), height: mm(102) }],
+ shape: 'circle', x: mm(32), y: mm(24), width: mm(66), height: mm(66) }],Créditos
- Receta
- Ignacio Ferro
- Texto
- The Oval Portrait, en el texto del Broadway Journal (1845), según el libro electrónico 2147 de Project Gutenberg, con el «rarely» de Poe donde el libro electrónico dice «merely» · Edgar Allan Poe · dominio público
- La traducción española, la nota sobre el texto y el texto de la contracubierta · Postext Cookbook · CC BY 4.0
- Imágenes
- Cubierta y contracubierta: un damasco de granadas · Generated With Diffusion Models · original
- Portada: el retrato oval sobre una pared de terciopelo · Generated With Diffusion Models · original
- Fuentes
- EB Garamond (SIL OFL 1.1) · Cormorant Garamond (SIL OFL 1.1)
- Código
- MIT, como Postext
Editar este texto ↗ (se abre en una nueva pestaña)Carpeta de la receta en GitHub ↗ (se abre en una nueva pestaña)


