16,472
社区成员
发帖
与我相关
我的任务
分享
if((status = fopen_s(&f, "D:\\cfg\\test.txt", "rb+")) != 0)
MessageBox(_T("Error opening the file!"));
else
{
i = 0;
j = 0;
fileSize = fread(fileBuf, 1, MAX_BUF, f);
while(i < strlen(fileBuf))
{
strLine[j] = fileBuf[i];
i++;
j++;
//if ((i%LINE_LEN) == 0)
if ((fileBuf[i] == '\n') || (i%LINE_LEN) == 0)
{
PDF_continue_text(p, strLine);
memset(strLine, 0, sizeof(strLine));
j = 0;
lineCont++;
}
if ((lineCont > 0) && (lineCont%LINE_NUM == 0))
{
PDF_continue_text(p, "================================");
//PDF_end_page_ext(p, "");
//PDF_begin_page_ext(p, a4_width, a4_height, "");
PDF_set_text_pos(p, 50, 800);
PDF_continue_text(p, "====================================");
}
}
if (strlen(strLine) != 0)
{
PDF_continue_text(p, strLine);
}
}
//PDF_continue_text(p, fileBuf);
PDF_continue_text(p, "===============================");
PDF_end_page_ext(p, "");
PDF_end_document(p, "");