PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Print to PDF
Print to PDF
Started by PETR_K, Mar., 11 2018 2:15 PM - 9 replies
Registered member
68 messages
Posted on March, 11 2018 - 2:15 PM
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
Registered member
68 messages
Posted on March, 15 2018 - 12:00 AM
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.
Registered member
68 messages
Posted on January, 22 2023 - 10:48 PM
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
Posted on January, 23 2023 - 11:00 AM
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.
Posted on January, 23 2023 - 11:00 AM
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.
Registered member
68 messages
Posted on February, 19 2023 - 8:54 AM
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.
Posted on February, 20 2023 - 12:50 AM
hi. My invoices weights around 50KB. Actually using WD27.
Maybe you added some logo or something.
Registered member
1 message
Posted on February, 20 2023 - 1:03 AM
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
Registered member
68 messages
Posted on December, 28 2023 - 12:19 PM
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 modified, December, 28 2023 - 12:20 PM
Posted on December, 28 2023 - 4:47 PM
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