Generate a PDF file using the PDFLIB development library

zhaozj2021-02-16  88

http://www.pdflib.com/products/pdflib/download/503/pdflib-5.0.3p1-windows.zip

void CPDFXXXDlg :: OnConvert () {// TODO: Add your control notification handler code here try {int iFont; PDFlib pPDF; CFileDialog m_FileDlg (FALSE, "pdf", "", OFN_OVERWRITEPROMPT, "Adobe Acrobat PDF files (* .pdf ) | * .pdf | All files (*. *) | *. * || "; CHAR PFILENAME [255]; CEDIT * PPDFTEXT = (CEDIT *) getdlgitem (IDC_EDitpdf); cstract strpdftext; ppdftext-> getWindowText (STRPDFTEXT); char PPDFINFO [1024]; Sprintf (PPDFINFO, "% s", strpdftext);

char pAttachFileName [255]; sprintf (pAttachFileName, "% s", m_AttachFileName); if (m_FileDlg.DoModal () == IDOK) {m_PDFFileName = m_FileDlg.GetFileName (); sprintf (pFileName, m_PDFFileName); if (pPDF.open_file (pfilename) == - 1) {//} PPDF.SET_PARAMETER ("Hypertextencoding", "Host"); PPDF.SET_INFO ("Creat", "DigitalSky"); PPDF.SET_INFO ("Author", "DigitalTitan") PPDF.SET_INFO ("Title", "Title"); PPDF.BEGIN_PAGE ((float) A4_WIDTH, (FLOAT) A4_HEIGHT); ifont = PPDF.LOAD_FONT ("Helvetica-Bold", "Host", "", "; PPDF .SETFONT (IFONT, 12); PPDF.SET_TEXT_POS (50, A4_HEIGHT-50); PPDf.SetColor ("Fill", "RGB", 0, 0, 1, 0); PPDF.SHOW ("Version 1.0 (C) Copyright by DigitalTIN "); ifont = ppdf.findfont (" STSONG-LIGHT "," GB-EUC-H ", 0); PPDF.SetColor (" Fill "," RGB ", 0, 0, 0); PPDF.SETFONT (IFONT, 24); PPDF.Continue_text ("Convert Document Brand Become"); PPDF.SetColor ("stroke", "RGB", 0.24F, 0.51F, 0.047F, 0); PPDF.Moveto (50 , A4_HEIGHT-80); PPDF.LINETO (A4_WIDTH-50, A4_HEIGHT-80); PPDF.Moveto (50, A4_HEIGHT-78); PPDF.LineTo (A4_W IDTH-50, A4_HEIGHT-78); ppdf.stroke (); ppdf.attach_file (A4_WIDTH-50, 0, A4_HEIGHT-90, PattachFileName, "DigitalSky", "DIGITALTITAN", "DOC", "PaperClip"); PPDF.SET_TEXT_POS (50, A4_HEIGHT-100); ifont = PPDF.FindFont ("STSONG-LIGHT", "GB-Euc-H", 0); PPDF.SetColor ("Fill", "RGB", 0, 0, 0,0); ppdf.setfont (ifont, 12); PPDF.CONTINUE_TEXT (PPDFINFO); //

PPDF.end_page (); ppdf.close ();}} catch (pdflib :: exception & ex) {//}}

转载请注明原文地址:https://www.9cbs.com/read-12878.html

New Post(0)