Şu anda asp.NET kullanarak html olarak bir .doc dosyası oluşturuyorum.Oluşturulan bir HTML'de sayfa sonu ekleme .doc
Sayfanın içine sayfa sonu eklemek istiyorum ama nasıl olduğunu bilmiyorum.
css style = 'page-break-before: always' kullanmayı denedim ama hiçbir şey yapmıyor.
Bu
bir düğme click olayı atanan kodudur:HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset ="";
HttpContext.Current.Response.ContentType ="application/msword";
string strFileName = "GenerateDocument"+ ".doc";
HttpContext.Current.Response.AddHeader("Content-Disposition","inline;filename=" + strFileName);
StringBuilder strHTMLContent = new StringBuilder();
strHTMLContent.Append("<p align='Center'>Content Before Page Break</p>".ToString());
strHTMLContent.Append("<br><br>".ToString());
strHTMLContent.Append("<p class='pageBreak' style='mso-special-character:line-break;'>meh</p>".ToString());
strHTMLContent.Append("<br><br>".ToString());
strHTMLContent.Append("<p align='Center'>Content After Page Break</p>".ToString());
HttpContext.Current.Response.Write(strHTMLContent);
HttpContext.Current.Response.End();
HttpContext.Current.Response.Flush();
HTML ile bir MS Word belgesi oluşturuyor musunuz? –
Belgenin MS Word olduğunu iddia etmek MS Word yapamaz. Bu, kullanıcının bir HTML belgesini işlemeye çalıştığı Word belgelerini işlemek için yapılandırdığı uygulamayı yapar. Bir MS Word belgesini sunmak istiyorsanız, gerçek bir tane oluşturun. Bir yalan grubuna sarılmış HTML göndermeyin. – Quentin
"docx" spesifikasyonuna bakmaktan daha iyi olabilirsiniz - Benzer bir şekilde üretebilir ve kelime/her hangi program tutamaçlarını ümit etmekten ziyade destekli bir format üretebilirdiniz. Doküman dosyalarını parçalara ayırabilir – Basic