Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Compressing and decompressing a PDF file

Former Member
0 Likes
4,760

Dear Gurus,

Anyone who can assist with the code to compress and decompress PDF file so that I can send it in an email.

Thanks

1 ACCEPTED SOLUTION
Read only

OttoGold
Active Contributor
0 Likes
3,090

Hello,

in most cases you don´t have to compress PDF. Let me guess, your PDF is not a form (like Adobe form), but a spool exported to PDF and the resulting file is very big? If I am right, create a simple Adobe form to create a PDF file with the reasonable size for you.

Regards Otto

Dear Gurus,

Anyone who can assist with the code to compress and decompress PDF file so that I can send it in an email.

Thanks

10 REPLIES 10
Read only

Former Member
0 Likes
3,090

Hi,

use the class

CL_ABAP_ZIP

[;

[http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_ZIPusage-ZippingABAPreportoutput]

Read only

0 Likes
3,090

Hi,

Thanks for your answer, it gives me this error.

cl_abap_zip is unknown.

any ideas?

Read only

0 Likes
3,090

This class may not exisi on your system. i think it's above ECC6

Read only

Former Member
0 Likes
3,090

Hi Mpangib,

Check this [url|http://www.easymarketplace.de/SAPCAR.php#Compress].

It serves your requirement.

Regards,

Pranaam.

Read only

0 Likes
3,090

Dear Pranaam,

Thanks for your response.

Dont you have any sample program with relation to my requirement.

I convert into pdf

send via email to

My issue is that when I use FM Compress the attachemnt goes trough but cannot open the file as it says file type error.

How to decompress so that users can read Adobe after its compressed.?

Thanks

Read only

0 Likes
3,090

Hi Florian,

Any suggestions on how to resolve this issue?

Regards,

Read only

Former Member
0 Likes
3,090

Oh well, PDF is already a highly compressed format, so compressing it wont help you much.

PDF´s are very fine for the purpose of sending them as attachments per mail.

And even if you have a really big PDF i highly doubt compressing will help.

Read only

OttoGold
Active Contributor
0 Likes
3,091

Hello,

in most cases you don´t have to compress PDF. Let me guess, your PDF is not a form (like Adobe form), but a spool exported to PDF and the resulting file is very big? If I am right, create a simple Adobe form to create a PDF file with the reasonable size for you.

Regards Otto

Read only

Former Member
0 Likes
3,090

Hi Otto,

Thanks for your response.

Yes I am converting my spool into PDF and then send it by email.

Can you please guide me through with your solution? I am not familier with that.

Thanks.

Read only

OttoGold
Active Contributor
0 Likes
3,090

1) you should go to ABAP Printing forum where this problem has been discussed many times (for example remove the coloring to reduce the file size etc.). Just in case you would insist on working your way.

2) You can create some printing "device" like smartform etc. to print your data for you and then convert it to PDF, the result should be smaller then option 1)

3) the best one: if you want to send a PDF somewhere (or archive it etc.) you should start with Adobe forms, for you purpose Adobe print forms will be suffiscient. You only need to install and configure the ADS component to generate forms from the template for you. If you want to see a brief ovewrview about how to create this thing, start reading somewhere like here (this is not the most simple example!!):

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf806...

Regards Otto