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

Support for paragraph with borders #294

Closed
CauanCabral opened this issue Jun 26, 2014 · 7 comments
Closed

Support for paragraph with borders #294

CauanCabral opened this issue Jun 26, 2014 · 7 comments

Comments

@CauanCabral
Copy link

There's a way to define a paragraph border (size, color)?
If not, how can I help include that feature? I'd read Element/Table and Style/Table as base and tried changed Style/Paragraph to extends Border but didn't work.

@ivanlanin ivanlanin added this to the 0.12.0 milestone Jun 28, 2014
@ivanlanin ivanlanin self-assigned this Jun 28, 2014
@ivanlanin
Copy link
Contributor

I'll work on this enhancement this weekend.

ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Jun 28, 2014
@ivanlanin
Copy link
Contributor

@CauanCabral I've added this feature to the develop branch. We can now use borderSize and borderColor on paragraph.

$section->addText(
    'Paragraph text.',
    null,
    array('borderSize' => 4, 'borderColor' => 'FF0000')
);

Please test and close this issue when you confirm that this feature is working. Thanks.

@CauanCabral
Copy link
Author

Thanks @ivanlanin .
Border now work like a charm, but something in develop branch did ToC break =[

@ivanlanin
Copy link
Contributor

Can you give more detailed information about the problem with TOC? Sample_17_TitleTOC in the samples folder seems to work fine.

@CauanCabral
Copy link
Author

Sure: https://gist.github.com/CauanCabral/723e9c1c91faa980f539
I put in that Gist the PHP Source and attached (link at the end of source) to Google Drive output files (Word 2007).

When I open lib generated docx in Google Drive, TOC are OK for sample code, but in my code keep broke.

Back in master branch, TOC in my docs are OK.

@ivanlanin
Copy link
Contributor

There are two things that you have to do: (1) Define the heading (title) styles; (2) Change the addToc method into addTOC (line 66). The method is now case sensitive since we create it as a dynamic function to reduce static dependency. I'll see how we can handle this since PHP is actually case insensitive in terms of method call.

This is the sample of how to define the heading styles:

$phpWord->addTitleStyle(1, array('size' => 20, 'color' => '333333', 'bold' => true));
$phpWord->addTitleStyle(2, array('size' => 16, 'color' => '666666'));

@CauanCabral
Copy link
Author

Thanks 👍

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

No branches or pull requests

3 participants