Print Page | Close Window

[SOLVED]Markup printing broken in XTP v17

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=22934
Printed Date: 27 April 2024 at 12:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED]Markup printing broken in XTP v17
Posted By: markr
Subject: [SOLVED]Markup printing broken in XTP v17
Date 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.



Replies:
Posted By: markr
Date Posted: 23 February 2016 at 4:22pm
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.


Posted By: Algae
Date Posted: 23 February 2016 at 6:39pm
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.


Posted By: markr
Date Posted: 24 February 2016 at 12:48am
Originally posted by Algae Algae wrote:

can often be attributed to the physical "printer offset" either wrong or not factored in.

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.


Posted By: Algae
Date Posted: 24 February 2016 at 12:55pm
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 );
    }


Posted By: markr
Date Posted: 02 May 2016 at 4:08pm
Still no fix for this in 17.2.  :-(

- Mark R.


Posted By: markr
Date Posted: 21 June 2016 at 4:11pm
Any chance of getting this fixed for the upcoming minor release?

- Mark R.


Posted By: agontarenko
Date Posted: 06 August 2016 at 2:14am
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


Posted By: markr
Date Posted: 06 August 2016 at 10:52am
Hi Artem,

Thanks for the fix, it appears to be working correctly now. Clap

Regards,

Mark R.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net