User forums > Using Code::Blocks

Printing is garbled

<< < (2/3) > >>

Miguel Gimenez:
The problem is in cbEditorPrintout::GetPageInfo(), virtual printers are returning a 0 page size in line 99, so m_printRect is invalid and the program enters this loop forever:

--- Code: ---        while (HasPage(*maxPage))
        {
            //Manager::Get()->GetLogManager()->DebugLog(_T("CountPages: PageCount %d , m_printed %d"), m_pPageSelStart->GetCount(), m_printed);
            m_printed = m_TextControl->FormatRange (0, m_printed, m_SelEnd,
                                             dc, dc, m_printRect, m_pageRect);
            m_pPageSelStart->Add(m_printed);
            *maxPage += 1;
        }

--- End code ---

EDIT: today the CutePDF printer works, but MS XPS printer still fails. MSW10 built-in PDF printer also works OK.

Miguel Gimenez:
@Steven Friedrich:
  - Are you using HiDPI (more than 96 pixels per inch)?
  - Can you attach an scan or photo of the printed page?

BlueHazzard:
Is the problem with the page size present in  my patch? I think i have reworked this.

Miguel Gimenez:
I have not tested your patch, the problem is with current trunk. I will take a look at your patch.

When using XPS printer, ppd->GetPaperId() (at cbeditorprintout.cpp:99) returns wxPAPER_NONE and the page size is (0, 0).

Miguel Gimenez:
Printing on Mint 18 is a mess, using default values with the built-in Print to File driver you get the attached PDF.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version