You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.9 KiB
C++

//////////////////////////////////////////////////////////////////////////////
//文件 PdfDC.h
//主要功能:
//
//程序编写: 2005-12-07
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "formatdc.h"
#include "ClibPDF\cpdflib.h"
namespace NFormatWriter
{
class CPdfDC :
public CFormatDC
{
public:
CPdfDC(void);
virtual ~CPdfDC(void);
virtual void Initial(void); //写PDF版本及打开文件写等
virtual int OutFront(void);
virtual int OutEnd(void);
virtual CSize GetOutputSize(double cx, double cy);
virtual void SetMapSize(CSize sz) { m_mapSize = sz; }
virtual void SetPixel(double x, double y, COLORREF col);
//virtual void LineTo(double x, double y);
virtual void PaintRgn(LPPOINT sp, int count);
//virtual void Ellipse(double x1, double y1, double x2, double y2);
//virtual void Draw(CSection& section,CRect8* rect=NULL);
virtual void Draw(CText& text, CCurveEx& curve);
//virtual void DrawOutlineChar(LPTTPOLYGONHEADER lpph, long cbTotal, CPoint scrpt, BOOL bFill);
//virtual void DrawOutlineChar(COutlineFromBitmap& ofb, CPoint scrpt, BOOL bFill);
virtual void Draw(CImageInsert& image);
virtual void FillSolidRect(CRect8& rect, COLORREF color);
virtual void PolyLine(CPointList& dp);
virtual void Draw(CInsertDraw& m_insert);
virtual void Draw(CInsertOld& m_insert);
float pdfGetScreenWidth8(double dw);
float pdfGetScreenHeight8(double dw);
CPoint pdfGetScreen(double x, double y);
CPoint pdfGetScreen(const CPoint2D& pt);
CPoint2D pdfGetScreen8(double x, double y);
CRect8 pdfGetScreen8(CRect8& rect);
int pdf_y(int y);
double pdf_y(double y);
void ScreenToPDF(double& x, double& y);
void SetFileName(CString strFileName);
void operator=(CPdfDC& dc);
CSize m_mapSize;
char m_title[50]; // PDF title
char m_descrp[50]; // PDF description
protected:
void WritePdfColor(COLORREF col, int nMode);
void WritePdf(CPDFdoc* pdf);
static CPDFdoc* m_pPdfDoc;
CString m_strFileName;
};
};