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

Creating a numbered list #17

Open
robballou opened this issue Jan 7, 2014 · 3 comments
Open

Creating a numbered list #17

robballou opened this issue Jan 7, 2014 · 3 comments

Comments

@robballou
Copy link

Hello,

I'm working on creating a numbered list and it's not quite getting written correctly. The text indents, but there is no number before each item.

$list = new PHPRtfLite_List_Numbering($rtf, PHPRtfLite_List_Numbering::TYPE_ARABIC_NUM, $font);
$list->addItem(t('Item 1'));
$list->addItem(t('Item 2'));
$section->addList($list);

The output renders:

screen shot 2014-01-07 at 10 15 21

Is there something additional that I'm missing?

@sigma-z
Copy link
Member

sigma-z commented Jan 14, 2014

There where serveral bugs, that I fixed. Please check out, if your issue still occurs.

@robballou
Copy link
Author

Doesn't look like it's working with the latest master. I've added two links to RTF files. One is an example of creating it with this library and one with Apple's TextEdit. They're using different constructs to do the numbered lists, but thought maybe that would be helpful for debugging.

With PHPRtfLite: http://robballou.com/d/example.rtf

With TextEdit: http://robballou.com/d/test.rtf

@robballou
Copy link
Author

PHP Code for that example:

// registers PHPRtfLite autoloader (spl)
PHPRtfLite::registerAutoloader();

// rtf document instance
$rtf = new PHPRtfLite();
$section = $rtf->addSection();
$list = new PHPRtfLite_List_Numbering($rtf, PHPRtfLite_List_Numbering::TYPE_ARABIC_NUM);
$list->addItem('Test 1');
$list->addItem('Test 2');
$section->addList($list);
$rtf->save('example.rtf');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants