How to import pdf document in to word document.

3 Answers 217 Views
PdfProcessing WordsProcessing
Faraz
Top achievements
Rank 1
Faraz asked on 22 Dec 2022, 09:58 PM

I want to import pdf document to a RadFlowWordDocument in the current Run from code.

Is it possible? I have imported pdf using RadEditor.

 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Dec 2022, 11:23 AM

Hello Faraz,

A possible solution is to extract the text from the PDF file using the TextFormatProvider. This will give you a string with the text from the PDF which you can insert.

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Faraz
Top achievements
Rank 1
commented on 02 Jan 2023, 01:43 PM

Is there an example to add pdf file into another pdf file at a specific location. 
I have converted word document to pdf document and now i want to add another pdf file content into that pdf at specifc location.
Adding text in document not giving the desired result,
Peshito
Telerik team
commented on 03 Jan 2023, 03:24 PM | edited

Hello Faraz,

To insert a pdf document into another pdf document you could use the RadPdfProcessing library. You could check Merge two document pages into a new single page article and see the provided example in it. For another approach, you could use the RadWordsProcessing library as well. The library allows you to insert a document into another document at a specified position. You could achieve that using the InsertDocument() method of the RadFlowDocumentEditor class. I am sending you an example project to see how you could achieve the wanted behavior. For more information, you could check our help article Insert Documents in our documentation.

I hope this information helps. Let me know If you have additional questions.

Regards,

Peshito

Progress Telerik

Faraz
Top achievements
Rank 1
commented on 03 Jan 2023, 07:04 PM | edited

Hi,
Your attached example inserts word document inside word document. I wanted to insert pdf document inside word document or pdf inside pdf at specific location not merging in the end.
0
Maria
Telerik team
answered on 04 Jan 2023, 03:35 PM

Hello Faraz,

I am afraid that this is not supported. There is logged item in our feedback portal: Implement import of PDF to RadFlowDocument. You could subscribe to the item so you could track its progress and any status changes. If I understand you right, the option of merging two documents presented in the article is not suitable for you either. You can check more information in the example of operating with the RadFixedDocument article. If so, the only option is to use the RadWordsProcessing library. You can insert the document between runs. That gives you the opportunity to select the exact position where you want to insert the other document. You can see the shown approach in the example project which I sent to you. If you want the final document to be in the pdf format you can export the .docx file into pdf. This article demonstrates how can you achieve this: Convert Docx to PDF.

I hope this information helps you. Let me know if I can assist you further.

Regards,
Maria
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Faraz
Top achievements
Rank 1
commented on 04 Jan 2023, 03:37 PM

Ok i will wait for release. Can you also tell if i could convert pdf to image and insert it back in word doc.
Is this supported in .net framework to convert pdf to image and insert it to word docx.
0
Maria
Telerik team
answered on 05 Jan 2023, 11:15 AM

Hello Faraz,

RadPdfProcessing library ssupports converting entire documents to images. This is achieved by using the third-party library SkiaSharp. You can convert to various formats, using synchronous or asynchronous export. You could use the SkiaImageFormatProvider. You could check our help article Using SkiaImageFormatProvider in our documentation and see the provided code examples of how to export RadFixedDocument to an image. 

To insert the image into a word file you could use the RadWordsProcessing library. You need to insert ImageInline in the document which is an inline-level flow content element intended to contain an image object. To import the image in the document you could see the provided example here: Inserting an ImageInline.

I hope this information is useful. If you have further questions don't hesitate to write back.

 

Regards,
Maria
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Faraz
Top achievements
Rank 1
commented on 05 Jan 2023, 03:31 PM | edited

Hi,

I can not use that approach because it is for .net core not for .net framework.
For .netframework i found article WPF PdfViewer - Exporting Fixed Page to Image - Telerik UI for WPF

 

Maria
Telerik team
commented on 06 Jan 2023, 12:28 PM

Hello Faraz,

Indeed this approach is only for .Net Standart. For the article you sent, I saw that you have a license only for Kendo UI and the article is about Telerik UI for WPF. You could check our DevCraft license, which includes a tooling collection with .NET and JavaScript UI components for web, desktop, and mobile applications, reporting and report management solutions, automated testing, and mocking tools from the Telerik and Kendo UI suites. Plus, Document Processing libraries.

I hope this information is useful. Let me know if I can assist you further.

Regards,
Maria
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PdfProcessing WordsProcessing
Asked by
Faraz
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Maria
Telerik team
Share this question
or