PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 27 → Print to PDF
Print to PDF
Débuté par PETR_K, 11 mar. 2018 14:15 - 4 réponses
Membre enregistré
64 messages
Posté le 11 mars 2018 - 14:15
Hello,
I try to create PDF directly from WD. This is what I tried as far.

iParameterPDF(iProtectionNone,"",iAverageQuality)
iDestination(iGenericPDF+iPDFA,"File.pdf")
iPrintReport(ReportRelPath)

It works but problem is that even for very simple 1 page report it generates quite huge PDF file, cca 500kB. According to PCsoft, reason is that fonts are embedded and there is no option to remove them. I tried to play with parameters like iPDFA, iQuality... but it did not help.

So i tried to print report to PDF printer.
iConfigure("Bullzip PDF Printer")
iPrintReport(ReportRelPath)


I tried Bullzip for example, file is cca 80kB, which is ok but I have 2 issues:
1. It behaves strange.
When I run it, it shows print window for about 1 minute. After this long time the file is created and saved. Program hangs, no error, it just freeze.
But when I debug it with breakpoint set on iPrintReport(ReportRelPath) command, it works as I would suppose. I just trace it (there is just one line of code.), it shows print window for cca 2 seconds and program works normally, no hang.





2. I did not find a way how to name the PDF file. BullZip creates filename based on report name "RPT_Invoicepdf" for example. I am playing now with renaming the file after it is saved, problem is that it takes some times before file appears in folder and when I am renaming it, the file is not there yet.

Question is if you do not know any way how to create small PDF file.

Thank you

Petr
Membre enregistré
64 messages
Posté le 15 mars 2018 - 00:00
Hi,
point 1. looks like solved, I did not find anything special, just some cleaning and reinstall...

As far I did not find any other solution except of buying some quite expensive SDK and to use it via COM or similar way.
Membre enregistré
64 messages
Posté le 22 janvier 2023 - 22:48
Hi, I just upgraded to WD27 and I was hoping there will be some option how to deembed fonts when saving PDF file but I did not find anything like that.

How do you generate PDF files that are not big? Normal text page like invoice, delivery bill, etc. should have couple of KB, around 60 kB, so that you can send it via email.

Petr
Posté le 23 janvier 2023 - 11:00
Hi,

So you print an invoice to PDF and the size of the PDF is > 500Kb?
Is this invoice 1 page? I know that sequencing can cause this problem. It should be fixed in WD28 according to PC-Soft.
Are there images on the invoice? You should keep them as 'light' as possible.

A 'normal' invoice of 1 page should be less than 50 Kb.

Kind regards,
Joris.
Posté le 23 janvier 2023 - 11:00
Hi,

So you print an invoice to PDF and the size of the PDF is > 500Kb?
Is this invoice 1 page? I know that sequencing can cause this problem. It should be fixed in WD28 according to PC-Soft.
Are there images on the invoice? You should keep them as 'light' as possible.

A 'normal' invoice of 1 page should be less than 50 Kb.

Kind regards,
Joris.