GithubHelp home page GithubHelp logo

Save template to Word2007 about phpword HOT 7 OPEN

phpoffice avatar phpoffice commented on May 4, 2024
Save template to Word2007

from phpword.

Comments (7)

 avatar commented on May 4, 2024

@gmercey, it's a good question. Current version of Template saves only XML came from template file. There is no way to work with Template as with set of objects (tables, paragraphs, etc.) like we can with do with Document.

@Progi1984, please assign this to me. I will look what can be done with that. Also I would like you to replan this for some release next to 0.7.2. Possible?

from phpword.

Progi1984 avatar Progi1984 commented on May 4, 2024

@RomanSyroeshko Assigned :)

from phpword.

ivanlanin avatar ivanlanin commented on May 4, 2024

I just realize that the solution in #210 might be applicable here. @gmercey, can you please check? Thanks.

from phpword.

 avatar commented on May 4, 2024

What do you mean?

from phpword.

ivanlanin avatar ivanlanin commented on May 4, 2024

You can save the template to a temp docx and read the temp using the reader. Something like below:

$document = $phpWord->loadTemplate('template.docx');

// Process the template ...

$document->saveAs('temp.docx'); // Save to temp file
$phpWord = \PhpOffice\PhpWord\IOFactory::load('temp.docx'); // Read the temp file

// Do something with the phpWord object ...

unlink('temp.docx'); // Delete the temp file

from phpword.

 avatar commented on May 4, 2024

There is nothing new here. This is how template processor works with XML now. ;)

from phpword.

github-actions avatar github-actions commented on May 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

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.