FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FwSavePreviewToPdf
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: FwSavePreviewToPdf
Posted: Wed Mar 14, 2018 08:55 AM
Enrico Maria Giordano wrote:I don't like "Microsoft Print to PDF" very much because the result PDF is almost ten times bigger than the one created by PDFCreator. And PDFCreator can be driven by OLE.

EMG


Hi Enrico
What can you make with Ole ? Have you found any example of Ole functions available ?
Thanks a lot
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: FwSavePreviewToPdf
Posted: Wed Mar 14, 2018 09:01 AM
This is a sample:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oPdf := CREATEOBJECT( "PDFCreator.JobQueue" )

    LOCAL oJob

    LOCAL oPrn

    oPdf:Initialize()

    PRINT oPrn TO "PDFCreator"
        PAGE
            oPrn:Say( 0, 0, "This is a test" )
        ENDPAGE
    ENDPRINT

    IF !oPdf:WaitForJob( 10 )
        ? "Errore"
    ELSE
        oJob = oPdf:NextJob()

        oJob:SetProfileSetting( "OpenViewer", "False" )
        oJob:SetProfileSetting( "ShowProgress", "False" )

        oJob:ConvertTo( "E:\FWXHARB\TEST" )

        IF !oJob:IsFinished .OR. !oJob:IsSuccessful
            ? "Errore"
        ENDIF
    ENDIF

    oPdf:ReleaseCom()

    RETURN NIL


EMG
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: FwSavePreviewToPdf
Posted: Wed Mar 14, 2018 09:12 AM

Wow !!!
So you know where can i find a list of the functions ?
Thanks a lot

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: FwSavePreviewToPdf
Posted: Wed Mar 14, 2018 09:27 AM

In the PDFCreator website, I think.

EMG

Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: FwSavePreviewToPdf
Posted: Wed Mar 14, 2018 09:31 AM

Great.
I'm going to look there.

Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: FwSavePreviewToPdf
Posted: Thu Mar 22, 2018 09:09 AM

About FwSavePreviewToPdf, I see it creates enormous jpg, maybe it is possible reduce them to 1/4 (half width and half height) and in some case made it in Grayscale...
What do you think?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FwSavePreviewToPdf
Posted: Thu Mar 22, 2018 09:37 AM
AntoninoP wrote:About FwSavePreviewToPdf, I see it creates enormous jpg, maybe it is possible reduce them to 1/4 (half width and half height) and in some case made it in Grayscale...
What do you think?

Yes, there is some scope. We are testing.
Regards



G. N. Rao.

Hyderabad, India
Posts: 728
Joined: Fri Oct 07, 2005 07:38 AM
Re: FwSavePreviewToPdf
Posted: Fri May 11, 2018 05:53 PM

where can I download or buy image2pdf.dll?
Thanks

Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: FwSavePreviewToPdf
Posted: Fri May 11, 2018 06:40 PM

The website of sold image2pdf was www.utilitywarrior.com, but it's closed.
The owner of this, wanted to sell the source code of Image2Pdf, but I think Antonio Linares don't guess this interesting.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: FwSavePreviewToPdf
Posted: Fri May 11, 2018 07:22 PM
Ángel:

Hace un par de años compre Image2pdf pero lo tengo en EXE no DLL

Su uso es muy sencillo

Code (fw): Select all Collapse
            WaitRun("img2pdf.exe -$ AQUI_VA_TU_LICENCIA -p 1 -r -1 -o " +;
                     '"' + ALLTRIM(cPdfFile) + '"' + SPACE(01) +;
                     '"' + ALLTRIM(aFiles[nVez]) + '"',0)


Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 728
Joined: Fri Oct 07, 2005 07:38 AM
Re: FwSavePreviewToPdf
Posted: Fri May 11, 2018 08:55 PM

Gracias, una pena que ya no esté disponible.

Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: FwSavePreviewToPdf
Posted: Fri May 11, 2018 09:37 PM

Ángel:

Dale una mirada a este link

http://www.verypdf.com/wordpress/201106 ... e-139.html

Ojalá te sirva.

Saludos

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: FwSavePreviewToPdf
Posted: Sat May 12, 2018 08:53 AM

Regards Image2Pdf, it did a good job, but when used to transform META to get real (not image) pdf, i had many issues related to font translation. Usually the problems came from the fact that font names are different in Spanish than English, so the library wasn't able to make the right font translation. By that time I worked with the author of the library, but we weren't able to find a solution for the issue.

I also used PdfCreator, who gave me one of the best results in terms of quality. It really produces very small pdfs, and you are able to select and copy text from them. The only issue I had was that managing the printJob queue is time/resource consuming, and eventually having more than one program producing pdf documents can be really difficult to manage. To produce masive pdfs like in payroll printing, it didn't make.

When pdf size and quality matters, there is nothing like use a library that write real pdf documents, like Haru. Realy fast, lightweight, and the best results you can get. You may take a look at the following library, Mastintin and I were working on it some months ago. It will give you a good starting point to help in the convestion of current FW printing code.

https://bitbucket.org/carlos_mora/pdfprinter/

Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FwSavePreviewToPdf
Posted: Sat May 12, 2018 09:00 AM
When pdf size and quality matters, there is nothing like use a library that write real pdf documents, like Haru. Realy fast, lightweight, and the best results you can get.

https://bitbucket.org/carlos_mora/pdfprinter/

Can this be used from Print Preview to convert Meta files (emf) to pdf files, without going back to the original program that generated the report?

We very eagerly look forward to any advice and guidance from experts as to how to convert meta files to pdf, with compact size and quality comparable to MS Word.
Regards



G. N. Rao.

Hyderabad, India
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: FwSavePreviewToPdf
Posted: Sat May 12, 2018 09:16 AM
Hi Rao,
nageswaragunupudi wrote:
Can this be used from Print Preview to convert Meta files (emf) to pdf files, without going back to the original program that generated the report?

Nope. It just translates FW's TPrinter methods into LibHaru calls. As I mention in my previous message, I tried to help Image2Pdf's author to help with that kind of convertion, I wasn't able to find a straight way to translate font names from a language into another, it was a very tricky matter.

One of the most common solutions to that convertion is to transform the EMF into something GhostScript can handle, like PCL5 (the language used by HP it its printers) and then distile it to pdf. I've played with GhostScript for a while and fount it really awesome.

There are other things that the Windows printing model would not be able to handle, like decide when to embed fonts, to reuse images like those used in watermarks, etc that will make such tool not complete in certain cases.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"