Combination of PDF and Word-document - rpreview

Combination of PDF and Word-document - rpreview

Postby driessen » Wed Aug 07, 2024 9:01 am

Hello,

In my application, I need to transfer a PDF-document with several pages, to a Word-document.
I want to do that in the same way a report in RPREVIEW.PRG is exported to a Word-document.
The result has to be a image of every page in my PDF-document on a page in the new Word-document.

I did have a look at RPREVIEW.PDF, but the big difference is the fact that I start with an EMF-document, and not a PDF-document.

Anyone any suggestions?

Thank you very much in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Combination of PDF and Word-document - rpreview

Postby nageswaragunupudi » Wed Aug 07, 2024 1:29 pm

I need to transfer a PDF-document with several pages, to a Word-document.


Code: Select all  Expand view
function PdfToWord( cPdf )

   local oWord

   if !File( cPdf )
      ? cPdf + " not found"
      return nil
   endif

   if ( oWord := WinWordObj() ) == nil
      ? "Word not loaded"
      return nil
   endif

   oWord:Documents:Open( TrueName( cPdf ), .f. )
   oWord:ScreenUpdating := .t.
   oWord:Visible := .t.

return nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Combination of PDF and Word-document - rpreview

Postby driessen » Wed Aug 07, 2024 2:50 pm

Mr. Rao,

Thank you for trying to help me.

I did a test with your suggestion. Unfortunately there are 2 problems
1. The layout of the document is completely wrong.
2. The PDF is converted to editable text. But I need to have it as an image.

Any idea?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Combination of PDF and Word-document - rpreview

Postby Otto » Wed Aug 07, 2024 3:59 pm

Hello Michel,
In my DMS, I have solved it by monitoring the directory with a timer.
If a new file, such as a PDF, WORD, RTF, etc., is added to a directory,
a preview is created as a JPG.
The original file is opened, and a screenshot is automatically created, which is then saved as a JPG.
Best regards,
Otto
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests