FwSavePreviewToPdf

User avatar
Massimo Linossi
Posts: 508
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Post by Massimo Linossi »

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
User avatar
Enrico Maria Giordano
Posts: 8767
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: FwSavePreviewToPdf

Post by Enrico Maria Giordano »

This is a sample:

Code: Select all | Expand

#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
User avatar
Massimo Linossi
Posts: 508
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Post by Massimo Linossi »

Wow !!!
So you know where can i find a list of the functions ?
Thanks a lot
User avatar
Enrico Maria Giordano
Posts: 8767
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: FwSavePreviewToPdf

Post by Enrico Maria Giordano »

In the PDFCreator website, I think.

EMG
User avatar
Massimo Linossi
Posts: 508
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Post by Massimo Linossi »

Great.
I'm going to look there.
AntoninoP
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: FwSavePreviewToPdf

Post by AntoninoP »

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?
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FwSavePreviewToPdf

Post by nageswaragunupudi »

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
User avatar
AngelSalom
Posts: 727
Joined: Fri Oct 07, 2005 7:38 am
Location: Benicarló (Castellón ) - España
Has thanked: 1 time
Contact:

Re: FwSavePreviewToPdf

Post by AngelSalom »

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
User avatar
vilian
Posts: 987
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: FwSavePreviewToPdf

Post by vilian »

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
User avatar
Armando
Posts: 3278
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 3 times
Contact:

Re: FwSavePreviewToPdf

Post by Armando »

Ángel:

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

Su uso es muy sencillo

Code: Select all | Expand


            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
User avatar
AngelSalom
Posts: 727
Joined: Fri Oct 07, 2005 7:38 am
Location: Benicarló (Castellón ) - España
Has thanked: 1 time
Contact:

Re: FwSavePreviewToPdf

Post by AngelSalom »

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
User avatar
Armando
Posts: 3278
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 3 times
Contact:

Re: FwSavePreviewToPdf

Post by Armando »

Á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
Carlos Mora
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: FwSavePreviewToPdf

Post by Carlos Mora »

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/
Last edited by Carlos Mora on Sat May 12, 2018 9:05 am, edited 1 time in total.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FwSavePreviewToPdf

Post by nageswaragunupudi »

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
Carlos Mora
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: FwSavePreviewToPdf

Post by Carlos Mora »

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"
Post Reply