[
  {
    "Id": "470936",
    "ThreadId": "220699",
    "Html": "Hi all,\r\n\r\nThere is a problem with the zip generation in vb.net. The zip is filled with pdf's (created with bullzip from word 2003 docs) and sometimes (to make it simple) some pdf's have headers where all characters are on top of each other. The rest of the paragraph is readable. The source generated pdf does not have this problem, so this is cosed by the compression. Problem is that the pdf;s are legal contracts and therefore illegal when signing...<br>\r\n<br>\r\nDoes anybody have any ideas or similar experiences?<br>\r\n<br>\r\n<br>\r\ncode:<br> \r\n<br>\r\n            Dim WithEvents mobj_Zip As Ionic.Zip.ZipFile<br>\r\n<br>\r\n            Public Function ZipFiles(ByVal aZipFile As String, ByVal FoldersAndOrFiles As String(), Optional ByVal aDirectoryPathInArchive As Boolean = True) As Boolean<br>\r\n7960:           Using mobj_Zip = New Ionic.Zip.ZipFile<br>\r\n7970:               With mobj_Zip<br>\r\n7980:                   .CompressionLevel = Ionic.Zlib.CompressionLevel.Default<br>\r\n7990:                   .ZipErrorAction = ZipErrorAction.Throw<br>\r\n8000:               End With<br>\r\n8010:               RaiseEvent Progress(1, Nothing, Nothing, 0)<br>\r\n8020:               For Each Entry As String In FoldersAndOrFiles<br>\r\n8030:                   Dim f = New IO.FileInfo(Entry)<br>\r\n8040:                   If (f.Attributes And IO.FileAttributes.Directory) &gt; 0 Then<br>\r\n8050:                       RaiseEvent Progress(10, &quot;Folder&quot;, Entry, 0)<br>\r\n8060:                       If aDirectoryPathInArchive Then<br>\r\n8070:                           mobj_Zip.AddDirectory(Entry)<br>\r\n8080:                       Else<br>\r\n8090:                           mobj_Zip.AddDirectory(Entry, &quot;&quot;)<br>\r\n8100:                       End If<br>\r\n8110:                   Else<br>\r\n8120:                       RaiseEvent Progress(11, Entry, IO.Path.GetDirectoryName(Entry), 0)<br>\r\n8130:                       If aDirectoryPathInArchive Then<br>\r\n8140:                           mobj_Zip.AddFile(Entry)<br>\r\n8150:                       Else<br>\r\n8160:                           mobj_Zip.AddFile(Entry, &quot;&quot;)<br>\r\n8170:                       End If<br>\r\n8180:                   End If<br>\r\n8190:               Next Entry<br>\r\n<br>\r\n8200:               RaiseEvent Progress(20, Nothing, Nothing, Nothing)<br>\r\n8210:               Call mobj_Zip.Save(aZipFile)<br>\r\n8220:               RaiseEvent Progress(30, Nothing, Nothing, Nothing)<br>\r\n<br>\r\n8230:               mobj_Zip.Dispose()<br>\r\n                End Using<br>\r\n8240:           mobj_Zip = Nothing<br>\r\n8250:           Return True<br>\r\n<br>\r\n            End Function<br>\r\n<br>",
    "PostedDate": "2010-07-22T04:49:08.563-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "473630",
    "ThreadId": "220699",
    "Html": "Looks like that code does the compression.  Hard to tell what the problem is when you don't show the code that does decompression.  Here's the thing: zip archives use a crc, which verifies that the decompressed content is identical to the original file content.  Dotnetzip automatically verifies that crc in most cases and throws an exception if the crc does not match. This means it's impossible to get modified content in a compress/decompress cycle using the zip format.  \r\n\r\nSomething you are doing is causing this.  I suggest that it is how you are creAting the output file.\r\n\r\nPost your code. Pls eliminate line numbers and use the codeplex code formatting widget.  It makes it much easier to read code.\r\n\r\nGood luck.\r\n",
    "PostedDate": "2010-07-28T04:55:52.73-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]