Telerik Forums
Telerik Document Processing Forum
1 answer
935 views

I noticed with 2017 R2, you just added Form Fields handling, thats great!

I reviewed another posting about iterating through images in a PDF.   Can those images be extracted and replaced with another image?

Does the PDFProcessing library allow adding a watermark to existing PDF?

 

Thanks

 

Peter

 

 

Tanya
Telerik team
 answered on 19 Sep 2017
1 answer
1.0K+ views

Hi

I use this code to convert pdf to List<image> but the resolution is not so high and the QR code inside the page is not detachable

Is there some way to improve the resolution (more DPI)?

 

public static List<ImageSource> ConvertPdfToImage(string filePath)
       {
           List<ImageSource> result = new List<ImageSource>();
           ThumbnailFactory tf = new ThumbnailFactory();
            
           using (Stream stream = File.Open(filePath, FileMode.Open))
           {               
               PdfFormatProvider formatProvider = new PdfFormatProvider(stream, FormatProviderSettings.ReadAllAtOnce);
               RadFixedDocument document = formatProvider.Import();
 
               foreach (RadFixedPage page in document.Pages)
               {
                   ImageSource pageImg = tf.CreateThumbnail(page, page.Size);
                    
                   result.Add(pageImg);
               }               
           }
           return result;
 
       }

 

Thank you

Tanya
Telerik team
 answered on 18 Sep 2017
6 answers
164 views

The documentation for the libraries included in Telerik Document Processing is available at http://docs.telerik.com/devtools/document-processing.

This week's latest resources are described below.

RadPdfProcessing
TextFragment
The content of this article is updated to describe the new properties added to the TextFragment class.

RadSpreadProcessing
Headers and Footers
The article is introduced to describe the new feature in RadSpreadProcessing - applying headers and footers when printing a document or exporting to PDF.

RadSpreadStreamProcessing
RadSpreadStreamProcessing
A new help section that explains how you could use the new RadSpreadStreamProcessing library to achieve fast export of spreadsheet documents with minimal memory usage.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 15 Sep 2017
1 answer
861 views

Dear Telerik,

Currently I'm trying to export docx to pdf but got some errors.

Here is my export code:

            PdfFormatProvider pdfer = new PdfFormatProvider();

            using (Stream input = File.OpenRead("E:\\hd.docx"))
            {
                RadFlowDocument document = provider.Import(input);
                pdfer.Export(document, new FileStream(@"E:\hd.pdf", FileMode.Create));
            }

And I got this error: "cant convert RadFlowDocument to RadFixedDocument", also when I'm using RadDocument and IDocumentFormatProvider to export like some threads, visual studio couldn't found these class, interface.

My references at attachment file, please look at it.

Thank you very much for your help!

Tanya
Telerik team
 answered on 14 Sep 2017
4 answers
746 views
I create a barcode using the barcode library from DevExpress. It can export the barcode in various raster image formats (PNG, JPEG, ...), in vector graphic formats (WMF and EMF) or as a separate PDF file.

Currently I export a JPEG and add it to Telerik RadPdfProcessing using:
myBlock.InsertImage(new ImageSource(myJpegImageStream, ImageQuality.High));

Of course, the image quality is not optimal, because the raster graphics are lossy when zooming. Is there any way to insert a vector graphic or the PDF as described above in a RadPdfProcessing Block/FixedContentEditor? If RadPdfProcessing does not support WMF or EMF, but a different vector graphic format, which a WMF or EMF can be converted to, it would be OK for me to convert the WMF/EMF to this other format.

Using a PdfStreamWriter to manipulate the PDF created by RadPdfProcessing afterwards may be an option, but not a very nice one, because the image is not part of the document flow.
Deyan
Telerik team
 answered on 14 Sep 2017
7 answers
695 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
180 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
497 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
155 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?