Telerik Forums
Telerik Document Processing Forum
1 answer
274 views

Is there a reliable way to detect a bad password when opening a ZipArchive?  I'm currently getting an InvalidOperationException when reading the first entry, and the message is a generic "Invalid data".  Exception shared below.

 

Telerik.Windows.Zip.InvalidDataException occurred
  HResult=-2146233088
  Message=Invalid data
  Source=Telerik.Windows.Zip
  StackTrace:
       at Telerik.Windows.Zip.DeflateDecompressor.SetPreviousCode() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 630
       at Telerik.Windows.Zip.DeflateDecompressor.ReadTreeCodes() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 589
       at Telerik.Windows.Zip.DeflateDecompressor.DecodeDynamicBlockHeader() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 534
       at Telerik.Windows.Zip.DeflateDecompressor.CheckDecodeState() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 274
       at Telerik.Windows.Zip.DeflateDecompressor.Decode() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 233
       at Telerik.Windows.Zip.DeflateDecompressor.Inflate(Byte[] bytes, Int32 offset, Int32 length) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 736
       at Telerik.Windows.Zip.DeflateDecompressor.ProcessTransform(Boolean finalBlock) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\Deflate\DeflateDecompressor.cs:line 181
       at Telerik.Windows.Zip.CompressionTransformBase.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\CompressionTransformBase.cs:line 162
       at Telerik.Windows.Zip.OperationStream.Read(Byte[] buffer, Int32 offset, Int32 count) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\OperationStream.cs:line 395
       at Telerik.Windows.Zip.CompressedStream.Read(Byte[] buffer, Int32 offset, Int32 count) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Frameworks\Zip\Compression\CompressedStream.cs:line 155
       at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
       at System.IO.Stream.CopyTo(Stream destination)
       at PacketMonitor.BinaryLog.LogReader.Open(String fileName, String password)
  InnerException: 

Petya
Telerik team
 answered on 24 Aug 2015
1 answer
174 views
Is it possible to fill the form fields in a PDF with the current UI for WPF DevTools?
Tanya
Telerik team
 answered on 18 Aug 2015
2 answers
940 views

Hello,

I am struggling setting the Font Size of all the Text in my Table that i am drawing inside of my pdf document.  It seems like it is defaulting to either 10 or 12... I need to display at least 4 columns in a row, and i want to reduce the font size to at least 8.  Is there any way to do this without setting up a unique block each time and then trying to add it to Cell, and Row , etc...

 

My code looks like this below:

---------------------------------------------------------------------------------------------------------------------------------------------------------

 Dim RevenueTable As New Table()

   Dim firstRow As TableRow = RevenueTable.Rows.AddTableRow()

            firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("---------------------------")
            firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("--------------------SERVICE")
            firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText(" DETAILS-------------------")
            firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("---------------------------")

            Dim secondRow As TableRow = RevenueTable.Rows.AddTableRow()
            secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText(objReceipt.SERVCODE(i))
            secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText(objReceipt.SERVNAME(i))
            secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText(objReceipt.SERVQTY(i))
            secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("")

            Dim ServiceCodeRowDesc As TableRow = RevenueTable.Rows.AddTableRow()
            ServiceCodeRowDesc.Cells.AddTableCell().Blocks.AddBlock().InsertText("Revenue Desc")
            ServiceCodeRowDesc.Cells.AddTableCell().Blocks.AddBlock().InsertText("Item Price")
            ServiceCodeRowDesc.Cells.AddTableCell().Blocks.AddBlock().InsertText("Qty")
            ServiceCodeRowDesc.Cells.AddTableCell().Blocks.AddBlock().InsertText("Revenue Amount")

 {....lines of code removed ....}

 editor.TextProperties.FontSize = 8
  editor.DrawTable(RevenueTable)

------------------------------------------------------------------------------------------------------------------------------------------------ 

The font size is not 8.

Petya
Telerik team
 answered on 13 Aug 2015
2 answers
437 views

Hey,

I'm using a RadfixedDocument to create a Report and the PdfFormatProvider to export the Report to PDF.

Everything works fine, except for german Umlaut Letters (ä, ö, ü). They just disappear in the generated PDF. I couldn't find a switch in the Export Settings or anything else, can you give me some directions?

 Cheers,

Jens

Jens
Top achievements
Rank 1
 answered on 10 Aug 2015
1 answer
456 views

Hi there.

 

I have a Document i want to Search for a Specific Variable.

I need to get the parent container/block of the text.

 

thx

Petya
Telerik team
 answered on 31 Jul 2015
1 answer
1.0K+ views

Hi,

I created predefined docx template for reports I ​want to generate. The template is loaded into RadFlowDocument for more modifications. Somewhere in the middle of the document I want to insert a picture. How do I use the RadFlowDocument editor to move that specific location of the document and insert that image?

 

Best regards,

Ahmed

Tanya
Telerik team
 answered on 28 Jul 2015
4 answers
147 views

Hi,

I'm trying to use RadFlowDocument (2015 Q2) to create summary reports. Before switching to RadFlowDocument, I used to work with normal WPF FlowDocument and I'm able to host UI elements (such as charts) in it. Now, I'm trying to do the same thing with RadFlowdocument, but I can't host a UI element in it.

Is there any way to make RadFlowDocument host a UI element?

 

Thanks,

Ahmed

Ahmed
Top achievements
Rank 1
 answered on 26 Jul 2015
3 answers
590 views

Hi guys,

this is my problem, I want to zip a folder that contains several pdf files.

I can do it! Ok, I created a zip that contains my pdf files.

But I found all pdf files corrupted, some files I can open it, but it has white page!

I attach my 2 project: 1st is my little library, 2nd it my test project

Thi is my code,

My little library and test project console:

01.//My method of my little class library
02.public void CreateZipToAllFiles(string parFolderToArchive,
03.                                string parZipName,
04.                                string parDestinationZipFile)
05.{
06.    LastError = "";
07. 
08.    try
09.    {
10.        //Apro lo il canale per la creazione del file zip
11.        using (Stream stream = File.Open(string.Format(@"{0}\{1}",
12.                                         parDestinationZipFile,
13.                                         parZipName), FileMode.Create))
14.        {
15.            //Credo l'archivio logico di compressione
16.            using (ZipArchive archive = new ZipArchive(stream,
17.                                                       ZipArchiveMode.Create, false, null))
18.            {
19.                //Leggo dalla cartella i file trovati
20.                foreach (var fileInfo in new DirectoryInfo(parFolderToArchive).GetFiles())
21.                {
22.                    //Creo un movimento per ogni file trovato
23.                    using (ZipArchiveEntry entry = archive.CreateEntry(fileInfo.Name))
24.                    {
25.                        using (StreamReader sr = new StreamReader(fileInfo.FullName, true))
26.                        {
27.                            //Archivio il file corrente nel file zip
28.                            StreamWriter writer = new StreamWriter(entry.Open());
29. 
30.                            while (sr.Peek() >= 0)
31.                                writer.Write((char)sr.Read());
32.                             
33.                            writer.Flush();
34.                        }
35.                    }
36.                }
37.            }
38.        }
39.    }
40.    catch (Exception ex)
41.    {
42.        StringBuilder sb = new StringBuilder("ZipForNav.CreateZipToAllFiles");
43.        sb.AppendLine(ex.Message);
44. 
45.        if(ex.InnerException!=null)
46.        {
47.            sb.AppendLine(ex.InnerException.Message);
48.        }
49. 
50.        LastError = sb.ToString();
51.    }
52.}
53. 
54.//Test by project console
55.static void Main(string[] args)
56.{
57.    Zip.ZipForNav zip = new Zip.ZipForNav();
58.    zip.CreateZipToAllFiles(@"C:\Temp\Folder to zip", "myzipfile.zip", @"C:\Temp\Destination folder");
59. 
60.    if (zip.LastError != "")
61.        Console.Write(zip.LastError);
62.    else
63.        Console.Write("OK");
64. 
65.    Console.ReadLine();
66.}

Nikolay Demirev
Telerik team
 answered on 22 Jul 2015
1 answer
188 views

1.  Asp.net page is normal page created by telerik(not mvc), user can  input value.

2. I want click one button,i can convert current asp.net page  to pfd and send email(this pdf should save in server,and pfd as the attached )

Petya
Telerik team
 answered on 21 Jul 2015
4 answers
351 views

 The mailmerge method doesn't display on intellisense, or if i just type it in, it doesnt still work.  Says its not a member of radflowdocument.

Screenshot attached showing all the other methods, properties, etc.

I have these references:

<assemblies>
        <add assembly="Telerik.Windows.Documents.Core, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>
        <add assembly="Telerik.Windows.Documents.Fixed, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>
        <add assembly="Telerik.Windows.Documents.Flow, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>
        <add assembly="Telerik.Windows.Documents.Flow.FormatProviders.Pdf, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>
        <add assembly="Telerik.Windows.Maths, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>
        <add assembly="Telerik.Windows.Zip, Version=2015.2.623.40, Culture=neutral, PublicKeyToken=5803CFA389C90CE7"/>

 

Any ideas why?  Appreciate it.

David
Top achievements
Rank 1
 answered on 17 Jul 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?