To create a PDF page from MFC CView

My MFC MFC MDI application displays engineering drawing drawings. What is a good way to dump a CView object into a PDF file? What libraries could you offer (not nesesery for free)? I looked through several libraries like Cairo and libHaru. You can draw all the graphic components, but I thought that CView has all the ready-made drawings. Can it be dumped to PDF via PS or something like that? Thanks

+3
source share
1 answer

If you download CutePDF , you can print it directly in PDF format. Its just like regular printer printing. I am sure that if you get acrobat pro from adobe, you can do the same.

Edit:

Using the device context, you can make your entire drawing so that the driver can "use" it to store vector graphics.

If you process the WM_PRINT command (ON_MESSAGE on the message map), you get an HDC. You can get the CDC style CDC from the HDC by following these steps:

CDC* pDC = CDC::FromHandle( hDC );

Now you can issue the standard DC drawing commands to the printer as follows:

int width = pDC->GetDeviceCaps( HORZRES );
int height = pDC->GetDeviceCaps( VERTRES );
pDC->MoveTo( 0, 0 );
pDC->LineTo( width, height );

a . , , (, , , ), PDF , .

+1

Source: https://habr.com/ru/post/1724218/


All Articles