Telerik Forums
Telerik Document Processing Forum
7 answers
701 views

Hello 

 The following method is supposed to import a PDF file and export it. It works as expected, except that the image is lost. 

private void Test1()
      {
          var provider = new PdfFormatProvider();
 
          var stream = File.OpenRead(@"C:\inputFile.pdf");
 
          var document = provider.Import(stream);
 
          using (var output = new FileStream(@"C:\outputFile.pdf", FileMode.OpenOrCreate))
          {
              provider.Export(document, output);
          }
      }

 

 You might say that the file is in bad format or something, but why would this work?

private void Test2()
    {
        var stream = new FileStream(@"C:\inputFile.pdf", FileMode.Open, FileAccess.Read);
 
        var source = new PdfDocumentSource(stream, FormatProviderSettings.ReadOnDemand);
 
        ViewModel.DocumentSource = source;
    }

DocumentSource is binded to the PdfViewer.DocumentSource.

 

Here is the link to the PDF inputFile: https://goo.gl/3lpe9O

 Thank you

Maurício
Top achievements
Rank 1
 answered on 13 Sep 2017
1 answer
186 views

The documentation on this page (http://docs.telerik.com/devtools/document-processing/libraries/radziplibrary/features/protect-ziparchive) says 
"RadZipLibrary supports traditional PKWARE encryption only. The settings for this encryption type are represented by the DefaultEncryptionSettingsclass."

PKware has shifted it's focus to providing encryption products, and now offers a multitude of different encryption methods, products, and supported algorithms. 

Does anything know specifically what is meant by "traditional PKWARE encryption?"  I'm hoping for something like AES-256 ? 
Tanya
Telerik team
 answered on 13 Sep 2017
1 answer
531 views

Hi

How can I clone a RadFixedPage and added to a new RadFixedDocument

 

I tried with this code but I get an error so I think that I need to clone the page before I can added to another document

RadFixedDocument originalDocument = pdfProcessingProvider.Import(inputPdfStream);
                       RadFixedDocument newDocument = new RadFixedDocument();
                      
                       foreach (var page in originalDocument.Pages)
                       {                    
                                                 
                               newDocument.Pages.Add(page);//ERROR!!
                          
                       }

 

Thank you

Tanya
Telerik team
 answered on 08 Sep 2017
1 answer
1.8K+ views

Hello, I need to export / convert an Excel file to Pdf file.

Unfortunately using Microsoft.Interop everything works in development but not in production.

I have been able to use the RadFlowDocument features to convert a Word file to pdf using the following code.

public void TransformPdf(string fileSource, string fileDestination)
       {
           IFormatProvider<RadFlowDocument> fileFormatProvider = new DocxFormatProvider();
           using (FileStream input = new FileStream(fileSource, FileMode.Open))
           {
               RadFlowDocument document = fileFormatProvider.Import(input);
 
               byte[] renderedBytes = null;
 
               IFormatProvider<RadFlowDocument> formatProvider = new RtfFormatProvider();
               using (MemoryStream ms = new MemoryStream())
               {
                   formatProvider.Export(document, ms);
                   renderedBytes = ms.ToArray();
 
                   File.WriteAllBytes(fileDestination, renderedBytes);
               }
           }
       }

My question is: Do you have a similar or alternative way to make a pdf conversion using the Telerik libraries?

Thank you, Mario

Tanya
Telerik team
 answered on 07 Sep 2017
2 answers
164 views

hello i have docx file in memorystream  and open in telerik zip.

I see all entries,files  how to replaced some files in this zippackage and save to memorystream?

Tanya
Telerik team
 answered on 05 Sep 2017
1 answer
197 views

Hi, I wonder if you can help with my issue

How to put text in two columns as shown in the image?

 

 

Mihail
Telerik team
 answered on 22 Aug 2017
1 answer
103 views
Whether support .Net Core  2.0  
Mihail
Telerik team
 answered on 21 Aug 2017
4 answers
387 views

Hello,

I am importing a docx file to a radflowdocument and I need to be able to find some elements (such as list items) and see what the font properties are of text and make adjustments. I can see all of the lists in the document, but can't figure out how to get the associated text/text properties for them. Is this possible?

Thanks!

Tanya
Telerik team
 answered on 17 Aug 2017
1 answer
139 views

I'm looking into the possibilities of using Telerik Document Processing instead of Telerik Reporting in order to get some better control over the "widows and orphans" problem that my report in Telerik Reporting has, specifically when table headers appear at the bottom of a page and the data appears at the top of the next, and when a table's footnote (or the last line of a paragraph) appears at the top of a new page by itself, separated from all other data.

I imagine that using a RadFixedDocument could (hypothetically) allow me to control exactly where a paragraph or table breaks across a page, or gets pushed to a new page entirely, but that would be a lot of extra work to implement when I would expect that RadFlowDocument should already be able to do that. The problem is, I haven't found anything in the documentation or online about widow/orphan control in Telerik Document Processing, or even about how or when it determines where to wrap to a new page.

Is there anything built in for this, or can I even see when a page is supposed to break at design-time to prevent stray lines at the top and bottom of pages?

Anna
Telerik team
 answered on 08 Aug 2017
4 answers
458 views

I am currently trying out SpreadProcessing. I am importing an xlsx spreadsheet file using the XlsxFormatProvider, capturing its data into a DataTable and then exporting it (without changes) to a new file (with an xlsx extension).

However, when I subsequently open the exported file in Excel, I get the following message:

We found a problem with some content in <file>. Do you want us to recover as much as we can? If you trust the source of this workbook, click Yes.

If I click Yes, the file appears to load fully and correctly (although I get a further dialog). How can I avoid this message - it's going to be a concern to users of the application I'm intending to use SpreadProcessing in.

Excel Version 2013; Visual Studio 2017; UI for ASP.NET AJAX R2 2017; .NETFramework 4.5.2

Anna
Telerik team
 answered on 08 Aug 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?