我正在使用Embarcadero c ++,我正在从文件中读取文本。我想将该文本保存为.pdf文档。任何帮助,将不胜感激!提前致谢...请参阅下面的代码!
memText ->Clear();
AnsiString oneLine;
AnsiString WordsFile = "ORCLE_daily_14aug12.txt";
TStreamReader *stRead = new TStreamReader(WordsFile);
while (!stRead->EndOfStream)
{
oneLine = stRead->ReadLine();
memText->Lines->Add(oneLine);
}
stRead->Close();
AnsiString twoLine;
AnsiString WordsFile2 = "Daily_Report.pdf";
TStreamWriter *stWrite = new TStreamWriter(WordsFile2, false);
for (int ln = 0; ln <= memText->Lines->Count-1; ln++)
{
oneLine = memText->Lines->Strings[ln];
stWrite->WriteLine(oneLine);
}
memText->ScrollBars = ssVertical;
stWrite->Close();