cancel
Showing results for 
Search instead for 
Did you mean: 

Color graphic in a PDF generated from a SmartForm causes error

Former Member
0 Kudos

I have a SmartForm containing a color graphic. It works correctly,

appears just the way it should in Print Preview, and it prints

correctly. However, when I generate a PDF file from, Adobe Reader

complains that the PDF file is corrupt and refuses to print it. If I

remove the color graphic from the SmartForm and don't make any other

changes, I get a good PDF file that can be parsed, displayed, and

printed without any problems.

Why is the presence of the color graphic in the SmartForm leading to a

corrupt PDF file? Is there any workaround (short of removing the color

graphic) that I can use to get a good PDF file?

Here is a more detailed description of what I am doing.

1.	Creating the color graphic
	A. I started with a color .TIF file
	B. I went to transaction SE78,
	   Form Graphics -> Stored on Document Server ->
	     GRAPHICS General Graphics -> BMAP Bitmap Images
	C. Clicked on the "Import" icon
	D. In the "File name" field, navigated to my .TIF file
	E. Typed the name of my graphic in the "Name" field and some
	   descriptive text in the "Description" field
	F. Selected the "Color Bitmap Image" radio button
	G. Set the "Print Attributes" as follows:
	   Unchecked - Resides in the Printer Memory
	   Checked   - Reserve Height Automatically
	   Unchecked - Compression
	H. The color graphic seems to upload correctly
	I. When I click on Print Preview, it is displayed perfectly.
	J. When I use the Search Help associated with the name field to
	   find the graphic, it is shown with the name and description
	   that I gave it, the Object field is displayed as "GRAPHICS",
	   the ID field is displayed as "BMAP".
	K. When I select Graphic -> Graphic Information, the Resolution is
	   75 DPI and the Size is 26.86 x 8.26 cm. When I use this graphic
	   in the SmartForm, I will enter the resolution as 300 DPI - in
	   order to get an image whose dimensions are one-quarter of these
	   dimensions, but which will have a good resolution for a laser
	   printer.

2.	The use of the color graphic in the SmartForm
	A. It is a "Graphic" node which is the first node on the first
	   (and only) page of the SmartForm.
	   i.   The Name is the name of the graphic I created
	   ii.  Object = "GRAPHICS"
	   iii. ID = "BMAP"
	   iv.  The "Color Bitmap Image (BCOL)" radio button is selected
	   v.   The Resolution = 300 DPI
	B. The position and size are:
	   i.   Left Margin = 15.00 MM
	   ii.  Width = 69.00 MM
	   iii. Upper margin = 15.00 MM
	   iv.  Height = 21.77 MM

3.	The process of producing the PDF file
	A. The function SSF_FUNCTION_MODULE_NAME is called to obtain the
	   name of the function module associated with the SmartForm.
	B. The function module (whose name was returned by
	   SSF_FUNCTION_MODULE_NAME) is called with:
	   i.   CONTROL_PARAMETERS = a SSFCTRLOP structure with
	        GETOTF = 'X'
	        NO_OPEN = space
	        NO_CLOSE = space
	        NO_DIALOG = 'X'
	   ii.  OUTPUT_OPTIONS = a SSFCOMOP structure with:
	        TDPRINTER = 'POST2'
	        TDDEST = space
	        TDNEWID = 'X'
	        TDIMMED = 'X'
	        TDDELETE = space
	        TDCOVER = space
	        TDCOPOES = 1
	  iii. JOB_OUTPUT_INFO = a structure of type SSFCRESCL used to
	        receive the OTF file
	C. The function CONVERT_OTF is called with:
	   i.   FORMAT parameter = 'PDF'
	   ii.  OTF table parameter = the OTFDATA table contained within
	        the JOB_OUTPUT_INFO SSFCRESCL structure returned from the
	        SmartForm function module.
	   iii. BIN_FILE parameter = an XSTRING used to receive the PDF
	        file
	   iv.  BIN_FILESIZE parameter = an integer used to receive the
	        size of the PDF file.

Accepted Solutions (0)

Answers (3)

Answers (3)

aidan_black
Active Contributor
0 Kudos

Hello David,

The reason for this problem is probably related to the FlateDecode compression described in SAP Note 843480 (PDF conversion: Compression of bitmaps and TrueType fonts).

Try switching off the usage of FlateDecode compression again via report RSTXPDF3 as described in Note #843480.

It is a little confusing. The option 'FLATE_COMPR_OFF' needs to be set to 'On' to turn off the FlateDecode compression.

To set this run as follows:

se38 -> RSTXPDF3 -> enter 'FLATE_COMPR_OFF' in the 'Name' field

-> Select 'Change Settings' radio button

You will get a pop-up 'Do not use flat compression'.

Select the 'on' button.

After this create a new PDF and check if the problem is resovled.

Regards,

Aidan

Former Member
0 Kudos

David,

Thank you so much for the solution.

I followed the steps that you specified for compression activation and the PDF along with logo image came out very clearly.

Warm Regards,

Tom.

Sandra_Rossi
Active Contributor
0 Kudos

Tom, next time, open a new thread, and read forum rules

david_liu1
Advisor
Advisor
0 Kudos

Hello,

Do you use a true color graphic with more than 256 colors?

During the upload into the SAP the SAP converts the graphic

to a graphic with 256 colors (because of space and performance

reasons).

I

Can you check whether your graphic contains more than 256 colors,

and if yes, can you convert it to a 256 color graphic before the

upload?

Regards,

David

Former Member
0 Kudos

I also have the same problem. Please solve the issue.

- Tom