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_职场}