in my site the admin edits some data which i need to save to a doc file. so i implemented this using ckeditor. It works fine but when i try to open this file it says 'word cannot start the converter mswrd632.wpc'. what am i doing wrong?
Apr 24, 2017 This is a demonstration of a tool I wrote in C# and XAML (using WPF) the tool reads in save files of the game Crusader Kings 2 (prior to Monks and Mystics, the new DLC), and allows you to edit. You can open save files in Notepad, but they will take several minutes to load. A more advanced text editor such as Notepad is therefore recommended. In order to edit a character you must first locate them within the file. The Character ID of the player character can be found at the very top of the save file.
this is my codehow can we save data to a doc file.is there any other way?
Sibu
SibuSibu
1 Answer
There is no problem with your code. The problem is that the file you are creating is a regular text file with the doc extension, in other words not a real Word file. If you don't have to write a doc file, just keep it as a plain .txt and that will solve the problem.
Now if your project specs require you to have that file as a doc, you can do the following:
- Use the 'HTML' approach(no COM required)Take a look at Sergey Kornilov's post: Create Word Document using PHP in LinuxThere is also a similar question here: Reading/Writing a MS Word file in PHP
- Use a COM Object - you will have to go that route if you need an elaborate word file
This is from my experience. Let's hope somebody will come up with a better and more efficient solution.
Good Luck!
UPDATE:I automatically assumed you are working in a Win environment. In this case COM will do, if you need it to work on a Linux machine, your alternative is OpenOffice
This is a decent article on COM and stuff: http://www.webcheatsheet.com/php/create_word_excel_csv_files_with_php.php#wordcom
For OpenOffice just look at their API - http://api.openoffice.org/Take a look at their forum, I am sure they have examples with PHP.
My personal advice is to play with those, but work on a final solution after a day or two, if you have the time. Writing Word files is certainly not my forte, so there could possibly be another way of handling this.
Good luck!
UPDATE
Community♦
Dimitar DimitrovDimitar Dimitrov
Not the answer you're looking for? Browse other questions tagged phpfile or ask your own question.
Two weeks ago, we interviewed Paradox Development Studio on the new converter DLC that lets you import your version of medieval Europe from Crusader Kings II into Europa Univesalis IV . Now that the DLC is out, we went hunting for some of the less than historically accurate groups and nations that can be carried over. From Viking holy orders to a restored Roman Empire, here's how they pan out in EU4.
The Jomsvikings
A Norse Pagan warrior brotherhood that functions as a Holy Order in CK2, the Jomsvikings become a playable Warrior Cult (basically identical to a theocracy) if they survive with landed titles into EU4. In addition to the Land and Naval Forcelimit modifiers they gain from importing the Reformed Norse faith, they also have a unique idea group:
The Jomsvikings Code: Morale of Armies +0.10
The Legend of Jomsborg: Land Forcelimit +15%, Naval Forcelimit +5%
For the Glory of the Allfather: Manpower Recovery Speed +10%
By Thor's Name: Permanent cassus belli against all non-pagans
Adopt Feudal System: Production Efficiency +10%
Implement the Högting: Stability Cost -10%
Valhalla Awaits: Yearly Prestige +1
Their traditions grant a bonus to Leader Shock and Discipline, and completing the tree grants a +10% to Infantry Combat Ability. So, war. And more war. Especially in the early game (when Shock is more important than Fire), they are likely to have one of the scariest armies in the world. I recommend the Quality ideas in the Military group, which will make your soldiers truly peerless.
The Roman Empire
If you managed to restore the Roman Empire as Byzantium using CK2's Legacy of Rome DLC, they will be imported into EU4 as an Empire with a unique idea group:
Pax Romana: National Revolt Risk -1
Legacy of Rome: Diplomatic Reputation +5
S.P.Q.R.: Stability Cost -20%
The Roman Legions: Land Forcelimit +15%, Infantry Combat Ability +10%
Roman Architecture: Production Efficiency +20%
Imperial Bureaucracy: National Tax Modifier +10%
Imperium Sine Fine: Core Creation Cost -20%
Their traditions grant +10% Discipline and +1 Yearly Legitimacy, while completing the track gives you an insane +33% Manpower. This seems more than a little overpowered, based on the other idea groups in the game. But hey, restoring Rome in CK2 isn't easy, so being rewarded with all the tools to become an intercontinental superpower is probably appropriate. In contrast to the Jomsvikings, Rome pairs well with the Quantity military ideas, which should swell your ranks to the point that globally-based legions are barely a tax on your resources.
The High American Tech Group
If your CK2 game was running the Sunset Invasion DLC when you exported it, the Europeans will find a very different version of the Americas when they arrive in EU4. All of the Native American Nations will be lifted up from the New World tech group (200% tech cost, -2 Monarch Power) to a fictional 'High American' tech group, which is identical to the Western tech group (100% tech cost, no monarch power modifiers.)
Central America is blanketed by the Aztec Empire, while their rivals, the Incans (who, if you payed attention to CK2's Aztec Invasion Events, actually invented gunpowder infantry in this universe) dominate South America. Contrary to what I was told in the interview, the other North American states from Vanilla EU4 still exist as independent nations, and they have High American technology. The Creek, Shawnee, and Huron are Feudal Monarchies. the Cherokee have a Theocracy, and the Mayans and Iroquois are... Merchant Republics, for some reason. All follow the Aztec Religion, save the Incans, and the Shamanist Huron.
The new Aztec and Incan relgions are both considered part of the Pagan religious group. The Aztec Religion grants -1 National Revolt Risk and +0.5 Morale of Armies. The Incan Religion grants +10% Tax Modifier, and +1 Tolerance of the True Faith.
The Aztecs and Incans also get unique idea groups, while the rest of the North Americans use the generic ones.
Aztec ideas are mostly focused on warfare and forcibly colonizing the Old World:
Build the Tepochicalli and the Calmecac: Technology Cost -5%
Enact the Flower Wars: National Revolt Risk -1
Invade the Whiteskins: Naval Attrition -10%, enables Conquistadors and Explorers even if you haven't unlocked the prerequisite tech
State Administration Reform: National Tax Modifier +5%
Found the Imperial Cities: Production Efficiency +5%
Found the Imperial Jaguars and Eagles: Discipline +10%
The Imperial Road Network: Global Tariffs +10%
Aztec traditions grant +5% Infantry Combat Ability and -5% Advisor Cost. Completing the track grants +0.1 Morale of Armies.
Incan ideas focus more on economy and infrastructure.
Census Record Quipo: National Manpower Modifier +5%
Enforce Quechua: Stability Cost -5%
The Written Word: Technology Cost -10%
Official Axe-monies: National Trade Income +10%
Imperial Gold Trading: Merchants +1
State Administration Reform: National Tax Modifier +5%
The Imperial Road Network: Global Tariffs +10%
Incan traditions grant +20% Fort Defense and -5% Advisor Cost.Completing the track grants +10% Land Forcelimit.
If you haven't yet, check out our review of Europa Universalis IV .