PHPWord Footer Position The Next CEO of Stack OverflowRetrieve the position (X,Y) of an HTML elementFixed footer obscure firefox search matchFixed position but relative to containerCustom header and footer in html pageAbsolute Positioned Footer In Relative Positioned Container100% height relatively positioned footerPhpWord: How to create a new paragraph with border and background color?PHPWord LineBreak in TextRun not workingHow to manage 'Distance from Text' with addImage in phpWordPHPWord generated docx watermark image with 0 margin is shifted with some space from left and top edge of document

Are there any limitations on attacking while grappling?

How did people program for Consoles with multiple CPUs?

Written every which way

How to count occurrences of text in a file?

Is there a difference between "Fahrstuhl" and "Aufzug"

Skipping indices in a product

How to transpose the 1st and -1th levels of arbitrarily nested array?

Indicator light circuit

If the heap is initialized for security, then why is the stack uninitialized?

MessageLevel in QGIS3

Return the Closest Prime Number

Why didn't Khan get resurrected in the Genesis Explosion?

Won the lottery - how do I keep the money?

Why do airplanes bank sharply to the right after air-to-air refueling?

If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?

Why did we only see the N-1 starfighters in one film?

Different harmonic changes implied by a simple descending scale

Extending anchors in TikZ

A "random" question: usage of "random" as adjective in Spanish

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

calculus parametric curve length

Is there a way to save my career from absolute disaster?

Why does the UK parliament need a vote on the political declaration?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin



PHPWord Footer Position



The Next CEO of Stack OverflowRetrieve the position (X,Y) of an HTML elementFixed footer obscure firefox search matchFixed position but relative to containerCustom header and footer in html pageAbsolute Positioned Footer In Relative Positioned Container100% height relatively positioned footerPhpWord: How to create a new paragraph with border and background color?PHPWord LineBreak in TextRun not workingHow to manage 'Distance from Text' with addImage in phpWordPHPWord generated docx watermark image with 0 margin is shifted with some space from left and top edge of document










1















Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?



I have a footer exactly as required in terms of text.



$footer = $section->addFooter();
$textrun = $footer->addTextRun();
$textrun->addText('My Footer Text');


However, what I'd like to achieve is to:



Reduce the height of the footer or set the distance from bottom of the page.



Space I'd like to remove



There in an option in Word365 called "Footer from bottom", there are also similar options in older versions of Word.



Option in Word365



I've tried adjusting the page margins but these appear to be separate from the footer (and header) positioning.










share|improve this question




























    1















    Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?



    I have a footer exactly as required in terms of text.



    $footer = $section->addFooter();
    $textrun = $footer->addTextRun();
    $textrun->addText('My Footer Text');


    However, what I'd like to achieve is to:



    Reduce the height of the footer or set the distance from bottom of the page.



    Space I'd like to remove



    There in an option in Word365 called "Footer from bottom", there are also similar options in older versions of Word.



    Option in Word365



    I've tried adjusting the page margins but these appear to be separate from the footer (and header) positioning.










    share|improve this question


























      1












      1








      1








      Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?



      I have a footer exactly as required in terms of text.



      $footer = $section->addFooter();
      $textrun = $footer->addTextRun();
      $textrun->addText('My Footer Text');


      However, what I'd like to achieve is to:



      Reduce the height of the footer or set the distance from bottom of the page.



      Space I'd like to remove



      There in an option in Word365 called "Footer from bottom", there are also similar options in older versions of Word.



      Option in Word365



      I've tried adjusting the page margins but these appear to be separate from the footer (and header) positioning.










      share|improve this question
















      Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?



      I have a footer exactly as required in terms of text.



      $footer = $section->addFooter();
      $textrun = $footer->addTextRun();
      $textrun->addText('My Footer Text');


      However, what I'd like to achieve is to:



      Reduce the height of the footer or set the distance from bottom of the page.



      Space I'd like to remove



      There in an option in Word365 called "Footer from bottom", there are also similar options in older versions of Word.



      Option in Word365



      I've tried adjusting the page margins but these appear to be separate from the footer (and header) positioning.







      position footer margins phpword phpoffice






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 14:57









      Dave

      2,84681830




      2,84681830










      asked Mar 7 at 14:10









      user2470528user2470528

      62




      62






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I managed to find a solution by reviewing the GitHub repo.



          This commit provides a solution: Added support for page header & page footer height



          You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.



          // Adding an empty Section to the document...
          $section = $this->_phpWord->addSection(array(
          'headerHeight' => 300,
          'footerHeight' => 50)
          );

          $footer = $section->addFooter();
          $textrun = $footer->addTextRun();
          $textrun->addText('My Footer Text');


          There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().



          $section->setHeaderHeight(300);
          $section->setFooterHeight(50);





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55045809%2fphpword-footer-position%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I managed to find a solution by reviewing the GitHub repo.



            This commit provides a solution: Added support for page header & page footer height



            You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.



            // Adding an empty Section to the document...
            $section = $this->_phpWord->addSection(array(
            'headerHeight' => 300,
            'footerHeight' => 50)
            );

            $footer = $section->addFooter();
            $textrun = $footer->addTextRun();
            $textrun->addText('My Footer Text');


            There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().



            $section->setHeaderHeight(300);
            $section->setFooterHeight(50);





            share|improve this answer



























              0














              I managed to find a solution by reviewing the GitHub repo.



              This commit provides a solution: Added support for page header & page footer height



              You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.



              // Adding an empty Section to the document...
              $section = $this->_phpWord->addSection(array(
              'headerHeight' => 300,
              'footerHeight' => 50)
              );

              $footer = $section->addFooter();
              $textrun = $footer->addTextRun();
              $textrun->addText('My Footer Text');


              There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().



              $section->setHeaderHeight(300);
              $section->setFooterHeight(50);





              share|improve this answer

























                0












                0








                0







                I managed to find a solution by reviewing the GitHub repo.



                This commit provides a solution: Added support for page header & page footer height



                You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.



                // Adding an empty Section to the document...
                $section = $this->_phpWord->addSection(array(
                'headerHeight' => 300,
                'footerHeight' => 50)
                );

                $footer = $section->addFooter();
                $textrun = $footer->addTextRun();
                $textrun->addText('My Footer Text');


                There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().



                $section->setHeaderHeight(300);
                $section->setFooterHeight(50);





                share|improve this answer













                I managed to find a solution by reviewing the GitHub repo.



                This commit provides a solution: Added support for page header & page footer height



                You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.



                // Adding an empty Section to the document...
                $section = $this->_phpWord->addSection(array(
                'headerHeight' => 300,
                'footerHeight' => 50)
                );

                $footer = $section->addFooter();
                $textrun = $footer->addTextRun();
                $textrun->addText('My Footer Text');


                There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().



                $section->setHeaderHeight(300);
                $section->setFooterHeight(50);






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 13:25









                user2470528user2470528

                62




                62





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55045809%2fphpword-footer-position%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown