Can someone please let me know what's wrong with the code below. I am always getting this error:
"PrintTicket provider failed to convert PrintTicket to DEVMODE. Win32 error: -2147467259" in the lines highlighted in green.
if (result.ConflictStatus == ConflictStatus.ConflictResolved)
{
newPT = result.ValidatedPrintTicket;
pq.Commit(); It will create an exception right here.
VisualHost vhost = new VisualHost(originX, originY, extentWidth, extentHeight, newPT);
XpsDocumentWriter xpsdw = PrintQueue.CreateXpsDocumentWriter(pq);
xpsdw.Write(vhost, newPT ); And another exception right here.
}