-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
RTF Writer - Support for Links and Page Breaks #196
Comments
Hi @Centurious. Yes, PHPWord support for RTF are quite limited right now. I can't promise you any exact date, but support for RTF will be better shortly. You can always tweak and enhance the existing code for your need if you want, though. |
Hi @Centurious. I just added this two feature to the |
Hi, I tried the page breaks and it works well. I tried the link and the link function itself works, however it does not seem to accept any styling. I tried passing a name style to the link and passed in an array defining a font and neither seemed to work. |
Ok. I'll work on the styling tonight. |
Link styling should be working now. Please see and run |
I tried the example but for some reason the link does not display in the RTF file at all.
|
That's strange. The RTF file content is actually very simple. {\rtf1\ansi\ansicpg1252\deff0\deftab720
{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red128\green128\blue0;\red0\green0\blue255;\red\green\blue;}
{\*\generator PhpWord;}
\viewkind4\uc1\pard\nowidctlpar\lang1036\kerning1\fs20
{\field {\*\fldinst {HYPERLINK "http://www.google.com"}}{\fldrslt {\cf2\f0\fs20\ul Best search engine}}}\par
\par
\par
{\field {\*\fldinst {HYPERLINK "http://www.bing.com"}}{\fldrslt {\cf1\f0\fs20\b http://www.bing.com}}}\par
{\field {\*\fldinst {HYPERLINK "http://www.yahoo.com"}}{\fldrslt {\cf1\f0\fs20\b http://www.yahoo.com}}}\par
} That's the RTF that we got when running sample 15. |
Aha mystery solved. I had downloaded the master copy rather than development. {\rtf1\ansi\ansicpg1252\deff0\deftab720
{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red128\green128\blue0;\red0\green0\blue255;\red\green\blue;}
{\*\generator PhpWord;}
\viewkind4\uc1\pard\nowidctlpar\lang1036\kerning1\fs20
{\field {\*\fldinst {HYPERLINK "http://www.google.com"}}{\fldrslt {\cf2\f0\fs20\ul Best search engine}}}\par
\par
\par
{\field {\*\fldinst {HYPERLINK "http://www.bing.com"}}{\fldrslt {\cf1\f0\fs20\b http://www.bing.com}}}\par
{\field {\*\fldinst {HYPERLINK "http://www.yahoo.com"}}{\fldrslt {\cf1\f0\fs20\b http://www.yahoo.com}}}\par
} |
Ah, so that's the case :) So you can now use styling for links in RTF? Please close this when you confirm that your issue is solved. The RTF writer is very much underdeveloped compared to the other writers. I'm just starting to work on it during my sparetime. Feel free to help develop it if you have time. Thanks. |
Yes the styling for links and page breaks now works as expected. |
Good to know that it worked. The only "contributing instruction" that we have now is this page, but you've already helped us by submitting any issue that you're facing when using PHPWord. Thanks. |
I would like to use the RTF Writer to create a document with some Page Breaks and Links in it.
When I tried to add page break it simply outputs Page Break in the document.
The text was updated successfully, but these errors were encountered: