gembox-document

System.Printing.PrintQueueException: PrintTicket provider failed to bind to printer. Win32 error: Access is denied

我与影子孤独终老i 提交于 2019-12-24 22:06:05
问题 I have an application where I want to print a Word document. I am using third party GemBox software, and in my development environment this code works; public void OutputLetter(string outputFile, string placeholder, string newText) { using (var document = DocX.Load(this.InputFile)) { document.ReplaceText(placeholder, newText); document.SaveAs(outputFile); } this.PrintDocument(outputFile); } private void PrintDocument(string outputFile) { var document = DocumentModel.Load(outputFile,

Gembox Document prevent pagebreak in table?

风流意气都作罢 提交于 2019-12-13 05:18:44
问题 Is it possible in Gembox.Document to insert a table to a document and prevent it from being split by a page break but instead move it to the next page if it does not fit on the previous page? I have looked through the samples and the documentation but not found anything. 回答1: You need to set KeepLinesTogether and KeepWithNext properties to true for paragraphs that are located in that table. For example try the following: Table table = ... foreach (ParagraphFormat paragraphFormat in table