[SOLVED]Markup printing broken in XTP v17 |
Post Reply |
Author | |
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
Posted: 22 February 2016 at 4:34pm |
Hello,
It appears that the markup printing is not working as expected in XTP v17 and later. A simple way to demonstrate the problem is to start the CodeJock MarkupPad utility. Load any valid markup, and then attempt to print. The resulting output will be disproportionately sized. We use the same code as MarkupPad in our applications (e.g. we use CXTPMarkupPrintingContext, which derives from CXTPMarkupDrawingContext). Markup printing worked fine in the v16 release cycle. Any ideas for a workaround? Regards, Mark R.
|
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
I noticed something else strange about this problem - print preview works as expected.
Again, you can see this in MarkupPad - load any XAML and check the print preview. It renders correctly, but the actual print out does not. What might be the cause of this? - Mark R.
|
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
I haven't looked at the code or anything but symptoms as described
"preview is good, actual output not" can often be attributed to the physical "printer offset" either wrong or not factored in. That would be my guess. Hope you can get it straightened out. |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Thanks for the info, but I'm not sure what you mean by this. Could you provide a reference to additional information on this topic? - Mark R.
|
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
Hi Mark,
*Here is a quick example of Printer Offset that I referred to. This sets up a page for printing. The "physical" sizes are used to adjust the "paper" to the printer device in case it is not one to one. CPrintDialog printer( TRUE, PD_RETURNDC ); printer.GetDefaults(); HDC hdc = printer.GetPrinterDC(); if( hdc ) { int horzSize = ::GetDeviceCaps( hdc, PHYSICALWIDTH ); int vertSize = ::GetDeviceCaps( hdc, PHYSICALHEIGHT ); int leftMargin = ::GetDeviceCaps( hdc, PHYSICALOFFSETX ); int topMargin = ::GetDeviceCaps( hdc, PHYSICALOFFSETY ); int horzPrintable = ::GetDeviceCaps( hdc, HORZRES ); int vertPrintable = ::GetDeviceCaps( hdc, VERTRES ); int rightMargin = horzSize - ( horzPrintable + leftMargin ); int bottomMargin = vertSize - ( vertPrintable + topMargin ); } |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Still no fix for this in 17.2. :-(
- Mark R.
|
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Any chance of getting this fixed for the upcoming minor release?
- Mark R.
|
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(1)
|
Hello,
I am glad to inform you, this issue has been fixed. Fix will be avaleble in next beta or final release. As hotfix you can change file XTPMarkupGdiPlusDeviceContext.cpp - in fuction void CXTPMarkupGdiPlusDeviceContext::Init(BOOL bReInit /*= FALSE*/) add string m_pGdiPlus->GdipSetPageUnit(GetGraphics(), UnitPixel); - in function virtual void Commit() change pGDIP->GdipDrawImage(m_pDCEx->GetGraphics(), m_pOffscreenImage, static_cast<REAL>(m_rect.left), static_cast<REAL>(m_rect.top)); to pGDIP->GdipDrawImageRect(m_pDCEx->GetGraphics(), m_pOffscreenImage, static_cast<REAL>(m_rect.left), static_cast<REAL>(m_rect.top), static_cast<REAL>(m_rect.Width()), static_cast<REAL>(m_rect.Height())); Regards, Artem Gontarenko |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Hi Artem,
Thanks for the fix, it appears to be working correctly now. Regards, Mark R.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |