FwSavePreviewToPdf

Re: FwSavePreviewToPdf

Postby Massimo Linossi » Wed Mar 14, 2018 8: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Postby Enrico Maria Giordano » Wed Mar 14, 2018 9:01 am

This is a sample:

Code: Select all  Expand view
#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
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FwSavePreviewToPdf

Postby Massimo Linossi » Wed Mar 14, 2018 9:12 am

Wow !!!
So you know where can i find a list of the functions ?
Thanks a lot
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Postby Enrico Maria Giordano » Wed Mar 14, 2018 9:27 am

In the PDFCreator website, I think.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FwSavePreviewToPdf

Postby Massimo Linossi » Wed Mar 14, 2018 9:31 am

Great.
I'm going to look there.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: FwSavePreviewToPdf

Postby AntoninoP » Thu Mar 22, 2018 9: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?
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: FwSavePreviewToPdf

Postby nageswaragunupudi » Thu Mar 22, 2018 9: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
User avatar
nageswaragunupudi
 
Posts: 10635
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FwSavePreviewToPdf

Postby AngelSalom » Fri May 11, 2018 5: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
User avatar
AngelSalom
 
Posts: 727
Joined: Fri Oct 07, 2005 7:38 am
Location: Benicarló (Castellón ) - España

Re: FwSavePreviewToPdf

Postby vilian » Fri May 11, 2018 6: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
User avatar
vilian
 
Posts: 976
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: FwSavePreviewToPdf

Postby Armando » Fri May 11, 2018 7:22 pm

Á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 view

            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
Armando
 
Posts: 3227
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: FwSavePreviewToPdf

Postby AngelSalom » Fri May 11, 2018 8: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
User avatar
AngelSalom
 
Posts: 727
Joined: Fri Oct 07, 2005 7:38 am
Location: Benicarló (Castellón ) - España

Re: FwSavePreviewToPdf

Postby Armando » Fri May 11, 2018 9: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
User avatar
Armando
 
Posts: 3227
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: FwSavePreviewToPdf

Postby Carlos Mora » Sat May 12, 2018 8: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/
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"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: FwSavePreviewToPdf

Postby nageswaragunupudi » Sat May 12, 2018 9: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
User avatar
nageswaragunupudi
 
Posts: 10635
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FwSavePreviewToPdf

Postby Carlos Mora » Sat May 12, 2018 9: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"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests