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

Save template to Word2007 #61

Open
gmercey opened this issue Feb 3, 2014 · 7 comments
Open

Save template to Word2007 #61

gmercey opened this issue Feb 3, 2014 · 7 comments

Comments

@gmercey
Copy link

gmercey commented Feb 3, 2014

Is there a way to save a PHPWord Template Object with Word2007 Writer, for the compatibility ?
Thanks


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Progi1984 Progi1984 added this to the 0.7.2 milestone Feb 25, 2014
@ghost
Copy link

ghost commented Mar 3, 2014

@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?

@Progi1984 Progi1984 removed this from the 0.9.0 milestone Mar 24, 2014
@Progi1984 Progi1984 assigned ghost Mar 25, 2014
@Progi1984
Copy link
Member

@RomanSyroeshko Assigned :)

@ivanlanin ivanlanin added this to the 1.0.0 milestone Apr 13, 2014
@ivanlanin
Copy link
Contributor

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

@ghost
Copy link

ghost commented May 13, 2014

What do you mean?

@ivanlanin
Copy link
Contributor

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

@ghost
Copy link

ghost commented May 13, 2014

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

@ghost ghost removed their assignment May 21, 2016
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Nov 17, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
@Progi1984 Progi1984 modified the milestones: 1.2.0, Later Nov 30, 2023
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