PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Print to PDF
Print to PDF
Débuté par PETR_K, 11 mar. 2018 14:15 - 9 réponses
Membre enregistré
68 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é
68 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é
68 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.
Membre enregistré
68 messages
Posté le 19 février 2023 - 08:54
Hi, sorry for delay, I did not receive notification.

Yes, PDF is around 500 Kb or over. When I use some PDF printer, it is about 80 Kb. 1 page, simple logo. There should be no issue with picture size etc., because as I said, when I print the same report from WD using PDF printer, invoice is small.

I noticed that it should be solved in WD 28, and I will upgrade so we will see.
Posté le 20 février 2023 - 00:50
hi. My invoices weights around 50KB. Actually using WD27.
Maybe you added some logo or something.
Membre enregistré
1 message
Posté le 20 février 2023 - 01:03
Hi. My invoice pdfs, actually from WD27, weights around 50KB.
Maybe you added a logo ir something. Try to delete all the elements, one by one, until you find the culprit
Membre enregistré
68 messages
Posté le 28 décembre 2023 - 12:19
Hi. So I upgraded to WD28 and did more testing. It looks like that report increase it's size when I start to use characteres with diacritics like "ěšččř". I tried to change Unicode parameter but it did not help.

So for example, if I create very simple report with only one static control containing string "Cislo", I have size around 8 kB. When I change it to "Číslo" I get 160 kB.

If there is more fields I easily get size about 400 kB, it is probably due to different fonts, but I do not want to test it yet.

I did not find any settings where I could change something.

Any idea?
Message modifié, 28 décembre 2023 - 12:20
Posté le 28 décembre 2023 - 16:47
Hi, as defined PDF/A includes all of the fonts you're using! Maybe, you're using too many different fonts and maybe some font's size is too big?

Guenter