本文介绍了在Adobe的C#windows apllication中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在ad中的adobe reader中面临一个问题。

i有两个项目,我在两者中编码相同,但在一个pdf正在打开和其他pdg无法打开

请帮助我

Hi,
I m facing a problem in adobe reader in c#
i have 2 projects and i have coded same in both but in one the pdf is opening and in other pdg doesn't open
So please help me

推荐答案

strQuery = "select * from test_drawing where s_no=3";
           objCmd = new OleDbCommand(strQuery, objConn);
           dr = objCmd.ExecuteReader();
           if (dr.Read())
           {
               write = (byte[])dr[1];
           }
           dr.Close();
           //if (!File.Exists(path + "\\drawing.pdf"))
           //{
           //    File.Create(path + "\\drawing.pdf");
           //    filename = path + "\\drawing.pdf";
           //}
           //else
           //{
           //    File.Delete(path + "\\drawing.pdf");
           //    File.Create(path + "\\drawing.pdf");
           //    filename = path + "drawing.pdf";
           //}
           filename = path + "drawing.pdf";
           using (FileStream
          fileStream = new FileStream(filename, FileMode.Create))
           {
               // Write the data to the file, byte by byte.
               for (int i = 0; i < write.Length; i++)
               {
                   fileStream.WriteByte(write[i]);
               }

               // Set the stream position to the beginning of the file.
               fileStream.Seek(0, SeekOrigin.Begin);

               // Read and verify the data.
               for (int i = 0; i < fileStream.Length; i++)
               {
                   if (write[i] != fileStream.ReadByte())
                   {
                       Console.WriteLine("Error writing data.");
                       return;
                   }
               }
               fileStream.Flush();
               fileStream.Close();
               axAcroPDF1.LoadFile(filename);
           }



这篇关于在Adobe的C#windows apllication中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 07:48