Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addNumberingStyle DO NOT add Numbering Styles #2672

Open
mcinon opened this issue Sep 9, 2024 · 1 comment
Open

addNumberingStyle DO NOT add Numbering Styles #2672

mcinon opened this issue Sep 9, 2024 · 1 comment

Comments

@mcinon
Copy link

mcinon commented Sep 9, 2024

Describe the bug and add attachments

$phpWord->addNumberingStyle(
'numberStyle', // Nombre del estilo
[
'type' => 'multilevel', // Tipo de lista: 'multilevel' para numeración
'levels' => [
[
'format' => 'decimal',
'text' => '%1.', // Formato de número
'left' => 360, // Sangría
'hanging' => 360,
'tabPos' => 360,
'font' => 'Times New Roman', // Fuente para los números
'size' => 16 // Tamaño del número
]
]
]
);
the size or font items do not work when i use the numberStyle

$section2->addListItem("Primer elemento", 0, $estiloTextoSeccion2, 'numberStyle', $estiloParrafoSeccion2);

the text rigth to the number apply the font and paragraph styles, the number apply the format, text, left, hanging, tabPos styles but the number remains on default values of font size or color or font family....

Expected behavior

  1. the number should be size 16

Steps to reproduce

'Times New Roman', 'size' => 20, 'color' => 'FF0000']; $estiloParrafoSeccion2 = ['alignment' => 'left', 'spaceAfter' => 100]; // Alineado a la izquierda // Definir un estilo de lista numerada con tamaño modificado para los números $phpWord->addNumberingStyle( 'numberStyle', // Nombre del estilo [ 'type' => 'multilevel', // Tipo de lista: 'multilevel' para numeración 'levels' => [ [ 'format' => 'decimal', 'text' => '%1.', // Formato de número 'left' => 360, // Sangría 'hanging' => 360, 'tabPos' => 360, 'font' => 'Times New Roman', // Fuente para los números 'size' => 20 // Tamaño del número ] ] ] ); // Crear una nueva sección $section2 = $phpWord->addSection(); // Agregar una lista numerada, con el tamaño de número aumentado $section2->addListItem("Primer elemento", 0, $estiloTextoSeccion2, 'numberStyle', $estiloParrafoSeccion2); $section2->addListItem("Segundo elemento", 0, $estiloTextoSeccion2, 'numberStyle', $estiloParrafoSeccion2); $section2->addListItem("Tercer elemento", 0, $estiloTextoSeccion2, 'numberStyle', $estiloParrafoSeccion2); // Guardar el documento como archivo Word $writer = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $writer->save('listas_con_estilos.docx'); ### PHPWord version(s) where the bug happened 1.3.0 ### PHP version(s) where the bug happened 8.2 ### Priority - [ ] I want to crowdfund the bug fix (with [@algora-io](https://docs.algora.io/bounties/overview)) and fund a community developer. - [ ] I want to pay the bug fix and fund a maintainer for that. (Contact @Progi1984)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants
@mcinon and others