word-docx / docx Goto Github PK
View Code? Open in Web Editor NEWThis is a non-official fork of DocX at http://docx.codeplex.com
This is a non-official fork of DocX at http://docx.codeplex.com
I will need to have some rows with top borders, some with bottom borders and only a few with a specific background color. How may I do so?
Font is always set to Calibri regardless of what is set in code. This behaviour is visible even in the Hello World example.
Edit:
Testing environment -
Visual Studio 2010
Windows XP and Windows 7 64 bit
In addition to the Fonts not working, when using lists, the color, size etc are also not being set although they are working for normal paragraphs/text.
Hello every one! I am making a replace text into .docx file, but I need to access the shapes like "checkboxs", these are into a table. When I read the template.Tables[1].Rows[0].Cells[0].Pictures, the last object give me the next exception: System.NullReferenceException
I can not undertund why, I need change this shapes/pictures on my replace process:
This is my code:
private static DocX CreateInvoiceFromTemplate(DocX template)
{
var tables = template.Tables;
var dataRepository = DataDocumentRepository.Instance;
template.ReplaceText("{EmployerName}", "PABLO H");
var pics = template.Tables[1].Rows[0].Cells[0].Pictures;
template.ReplaceText("{DateImplemented}", DateTime.Now.ToString("yyyy/MM/dd"));
return template;
}
I'm with problems with styles on lists. Every list are with numbers in every level.
I've tried to rebind a fork to CodePlex svn to get latest, but had no luck so far.
Can you share your svn-remote
section of .git/config
and maybe .rev_map
?
Hello!
I get the System.NullReferenceException when I tried to Load attached file.
Пособие Лисп финал.docx
I'm trying to add a Paragraph to a List using AddItem method:
List L; Paragraph P; L.AddItem(P);
But it never adds it because P.IsListItem is false. How can I create a Paragraph where IsListItem is true?
Thank you.
The same goes for when one uses DocX.Insert( to insert a new document - all headers seem to be getting combined.
In my particular case, I need the first two pages to have a different header than the rest of the pages, but I cannot find any way of doing that using this package right now.
If someone could give me some guidance, I could see if I can add this functionality myself, but as of right now I wouldn't know where to start.
I know it has been a while since there has been any activity on this repo, but since I am having an issue regarding lists in DocX, I thought it should be posted here. I have also made an issue on the CodePlex site: https://docx.codeplex.com/workitem/13437
What happens is that any numbered list inserted into a document when a numbered list is already present, continues numbering. Meaning that I get something like this:
1 List 1, Item 1
2 List 1, Item 2
Some paragraph
3 List 2, Item 1
4 List 2, Item 2
What I want, is that the second lists starts numbering on 1. This never happens, even if I pass 1 as startNumber (I've tested with passing it to the AddList method and the AddListItem method).
In the numbering.xml file, I can see that both numIds and abstractNumIds seem to be generated correctly. The two lists have different numIds which each has its own abstractNumId. Might this be a bug with Word itself? Or some incompatability with Word 2010? I assume that this has worked at some point since you have an example here: http://blog.tnwdevlabs.com/2012/09/06/docx/
I'm using DocX to create several documents from different threads at the same time. The thread that is trying to call DocX.Save() has hung indefinitely.
WindowsBase.dll!MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(int retryCount, out string fileName) + 0x7b bytes
WindowsBase.dll!MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary() + 0x172 bytes
WindowsBase.dll!MS.Internal.IO.Packaging.SparseMemoryStream.Write(byte[] buffer, int offset, int count) + 0xac bytes
WindowsBase.dll!MS.Internal.IO.Packaging.CompressEmulationStream.Write(byte[] buffer, int offset, int count) + 0x3d bytes
WindowsBase.dll!MS.Internal.IO.Packaging.CompressStream.Write(byte[] buffer, int offset, int count) + 0x8a bytes
WindowsBase.dll!MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(byte[] buffer, int offset, int count) + 0xad bytes
WindowsBase.dll!MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(byte[] buffer, int offset, int count) + 0x56 bytes
mscorlib.dll!System.IO.StreamWriter.Flush(bool flushStream, bool flushEncoder) + 0x62 bytes
mscorlib.dll!System.IO.StreamWriter.Write(char[] buffer, int index, int count) + 0xab bytes
System.Xml.dll!System.Xml.XmlEncodedRawTextWriter.FlushBuffer() + 0x3c bytes
System.Xml.dll!System.Xml.XmlEncodedRawTextWriter.RawText(char* pSrcBegin, char* pSrcEnd) + 0xf1 bytes
System.Xml.dll!System.Xml.XmlEncodedRawTextWriter.RawText(string s) + 0x23 bytes
System.Xml.dll!System.Xml.XmlEncodedRawTextWriterIndent.WriteIndent() + 0x22 bytes
System.Xml.dll!System.Xml.XmlEncodedRawTextWriterIndent.WriteStartElement(string prefix, string localName, string ns) + 0x21 bytes
System.Xml.dll!System.Xml.XmlWellFormedWriter.WriteStartElement(string prefix, string localName, string ns) + 0x9d bytes
System.Xml.Linq.dll!System.Xml.Linq.ElementWriter.WriteStartElement(System.Xml.Linq.XElement e) + 0x47 bytes
System.Xml.Linq.dll!System.Xml.Linq.ElementWriter.WriteElement(System.Xml.Linq.XElement e) + 0x3c bytes
System.Xml.Linq.dll!System.Xml.Linq.XElement.WriteTo(System.Xml.XmlWriter writer) + 0x49 bytes
System.Xml.Linq.dll!System.Xml.Linq.XContainer.WriteContentTo(System.Xml.XmlWriter writer) + 0xd4 bytes
System.Xml.Linq.dll!System.Xml.Linq.XDocument.WriteTo(System.Xml.XmlWriter writer) + 0x79 bytes
System.Xml.Linq.dll!System.Xml.Linq.XDocument.Save(System.IO.TextWriter textWriter, System.Xml.Linq.SaveOptions options) + 0x3c bytes
DocX.dll!Novacode.DocX.Save() + 0xc1 bytes
Searching for this method "CreateUserScopedIsolatedStorageFileStreamWithRandomName" yielded this SO question https://stackoverflow.com/questions/21482820/openxml-hanging-while-writing-elements#
Microsoft published an article about the problem here https://stackoverflow.com/questions/21482820/openxml-hanging-while-writing-elements#
Long story short, "CreateUserScopedIsolatedStorageFileStreamWithRandomName" is not thread safe, so by extension "XDocument.Save" and "DocX.Save" are not thread safe.
For now I will try to work around the issue in my application. I'd recommend a fix within DocX to prevent other users from trying to debug a deadlock.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.