Questions tagged [xpsdocument]

XPSDocument is a class that renders XPS documents in WPF (Windows Presentation Foundation)

113 questions
3
votes
2 answers

How secure are XPS documents?

How secure are XPS documents? After looking from the inside of an XPS document, found the Unicode-string property. Could someone inject e.x. a script into the Unicode string property? How does the XPS viewer treat the Unicode string property? As a…
OrElse
  • 9,709
  • 39
  • 140
  • 253
3
votes
1 answer

Merging xps documents make last one duplicate

I have problem when merging multiple XPS documents into one. When I merge them, the result xps contains last XPS document that duplicated. Here is my function to merge (Modified version of this question): public XpsDocument…
Jalal
  • 6,594
  • 9
  • 63
  • 100
2
votes
0 answers

Disposing of Flowdocument Page after rendering

//Create a User Control with a TextBlock TextBlock textBlock = new TextBlock(); textBlock.Text = "Helo"; UserControl userCOntrol = new UserControl(); userCOntrol.Content = textBlock; …
2
votes
0 answers

.NET PrintTicket Settings C#

I need to print documents in a .NET (C#) microservice. The situation is that some pages of the document need to be stapled, some need to be printed duplex, and others need to be monochrome. I have already found documentation on XPS print jobs, the…
RoWoe
  • 21
  • 2
2
votes
2 answers

How to create an XpsDocument from byte array?

I would like to create a new System.Windows.Xps.Packaging.XpsDocument object from byte array, as I will not want to store it immediately on a local machine. By using a temp file it works fine: public static XpsDocument OpenXpsDocument(string url) { …
cccec
  • 43
  • 1
  • 2
  • 9
2
votes
0 answers

XPs Document OriginX and originY units

I have a WPF canvas with 3 glyphs inside. I am trying to get the XY coordinates for the glyphs in system.drawing.rectangle This is how the pagexml looks like for the XPS
user575219
  • 2,346
  • 15
  • 54
  • 105
2
votes
0 answers

FlowDocument to XPS - lost databinding in DataGrid

I've created a FlowDocument with databinded Datagrid. Output in FlowDocumentScrollviewer is like this: Next, I need to convert this FlowDocument into Fixed document (XPS), in order to print It in A4 paper size. But once I do that, my DataGrid data…
Lucy82
  • 654
  • 2
  • 12
  • 32
2
votes
0 answers

Memory Leak at XpsDocument.GetFixedDocumentSequence()

I am getting an memory leak in below line of code. var fixedSequence = xpsDoc.GetFixedDocumentSequence(); if (fixedSequence == null) return; I tried below given solutions.Adding UpdateLayout cannot solve the…
2
votes
0 answers

print XPS from memory stream

I use c# I need to print DOCX, I send the docx to server , convert it to XPS and return XPS as memory stream. convert docx by aspose. At client I use next code: System.IO.Stream docStream = ...any xps as stream; Package package =…
Leonid
  • 81
  • 11
2
votes
0 answers

How to save a stackpanel as an XPS document in multiple pages in WPF?

I need to save a large stackpanel to an XPS document. Since the stackpanel is lengthy, it cannot be accommodated in a single page while printing. Is there a way to save the stackpanel in XPS expanding multiple pages? Below is my code that saves a…
2
votes
1 answer

VisualBrush Resources not included in Visual in XPS to bitmap conversion

UPDATE: We replaced the Image generation with an alternative that solves the issue (PDF to image) but I am going to leave this question open as I would like to understand if this is possible. On our website at http://www.cloudformatter.com, we were…
Kevin Brown
  • 8,805
  • 2
  • 20
  • 38
2
votes
1 answer

Viewing Xps document - Compressed part has inconsistent data length

XpsDocument xpsDoc = new XpsDocument(fileName, FileAccess.Read); documentViewer.Document = xpsDoc.GetFixedDocumentSequence(); Second line gives next error: Compressed part has inconsistent data length Why?
CSharpered
  • 53
  • 5
2
votes
1 answer

How to create xps file from web page using c#?

How to create xps file from web page using c#? Any ideas?
CSharpered
  • 53
  • 5
2
votes
2 answers

.NET WPF Application : Loading a resourced .XPS document

I'm trying to load a .xps document into a DocumentViewer object in my WPF application. Everything works fine, except when I try loading a resourced .xps document. I am able to load the .xps document fine when using an absolute path, but when I try…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
2
votes
2 answers

WPF find all regex matches in a xps document

I need to search an expression inside a xps document then list all matches (with the page number of each match). I searched in google, but no reference or sample found which addresses this issue . SO: How can I search a xps document and get this…
Mohsen
  • 4,000
  • 8
  • 42
  • 73