Telerik Forums
Telerik Document Processing Forum
5 answers
515 views

I to open a docx file to make a mail merge with it, you can download here:

//mega/#CtBHdEDQEmAR74q9awHNqjLou5vF8_Q_pHs9Xgu4z5Y

I receive this error:

SystemCollectionsGenericKeyNotFoundException occurred
  =0x80131577
  Message=The given key was not present in the dictionary.
  Source=
  :
    SystemCollectionsGenericDictionary`2get_ItemTKey key)
    TelerikWindowsDocumentsFlowFormatProvidersDocxImportRadFlowDocumentImportContextGetResourceByResourceKeyString )
    TelerikWindowsDocumentsFlowFormatProvidersDocxModelElementsVectorCreateImageSourceFromRelationshipIdString , IDocxImportContext context)
    TelerikWindowsDocumentsFlowFormatProvidersDocxModelElementsVectorOnAfterReadChildElementIDocxImportContext context, OpenXmlElementBase )
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBase`3OnAfterReadChildElementIOpenXmlImportContext context, OpenXmlElementBase )
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadChildElementsIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelElementsOpenXmlElementBaseReadIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlModelPartsOpenXmlPartBaseImportIOpenXmlReader reader, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlOpenXmlImporter`1ImportXlsxPartFromArchiveZipArchiveEntry , OpenXmlPartBase part, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFormatProvidersOpenXmlOpenXmlImporter`1ImportStream input, IOpenXmlImportContext context)
    TelerikWindowsDocumentsFlowFormatProvidersDocxDocxFormatProviderImportOverrideStream input)
    TelerikWindowsDocumentsCommonFormatProvidersFormatProviderBase`1ImportStream input)
    TelerikWindowsDocumentsCommonFormatProvidersBinaryFormatProviderBase`1ImportByte] input)
    ProgramTelerikWay) in C:\Users\oscar.WAF\documents\visual studio 2017\Projects\WordTest\WordTest\Program.cs:line 45
    ProgramMainString] args) in C:\Users\oscar.WAF\documents\visual studio 2017\Projects\WordTest\WordTest\Program.cs:line 39

 

Some ideas?

Note: I'm using 2017.3.913 of WPF controls

Tanya
Telerik team
 answered on 10 Oct 2017
2 answers
903 views

I'm using SetFontSize() to set the font size of a column. If set it to 10 then the size in the saved Excel document is 7.5. If I set it to 11, 8.5. 10.5 Shows as 8 but isn't really 8 because it's pixelated. Setting it to 8 in Excel shows a nice anti-aliased font.

So, how do I get SetFontSize() to set a real font size of 8 in Excel?

Polya
Telerik team
 answered on 25 Sep 2017
4 answers
936 views

I currently need to format some columns to use the "Accounting format". In your documentation, you talk about the document model exposing number formats. However none of your examples show how to access the document model (def, they show how to create custom number formats. Can you please tell me how I can access the Accounting format?

worksheet.Cells[2, 5].SetFormat(new CellValueFormat(  SomeEnum/Class.AccountingFormat   ));
Tanya
Telerik team
 answered on 25 Sep 2017
5 answers
388 views

Hi,

How do I get rid of the warning on Excel that says 'This document was generated by a trial version of Telerik RadSpreadProcessing.'?

Is there a way to check if I have the right dll or license file somewhere?

Thank you!

Tanya
Telerik team
 answered on 25 Sep 2017
1 answer
123 views

I have a couple .docx documents to which I've added a few merge fields. When I MailMerge against the documents, the document layout completely changes, section headers get right shifted, underlining removed, form checkboxes vanish, etc.

I've hacked up the mail merge project from here and attached it to demonstrate what I mean (you'll need to remove the .png extension to revert it to a .zip). If you compare Doc1.docx and Doc2.docx to their mail merged versions, you'll see what I mean.

Is this something that's just unsupported or am I doing it wrong?

Tanya
Telerik team
 answered on 25 Sep 2017
9 answers
505 views

Hello,

I have an MVC application that I would like to take a PDF file and either convert it into HTML, edit the content, and update the new content into a new PDF. 

OR

be able to edit the PDF content and update it into a new PDF file. Would appreciate if you could point to the right Telerik libraries and any examples would be great.I know I can split up pages using the PdfStreamWriter, however editing would need to be done within the page, so splitting is not an option.

Many thanks

Georgi
Telerik team
 answered on 21 Sep 2017
1 answer
1.0K+ 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.1K+ 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
223 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
931 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?