Code Monkey home page Code Monkey logo

Comments (4)

ivanlanin avatar ivanlanin commented on May 4, 2024

@ottena Sorry for the late response. I've tested the following code to the latest develop branch:

Test 1:

$footer = $section->createFooter();
$footer->addPreserveText(
    'Page {PAGE} of {NUMPAGES}', 
    array('color' => 'FF0000'),
    array('align' => 'center')
);

Test 2:

$footer = $section->createFooter();
$footer->addPreserveText(
    'Page {PAGE} of {NUMPAGES}',
    null,
    array('align' => 'center')
);

Both displayed correct centered alignment. You must enter alignment as part of the paragraph style, which is the third argument of the function:

$footer->addPreserveText($text, $styleFont = null, $styleParagraph = null)

Can you please test and inform us about the result? Thanks.

from phpword.

ottena avatar ottena commented on May 4, 2024

Hello Ivan,

Thanks for your reply.
It does not matter is is late because I am stil exploring the Word PHP
library.

By entering *null *as style, the alignment is correct.
If I leave it out , alignment is treated as style (I think) and therefore
always left.

Thanks for checking it out.
Problem solved.

Best Regards,
Alex Otten

2014-03-17 13:52 GMT+01:00 Ivan Lanin [email protected]:

@ottena https://github.com/ottena Sorry for the late response. I've
tested the following code to the latest develop branch:

Test 1:

$footer = $section->createFooter();$footer->addPreserveText(
'Page {PAGE} of {NUMPAGES}',
array('color' => 'FF0000'),
array('align' => 'center'));

Test 2:

$footer = $section->createFooter();$footer->addPreserveText(
'Page {PAGE} of {NUMPAGES}',
null,
array('align' => 'center'));

Both displayed correct centered alignment. You must enter alignment as
part of the paragraph style, which is the third argument of the function:

$footer->addPreserveText($text, $styleFont = null, $styleParagraph = null)

Can you please test and inform us about the result? Thanks.

Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-37811453
.

from phpword.

ivanlanin avatar ivanlanin commented on May 4, 2024

Your welcome, Alex. Glad it helps.

from phpword.

pawansharma13 avatar pawansharma13 commented on May 4, 2024

Hi Ivanlanin,

How can we add addPreserveText method in section. I want to add indexing in my doc file with page number.


Exp :
title 1 5
title 2 10
title 3 15
title 4 15
title 5 16


Plz help

Thanks
Pawan Sharma

from phpword.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.