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 - 12 réponses
Membre enregistré
71 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é
71 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é
71 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é
71 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é
71 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
Membre enregistré
71 messages
Posté le 20 août 2024 - 14:47
Hi,
I got notification from pcsoft about your answer only today...

In meantime I had some discussion with PCSOFT help and it looks like that WinDev PDF engine can not handle very well characters with diacritics, maybe only East European, I don't know but when I generate the same PDF from OpenOffice or when I print it, I have small PDF with correct chatacters.

This is part of PCSOFT answer.
"The size of the file generated depends on the font used. Arial Bold with an Eastern European Charset must in this case be embedded in the pdf, as it is not possible to use a core font."

So it looks like I either have to use some PDF printer. If anybody know some good one, please let me know. Or I have to create c# code or I don't know what...

Petr
Membre enregistré
214 messages
Posté le 22 août 2024 - 12:12
PETR_K wrote:
Hi,
I got notification from pcsoft about your answer only today...

In meantime I had some discussion with PCSOFT help and it looks like that WinDev PDF engine can not handle very well characters with diacritics, maybe only East European, I don't know but when I generate the same PDF from OpenOffice or when I print it, I have small PDF with correct chatacters.

This is part of PCSOFT answer.
"The size of the file generated depends on the font used. Arial Bold with an Eastern European Charset must in this case be embedded in the pdf, as it is not possible to use a core font."

So it looks like I either have to use some PDF printer. If anybody know some good one, please let me know. Or I have to create c# code or I don't know what...

Petr


Hi

I had the same issue and it was settings on the report. Check these and let me know if it works:











Thanks
Ruan
Membre enregistré
71 messages
Posté le 16 septembre 2024 - 21:37
Hi Ruan,
thank you for hint. There is something strange with notifications, I got it today, which is 16.9. and you post message on 22.8..

Anyway, I probably overlook someting, because on pictures you published I can't see anything regarding document size... Could you please be more specific?
Kind regards

Petr
Message modifié, 16 septembre 2024 - 23:27