The error C4995: "PDF_set_parameter" : name is marked as # pragma deprecated
The error C4995: "PDF_set_parameter" : name is marked as # pragma deprecated
The error C4995: "PDF_findfont" : name is marked as # pragma deprecated
Contains the header file
# include "light. H"
Void CMy0141124825_houchuanhaoDlg: : read_in_pdf (cstrings id_number, cstrings exam_number, double accuracy_rate, double typing_speed, double score, cstrings content)
{
Remove (" transcript. PDF ");
PDF * p;
//PDF_set_parameter (p, "license", "X600605 e0c e7661-009100-4-329");//remove the watermark, the registration number written,
If ((p=PDF_new ())==0) (PDF *) {
Printf (" Couldn 't create the light object (out of memory!/n ");
return;
}
PDF_TRY (p) {
/* This means we must check the return values of load_font (), etc. */
//PDF_set_parameter (p, "errorpolicy", "return");
USES_CONVERSION;
PDF_set_parameter (p, "license", "X600605 e0c e7661-009100-4-329");//remove the watermark, the registration number written,
Cstrings STR (exam_number);
Cstrings str2="_ transcript. PDF";
Cstrings str1=STR + str2;
Const char * FileName=str1;
If (PDF_begin_document (p, FileName, 0, "")==1) {
Printf (" Error: % s/n, "PDF_get_errmsg (p));
return;
}
/* This line is required to get the problems on Japanese systems */
PDF_set_parameter (p, "hypertextencoding", "host");
//PDF_set_parameter (p, "license", "X600605 e0c e7661-009100-4-329");//remove the watermark, the registration number written,
//PDF_set_parameter (p, "fakebold", "true");
PDF_set_info (p, "Creator", "041122374. CPP");
PDF_set_info (p, "the Author", "Zyzzz");
PDF_set_info (p, "Title", "Hello, world!" );
PDF_begin_page_ext (p, a4_width a4_height, "");
Int font_song=PDF_findfont (p, "STSong - Light", "GB - EUC - H, 0).
PDF_setfont (p, font_song, 12);
PDF_set_text_pos (p, 50, a4_height - 50);
//USES_CONVERSION;
Cstrings s=T2A ((id_number. GetBuffer ()));
S="id:" + s;
PDF_show (p, s);
PDF_set_text_pos (p, 50, a4_height - 65);
S=T2A ((exam_number GetBuffer ()));
S="admission ticket number:" + s;
PDF_show (p, s);
PDF_setfont (p, font_song, 8);
PDF_set_text_pos (p, 50, a4_height - 85);
Cstrings cs;
Cs. The Format (" % f is your typing accuracy, speed is % f/min, the examination score is % f ", accuracy_rate, typing_speed, score).
S=T2A (cs) GetBuffer ());
PDF_show (p, s);
PDF_setfont (p, font_song, 8);
PDF_set_text_pos (p, 50, a4_height - 100);
S="here is you the entry exam content:";
PDF_show (p, s);
PDF_set_text_pos (p, 50, a4_height - 130);
S=T2A (content. GetBuffer ());
PDF_show (p, s);
//PDF_setcolor (p, "fill", "cmyk", 1, 0, 0).
//PDF_rect (p, 250250, 250, 250);
//PDF_fill (p);
PDF_end_page_ext (p, "");
PDF_end_document (p, "");
}
PDF_CATCH (p) {
Printf (" the light exception occurred in the sample:/n ");
Printf (" % s % d, % s/n ",
PDF_get_errnum (p), PDF_get_apiname (p), PDF_get_errmsg (p));
Cstrings cs;
Cs. The Format (" [] % d % s: % s/n ",
PDF_get_errnum (p), PDF_get_apiname (p), PDF_get_errmsg (p));
PDF_delete (p);
return;
}
PDF_delete (p);
return;
}
programmer