Telerik Forums
Telerik Document Processing Forum
2 answers
969 views

I'm attempting to iterate through the rows of each sheet in an opened Excel sheet - I'm replacing code that used the GemBox library. Previously, I used code like the following:

foreach (ExcelRow row in sheet.Rows)
{
   if (row != null)
   {
       ... do stuff ....
   }
}

 

Is the following the best conversion to using the Telerik library? Or is there a better way to only iterate through rows with content?

 

for (int i = 0; i < sheet.Rows.Count; i++)
{
   var row = sheet.Cells[CellRange.FromRow(i)];
 
   if (row != null)
   {
       ... do stuff ....
   }
}
Tanya
Telerik team
 answered on 07 Aug 2017
1 answer
449 views
How to attach/embed xml file into the PDF/A-3 file?
Anna
Telerik team
 answered on 07 Aug 2017
1 answer
235 views

RTF documents that have non-breaking spaces end up with no space in place of the non-breaking space.  For example, this sentence, with non-breaking spaces after 1/2 and 20:
   It is about 1/2 mile to the park.  I saw 20 people there.

becomes:
   It is about 1/2mile to the park.  I saw 20people there.

I tried loading the RTF in the RadRichTextBox example and got the same result there.

Is there a way to configure it to handle non-breaking spaces or to convert them to regular spaces?

Tanya
Telerik team
 answered on 02 Aug 2017
1 answer
488 views

Is it possible using the telerik pdf processing library to be able to compress the pdf file and also do optimization like aspose.pdf?

 

Deyan
Telerik team
 answered on 01 Aug 2017
1 answer
455 views

IS it possible using the telerik library be able to encrypt a pdf?

 

 

Mihail
Telerik team
 answered on 31 Jul 2017
1 answer
555 views

Hello,

I'm having an issue with text justification not being maintained when going from a Docx > PDF.

I have to do a little bit of a conversion dance (to get fonts embedded), but basically I'm importing some HTML into a RadDocument, exporting that RadDocument as a DocX, importing that DocX into a RadFlowDocument and then finally exporting that to PDF.

The HTML has the text justified and the DocX also shows the text justified, but when it comes out in the PDF the text is no longer justified. Do you have any suggestion on how to fix this?

Thanks!

-Tom

Deyan
Telerik team
 answered on 28 Jul 2017
2 answers
700 views

Hi I'm trying to read a zip file which contains multiple files. Few of the files inside is named in Japanese (and Chinese).

My file: こんにちわ.csv becomes vhtjd.csv instead. I hope you can guide me.

Here is my code:

 using (ZipArchive zip = new ZipArchive(stream, ZipArchiveMode.Read, true, System.Text.Encoding.UTF8))
 {
                        foreach (ZipArchiveEntry e in zip.Entries)
                        {
                            string file= e.Name.ToString(); 

                          }

    }

Yoshiaki
Top achievements
Rank 1
 answered on 13 Jul 2017
3 answers
506 views

Hi,

I'd like to ask if there are ways to detect if the zip file is password protected. Just to give you a background of what I want to accomplish. I have a application that extract zip files. Zip files may be password protected and/or not password protected. By doing that, I will know if I will prompt a dialog box so that the user will enter the zip file password.

Initially, I tried to extract the file without the Encryption parameter to test if it can be extracted. Unfortunately, the files still get extracted only that it contains some funny characters.

using (ZipArchive zip = new ZipArchive(stream))
      {
                foreach (ZipArchiveEntry e in zip.Entries
                   {
                            using (Stream sw = File.Create(Path.Combine(FileDestination, e.FullName)))
                               {
                                    Stream enterySTream = e.Open();
                                   Telerik.WinControls.Zip.Extensions.ZipFile.CopyStreamTo(enterySTream, sw);
                                   sw.Flush();              
                            }
                     }
    }

I have the latest  Winforms Telerik version installed.

Thank you.

 

Tanya
Telerik team
 answered on 10 Jul 2017
7 answers
1.1K+ views

Hi,
I'm using PdfProcessing to create invoices from a template and I have included a header and a footer. Following my template, the body is a Table with TableRow and TableCell. In each row I have a text, big or small, the lenght of the text influence the height of the cell. I don't have issues so far.

When my text contains \n (carriage return) then I use this code to have my new line:

string[] lines = invoice.Libelle.Split('\n');

for (int l = 0; l < lines.Count(); l++)
{
    editor.InsertText(lines[l]);
    if (l + 1 < lines.Count())
    {
       editor.InsertBreak(BreakType.LineBreak);
    }
}

But I get an error when I try to generate invoice:
Message d'erreur :
Width and Height must be non-negative.


Sur la méthode :
Void .ctor(Double, Double)


La trace de la pile :
at System.Windows.Size..ctor(Double width, Double height) at Telerik.Windows.Documents.Fixed.Model.Editing.Tables.TableCell.get_DesiredSize() at Telerik.Windows.Documents.Fixed.Model.Editing.Tables.TableCell.Measure(Size availableSize) at Telerik.Windows.Documents.Fixed.Model.Editing.Tables.Table.CalculateRowHeights() at Telerik.Windows.Documents.Fixed.Model.Editing.Tables.Table.Measure(Size availableSize) at Telerik.Windows.Documents.Fixed.Model.Editing.Tables.Table.Draw(FixedContentEditor editor, Rect boundingRect) at Telerik.Windows.Documents.Fixed.Model.Editing.Flow.SectionInfo.InsertBlockElement(IBlockElement blockElement) at Telerik.Windows.Documents.Fixed.Model.Editing.RadFixedDocumentEditor.InsertBlock(IBlockElement block) at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.ExportSection(Section section, RadFixedDocumentEditor editor) at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.ExportDocument(RadFlowDocument document, RadFixedDocumentEditor editor) at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.Export() at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider.ExportToFixedDocument(RadFlowDocument document) at Facturation_FacturePdf.<>c__DisplayClass3.b__2(FactureForPrintEntity f) in

So, I find out the issue. Contrary to this editor.InsertBreak(BreakType.LineBreak), with editor.InsertText(Environement.NewLine) I don’t get an error but I have a big space between my two lines. So I remove the old code and I use this simple instruction :

editor.InsertText(invoice.Libelle.Replace("\n", " \n"));

I have a carriage return but I still have the same problem, a big space.

I have two questions:
1) What are the differences between these two instructions and why I get an error ?
2) Is it possible to remove or reduce the space between two lines using my last code?

3) There is maybe an other way?

The error comes not always but only in specific invoices and depends on the text inside my cell. I can post the code if you need it.

NB : In addition, I use negative padding in my cells to have a good height, I don’t know if this influence the error.

 

Mihail
Telerik team
 answered on 22 Jun 2017
1 answer
205 views
DO you have any code samples or api documentation on how to use the fillable forms for pdf?
Tanya
Telerik team
 answered on 15 Jun 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?