pdf file size too big & preview

pdf file size too big & preview

Postby Romeo » Tue Feb 16, 2016 6:06 pm

Hi,

there is a very big difference in file size between create a PDF file with Preview Print and choosing PDF driver printer (as PDFCreator, PDF995...)

Example creating same file:

pdfcreator file size: 20 kb
pdf995 file size: 28 kb
PDF FWIN PREVIEW: file size 1800 kb

About 90 times bigger !!

My i reduce this size ? How ?

tks
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: pdf file size too big & preview

Postby Carlos Mora » Wed Feb 17, 2016 2:30 pm

The difference is because in case of Pdf Printers, printing device commands are translated to pdf commands, giving such compact result. FW pdf generation is based on the convertion of the generated EMF page image into a format like JPEG, and then the pdf's pages are made up using that image.
You can verify this trying to select text from the pdfs.
The best thing you cando is to use a pdf library to generate the pdf, so you'll have the behavoir and performance you want. HaruPdf is my favorite, it can be found in Harbour's contrib directory.
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: pdf file size too big & preview

Postby hmpaquito » Wed Feb 17, 2016 3:23 pm

Real (text) translation wmf to pdf file http://www.fpdf.org/en/script/script55.php
It is php language... sorry.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: pdf file size too big & preview

Postby Carlos Mora » Wed Feb 17, 2016 5:41 pm

Paquito,

this translation is limited to graphics objects, but does not translate the most important (and complex) objects for us in the translation: Text and fonts. And WMF is a dead format, isn't it?

I used ImageToPdf.dll to do such translation in Windows for a while, but never got an acceptable result. The library's author gave all the support he could, but translating font (and fonts names) is a real nightmare.

I'm currently using Haru, and it is the fastest lib you can use, with the best results, in terms of speed, precision of rendering and size of the document.
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: pdf file size too big & preview

Postby karinha » Wed Feb 17, 2016 5:57 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: pdf file size too big & preview

Postby hmpaquito » Wed Feb 17, 2016 6:08 pm

Carlos,

It is likely that this routine does not do the entire job but is there another out there that if you do? It's easy to transform wmf emf.

Yes imgtopdf.dll is a nightmare.
Haru is fine to design all reports from scratch, but when you already have reports running necessary conversion from wmf / emf to pdf.

I once raised the issue of designing all reports to pdf and do not use more or WMF or EMF. There if Haru would fit.


---

Carlos,

Es probable que esa rutina no haga el trabajo completo ¿ pero habrá otra por ahí que si lo haga ? Es facil transformar de wmf a emf.

Sí imagetopdf.dll es una pesadilla. Lo probé y lo descarté.
Haru está bien para diseñar todos los informes desde cero, pero cuando ya tienes informes funcionando es necesario una conversion desde wmf/emf a pdf.

Alguna vez me he planteado el hecho de diseñar todos los informes para pdf y no usar mas ni wmf o emf. Ahí si tendria cabida haru.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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