C#调用OpenOffice转换多格式文件到PDF_休闲protected void GiveMePDFButton_Click(object sender, EventArgs e)
C#调用OpenOffice转换多格式文件到PDF_休闲{
C#调用OpenOffice转换多格式文件到PDF_休闲        // Initialize Receiver in GenericSender
C#调用OpenOffice转换多格式文件到PDF_休闲        OpenOfficeService.Objects.GenericSender.Init(
C#调用OpenOffice转换多格式文件到PDF_休闲                "tcp://localhost:6543/OpenOfficeServiceReceiver");
C#调用OpenOffice转换多格式文件到PDF_休闲
C#调用OpenOffice转换多格式文件到PDF_休闲        // Translate path and load up file in byte array, convert it
C#调用OpenOffice转换多格式文件到PDF_休闲        string source = Server.MapPath("~/SomeWordML.xml");
C#调用OpenOffice转换多格式文件到PDF_休闲        byte[] wordML = File.ReadAllBytes(source);
C#调用OpenOffice转换多格式文件到PDF_休闲
C#调用OpenOffice转换多格式文件到PDF_休闲        byte[] result =    
C#调用OpenOffice转换多格式文件到PDF_休闲            OpenOfficeService.Objects.GenericSender.Receiver.ConvertToPDF(wordML);
C#调用OpenOffice转换多格式文件到PDF_休闲
C#调用OpenOffice转换多格式文件到PDF_休闲        // Write response to client
C#调用OpenOffice转换多格式文件到PDF_休闲        Response.AddHeader("content-type", "application/pdf");
C#调用OpenOffice转换多格式文件到PDF_休闲        Response.AddHeader("Content-Disposition", "p_w_upload; filename=result.pdf");
C#调用OpenOffice转换多格式文件到PDF_休闲
C#调用OpenOffice转换多格式文件到PDF_休闲        Response.BinaryWrite(result);
C#调用OpenOffice转换多格式文件到PDF_休闲}