I am trying to write a file and I have to go to a new page when I write certain of records. Please help me and let me know how to add a page break when create file by writing records into the file. Thanks a lot!
Will
How to add a page break when write to file
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
AnttiRank #9,295 · 208 pointsPosted Feb 14, 2006, 9:52 PM EST
will he14 pointsPosted Feb 15, 2006, 4:46 AM EST
All what I try to do is When I convert the my txt file which is created by program into PDF file, I can force the one record be one page in PDF. Thanks.
AnttiRank #9,295 · 208 pointsPosted Feb 15, 2006, 11:57 PM EST
And if I did understand your problem correctly, you need to add page break information into your text file? In that case you have to add some special character sequence, that indicates a page break. For example "\p" or "<newPage>" or maby a '0xC'-character, which seems to be a "NP form feed, new page" character in ASCII table. Or one more elegant solution would be that you save your information in XML format, where it is easy to find each record.
And the program that converts your txt to pdf, is it your own makings, or...? If it is, you simply look for your page break character sequence, and add a page break into the pdf. If it is not your own program, you should at least try for '0xC' character, and if it's not working, ask for converter manufacturer if there is a way to force a page break.
In the case you are making that txt to pdf converter, you should check the PDF reference for details how to add a page break.
Mohammed Sajid15 pointsPosted Feb 16, 2006, 12:31 AM EST
AnttiRank #9,295 · 208 pointsPosted Feb 16, 2006, 2:06 AM EST