Comments (17)
Does it work with empty doc? If not can you attach empty for comparison that works?
from officeimo.
Sure. Although both Open Office and Libre Office are free if you want to run some tests of your own.
libre_office_empty.docx
OfficeIMO_empty.docx
I created two empty docx files, one using Libre Office and another using this code:
using (WordDocument document = WordDocument.Create(path, true))
{
document.Save();
}
Open Office does open the one created with Libre Office, and does not open the one created with Office IMO.
from officeimo.
This needs testing:
Old, but maybe still there.
from officeimo.
So i'm pretty confident this is due to forward slash
There are plenty of issues around that:
I saw some project actively changing it:
OpenXMLSDK doesn't expose those paths directly from what I see.
I can see ClosedXML having similar issue:
I am not sure how to fix it. I'm open for fixes/suggestions as I can see it being useful, but don't have high hopes.
I see this code:
But after trying to apply it I get unreadable word. I guess i'm missing some details.
from officeimo.
I've created a PR:
But requires testing, and I am pretty sure this is not the best option to do it like that
from officeimo.
I have the same problem, but new documents created from a template (I use a copy in memory of a document that is on disk) cannot be opened in MS Word, but work correctly in LibreOffice and Google docs :)
from officeimo.
You mean created by OfficeIMO? Before or after the PR?
from officeimo.
You mean created by OfficeIMO? Before or after the PR?
Im didnt test with your changes. Used only latest release from nuget.
from officeimo.
Can you test with the PR?
from officeimo.
Can you test with the PR?
I checked your fix from PR. It doesn't work in my case :( I'll try to get the logs from Ms Word where the docx file parser got an exception, and maybe figure out what's wrong.
from officeimo.
I found compatibility issues with the property Paragraph .ParagraphAlignment. If you override this property or set it for a new paragraph, it will cause errors in Ms Word and you will not be able to open a new document.
from officeimo.
I found compatibility issues with the property Paragraph .ParagraphAlignment. If you override this property or set it for a new paragraph, it will cause errors in Ms Word and you will not be able to open a new document.
So under which conditions exactly your documents don't open? They don't open in MS Word? What is the code you're using - i'm a bit confused what doesn't work for you?
from officeimo.
I found compatibility issues with the property Paragraph .ParagraphAlignment. If you override this property or set it for a new paragraph, it will cause errors in Ms Word and you will not be able to open a new document.
So under which conditions exactly your documents don't open? They don't open in MS Word? What is the code you're using - i'm a bit confused what doesn't work for you?
I apologize for flooding this issue. In general, if I add any paragraph to a document and define the ParagraphAlignment property using the library, the document stops opening. If I donβt touch the ParagraphAlignment property, then everything opens fine.
from officeimo.
So in other words Create Word Document, add paragraph, add paragraph alignment and it stops opening in Word? Which version of word?
from officeimo.
public static void Example_BasicWord(string folderPath, bool openWord) {
Console.WriteLine("[*] Creating standard document with paragraph");
string filePath = System.IO.Path.Combine(folderPath, "BasicDocumentWithParagraphs.docx");
using (WordDocument document = WordDocument.Create(filePath)) {
var paragraph = document.AddParagraph("Adding paragraph with some text");
paragraph.ParagraphAlignment = JustificationValues.Center;
//Console.WriteLine(SixLabors.ImageSharp.Color.Blue.ToHexColor());
//Console.WriteLine(SixLabors.ImageSharp.Color.Crimson.ToHexColor());
//Console.WriteLine(SixLabors.ImageSharp.Color.Aquamarine.ToHexColor());
//paragraph.Color = SixLabors.ImageSharp.Color.Red;
//paragraph = document.AddParagraph("Adding another paragraph with some more text");
//paragraph.Bold = true;
//paragraph = paragraph.AddText(" , but now we also decided to add more text to this paragraph using different style");
//paragraph.Underline = UnderlineValues.DashLong;
//paragraph = paragraph.AddText(" , and we still continue adding more text to existing paragraph.");
//paragraph.Color = SixLabors.ImageSharp.Color.CornflowerBlue;
document.Save(true);
}
}
I just did this and it worked. You need to be more specific.
from officeimo.
I was using LibreOffice for this from home last year, it seemed to work fine.
If it's something specific like how you mentioned the property, I can't say
anything, the documents were simple at the time.
from officeimo.
Just noticed this was about OpenOffice... It's a virtually dead project on life support for years, apparently it has a userbase but people really should not be using it, not sure if there's an issue with it being dead or not.
from officeimo.
Related Issues (20)
- Image layout options HOT 8
- Mislabeled Behavior? HOT 8
- Potential Bug: Does iteration over TableCell's Paragraphs property allow mutation? HOT 21
- Stable and unlikely to change vs unstable and subject to change vs depreciated api HOT 13
- How to add paragraph without pagebreak? HOT 4
- ContentControls.Add() is trimming space from user selection HOT 1
- How to display the specific gravity value in a pie chart HOT 2
- How to add image watermark? HOT 3
- how can I add a table with two rows and each row had diff columns and width? HOT 1
- Issue with Text Replacement in Multi-Line Text Boxes HOT 1
- ConditionalFormattingFirstColumn sample HOT 2
- [Question] Does OfficeIMO provide support for HTML fragments? HOT 4
- [Question] Is Save As Web Page support? HOT 2
- Repeat as header row at the top on each page HOT 6
- How do I set the first column style of a table not to be bold HOT 2
- WordParagraph.Style can throw an exception HOT 3
- MergeVertically not working on Rows[0].Cells[0]
- How to access all of document contents in correct order? HOT 3
- WordParagraph.IsFirstRun and IsLastRun can throw a null reference exception
- Superscript / subscript support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from officeimo.