Right alignment issue along with styling and background color
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript
- Área
- tooling
Línea de trabajo
Comienza reproduciendo el HTML de Quill proporcionado con PDFKit 0.13.0 y las llamadas separadas a doc.text descritas en el issue. Inspecciona cómo se aplica la alineación entre fragmentos con estilo y, después, verifica que los párrafos alineados a la derecha y centrados conserven el estilo sin superponerse en el PDF generado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Use Case/Description
we are using quill editor on frontend and our input is html string provided by quill editor and we are converting html into text with styling in pdf file using pdfkit with custom logic, it also provides some styling like (header tags, font color, background color, left/center/right/justify alignments, bold/italic/underline and custom font sizes, etc). and we wanted to apply same styling in pdf file using pdfkit also.
Single paragraph can have all the styling applied. for every styling quill editor giving us the separate html tag like p/span/h1...h6/s/strong/etc and to apply the style accordingly we are using the doc.text for each tag with respected option params.
for ex. for bold we are using custom fonts, for em tag we are using the oblique params of doc.text options argument. for background color we are using filled rectange as pdfkit doesnot have anything like background color.
Sample HTML string input
<p class=\"ql-align-right\">Artificial intelligence (AI) is <span style=\"color: rgb(230, 0, 0);\">rapidly </span><span style=\"color: rgb(230, 0, 0); background-color: rgb(255, 255, 102);\">evolving</span><span style=\"color: rgb(230, 0, 0);\"> and becoming increasingly sophisticated. Advancements in machine learning, natural language processing, and computer vision are allowing AI systems to perform tasks that were once thought to be the exclusive domain of humans, such as understanding speec</span>h and recognizing <span style=\"background-color: rgb(178, 178, 0);\">images</span>.</p><p class=\"ql-align-right\"><br></p><p class=\"ql-align-center\"><br></p>
Current Output/Behaviour
Now when whole paragraph is in right alignment with different styling effects, i am adding align: right to every doc.text function but then all of the text overlapping on right side.

Expected Output/Behaviour
right and center alignment should work with all the styling.
Tried Approaches
-
tried with fill and fillAndStroke function for background color with alignment option but not behaving properly
-
tried doc.text for every tag getting from quill editor html string as i explain earlier but in case of
align: rightall of the text overlapping on right side.
Your environment
- pdfkit version: 0.13.0
- Node version: 16
- Browser version (if applicable):
- Operating System:
- Lenguaje dominante
- JavaScript
- Estrellas
- 10.7k
- Forks
- 1.2k
- Merge medio
- 22 h 55 min
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de foliojs/pdfkit
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
foliojs/pdfkit#1804 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
PDFKit crashes when providing fonts as Buffer in tablePosiblemente ocupada @ykw9263 la tomó hace 129 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
foliojs/pdfkit#1743 · 13 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
foliojs/pdfkit#1635 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Get detailed font metricsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foliojs/pdfkit#1512 · 1 comentario · 2 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de foliojs/pdfkit
Issues similares
-
area: core complexity: easy impact: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
ueberdosis/tiptap#8668 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
follow-redirects - CVE-2026-116689Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
axios/axios#11409 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Add: Russia-24 +2Abiertochannels:add check:passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
upstream-dfinity-icp-cli-recipes-static-site upstream-sync
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dfinity/developer-docs#442 ·
Los mantenedores suelen responder en 2 días