![]() ![]() odt(openoffice file) is also getting corrupted. Response.AddHeader( " Content-Disposition", " attachment filename=MyPDF.pdf") // + strPDFpath) // Response.ContentType = "application/octet-stream" If you export the ODT file to another format (usually DOC, PDF or HTML). Response.ContentType = " application/pdf" is not quite as robust as Microsoft Office, but it provides. Response.Write(Server.MapPath(strPDFpath)) ![]() objects = .HTMLWorker.ParseToList(new StreamReader(strHTMLpath, Encoding.Default), styles) for ( int k = 0 k < objects.Count k++) PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(strPDFpath, FileMode.Create)) ĪrrayList objects = .HTMLWorker.ParseToList( new StreamReader(strHTMLpath, Encoding.Default), styles) StreamWriter strWriter = new StreamWriter(strHTMLpath, true, Encoding.Default) HtmlTextWriter htw = new HtmlTextWriter(sw) String strPDFpath = D:\Projects\MyPDF4.pdf" String strHTMLpath = D:\Projects\PP.odt" Import the file that you want to work on from its location. StringBuilder strData = new StringBuilder( string.Empty) Enter the permission password by clicking on 'Enable Editing'. Protected void btnGeneratePDF_Click( object sender, EventArgs e)ĭocument document = new Document(PageSize.A4, 80, 50, 30, 65) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |