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

Convert TIF Binary data to PDF Binary data

Former Member
0 Likes
3,720

Hi All,

I have uploaded TIF file into table in system in Binary format.

I need to create a spool from this Binary data, the spool should open in TIF format or PDF format.

Can you help me in doing this.

As I knw how to convert PDF to Spool, it would be even helpful, if you tell me how to convert TIF binary data into PDF binay data.

Thanks in advance.

Abhay

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
3,385

TIFF has to be uploaded using SE78, then you may embed it in sapscript (or smart form) and print the form -> a spool is generated in OTF format that you may convert easily to PDF (as you know)

31 REPLIES 31
Read only

Sandra_Rossi
Active Contributor
0 Likes
3,386

TIFF has to be uploaded using SE78, then you may embed it in sapscript (or smart form) and print the form -> a spool is generated in OTF format that you may convert easily to PDF (as you know)

Read only

0 Likes
3,385

Hi Sandra,

Thanks for the reply.

But my process, is that the tif file will be attached as attachment to transaction.

I need to read the transaction (which I am geting it) and create a spool.

Can you help me in this?

Thanks,

Abhay

Read only

0 Likes
3,385

As Otto said, you have to get the TIF file (from GOS or whatever).

Then you write the file to presentation server (if run in dialog) or application server (if run in background) and upload it via RSTXLDMC program to SE78 (the image will be stored as an ITF text with HEX...ENDHEX statements). Then you print the image using , and print this ITF text using READ_TEXT and PRINT_TEXT (or you may include it in any sapscript or smart form). Note that this works only with TIF files which must have compression "none" or "packbits".

Read only

0 Likes
3,385

Hi Sandra,

My requirement is as given below:

1. Tif file is attached as document for transaction CRMD_ORDER in CRM.

2. Read the tif file (I am doing this using standard functionality.)

3. When I read this data, I am getting the data in Binay Format.

4. Now I need to create a spool for this Binary format (Tif) without printing it.

Could you please help me in this.

Thanks.

Abhay

Read only

0 Likes
3,385

Maybe Sandra can help you with the other options, I can tell you about the Adobe form:

- create a form (two clicks away)

- place the image field on the form

- create a printing program (95% can be copied from any demo program for Adobe form)

- pass your image data into the form (you need XSTRING data here)

- get your PDF file with the image

It would take me like 5 minutes including loggin into the system to create such thing. The only concern I have is whether you have ADS installed or not. If not, you would have to find a basis guy to install it for you.

Regards Otto

Read only

0 Likes
3,385

do as I said, what other information do you need?

Read only

0 Likes
3,385

Hi Otto,

I am done with converting PDF file to spool. There is standard program RSPO0023 which I had to modify for my requirement.

Now, I am workin on TIF file. Coz the client wants both TIF and PDF files to be converted to a spool, as both these files will be attached to order.

Read only

0 Likes
3,385

you won't be able to put a binary PDF into spool.

BTW why do you want to generate a spool but not print it?

Read only

0 Likes
3,385

The requirement is to create spool for all the attachments (PDF/TIF).

Then a batch report will pick all the spools and send it to printing at 1 time in night.

So I have to create a spool for PDF and TIF attached to order. I am able to create spool for PDF, but unable to find the logic to create spool for TIF.

Could you please help me in doing this.

Read only

0 Likes
3,385

If you don't tell me what is your problem with TIFF now, I can't help more.

About PDF, are you sure it works? (if they don't originate from Interactive Forms by Adobe (which generates an accompanying PS or PCL file that is the one that can be printed), you can't do it without external software; even with a printer that is able to print PDFs natively (that's rare), I couldn't succeed in generating a spool with non-corrupted data (I had some corrupted bytes every 720 bytes))

Read only

0 Likes
3,385

Hi,

My Problem with TIF is as given::

1. I am getting the attachment data for TIF in BINARY FORMAT (Length 1022).

2. I need to create spool for this Binary format.

Yes PDF to spool is working fine.

Read only

0 Likes
3,385

> 2. I need to create spool for this Binary format.

Maybe you missed my answer above. Here it is once again. Based on that, could you tell me what you don't understand.

>> Then you write the file to presentation server (if run in dialog) or application server (if run in background) and upload it via RSTXLDMC program to SE78 (the image will be stored as an ITF text with HEX...ENDHEX statements). Then you print this ITF text (which represents an image in fact) using READ_TEXT and PRINT_TEXT (or you may include it in any sapscript or smart form).

> Yes PDF to spool is working fine.

Bravo! You can imagine how much I am interested to know how you did it!

Read only

0 Likes
3,385

for PDF to spool, there is standard report RSPO0023, I copied this program and added the code to fetch the PDF file attached to the Order (transaction CRMD_ORDER).

But the mail issue I am facing is converting TIF to spool.

the TIF file comes from a transaction, so I cannot use any other report to print it..I will have to code it in the same program when I am fetchin the data.

I hope you get my question

Edited by: abhay chauhan on Mar 31, 2010 11:23 PM

Read only

0 Likes
3,385

> the TIF file comes from a transaction, so I cannot use any other report to print it..I will have to code it in the same program when I am fetchin the data.

And so, what is the problem with my proposition? I describe it in details, I guess you didn't understand it:

1) let's say your program runs in background

2) it reads the TIFF attachment and store it in a table of 1022 bytes

3) save it to a dataset (file on application server)

4) submit RSTXLDMC with parameters: that dataset name and any image name

5) call function READ_TEXT to read this image (id = BCOL (or BMON if TIFF was monochrome), and object = GRAPHICS)

6) print this image (to a spool) using PRINT_TEXT

That's all

Read only

0 Likes
3,385

BTW thanks for the info of RSPO0023. I agree it works in preview, but did you succeed in printing it? I don't understand how it could work except if you have a printer which accepts PDF format. Usually, printers accept only PCL or PS languages (+ proprinter and other minor languages), but SAP is not able to convert PDF to PCL or PS, as far as I know.

Read only

0 Likes
3,385

For program RSPO0023, it will generate the application server in pcl or ps.

bt the function module ADS* will attach it to the spool.

Read only

0 Likes
3,385

Thanks for the informations. Is there any specific doc type that I need to use for saving the file on application server?

I will check the code and let you knw if it works.

Thanks,

Abhay

Edited by: abhay chauhan on Apr 1, 2010 12:37 AM

Read only

0 Likes
3,385

Hi Sandra,

I tried the step you told me..

but I am getting the error from program RSTXLDMC as

E:\usr\sap\CDC\SYS\global/test.pcl

Error when Loading File

Read only

0 Likes
3,385

why is it a PCL file? You should upload a TIF file!

Moreover your path looks like a mix of windows and unix/linux, is it correct?

Read only

0 Likes
3,385

Hi Sandra,

the file is been generated automatically....(copy RSPO0023). I will try using a path from application server and will let you how it works...

Thanks for your patience Sandra

Read only

0 Likes
3,385

The problem, Abhay, is not a question of patience, but to understand what you are doing, because you dont' explain clearly.

This happens again:

- You told me that RSPO0023 is to store PDF into spool, and you use the result for TIFF !? (I'd like to understand what you are doing)

- Save the TIFF into a file (in presentation server if you run RSTXLDMC interactively, otherwise in application server if background), then run RSTXLDMC

If I say something that is not clear, please tell me exactly what !

Read only

0 Likes
3,385

Hi Sandra,

Below is the requirement from Client:

1. PDF and Tif files will be attached to order (transaction CRMD_ORDER).

2. I have to pick the PDF and TIF attachments mentioned above using a batch report.

3. Then this batch report will create a spool for the PDF file and TIF file attachements.

4. Then the spool will be picked by another program and print them together in night.

I hope it is clear now?

Things I have done:

1. Created report ZPDF_TIF which is copy of RSPO0023.

1. Used the report ZPDF_TIF to pick up the PDF and TIF file in binary format from the order (transaction CRMD_ORDER).

2. Able to Convert PDF to spool.

I hve problem for:

1. I want to use the program ZPDF_TIF to work for both PDF and TIF file.

2. I have the TIF data in Binary (1022) into internal table picked using the report ZPDF_TIF.

2. I want to convert TIF to spool which is problem child for me as of now.

I hope the details are clear now.

Read only

0 Likes
3,385

Thanks, I understand the requirement (in fact, it was already clear).

Could you tell me why you attempt to load a PCL file with RSTXLDMC, as you should upload the TIFF file.

Read only

0 Likes
3,385

Hi Sandra,

I tried updating the Tif file...I am able to get the data in apllication server. I will try to upload it and let you knw if I face any problms.

Thanks for you help

Read only

OttoGold
Active Contributor
0 Likes
3,385

Then you should ask how to load the file. The file is probably stored in GOS? CS? DMS? Ask somebody who can tell you how your source picture is stored and then you will understand how to load it. Otto

Read only

OttoGold
Active Contributor
0 Likes
3,385

By the way... I wonder why did you post 39 posts and have never got a single SDN point. That means you are a lurker right? We don´t like these guys around. Maybe you would consider helping some people in return? Otto

Read only

Former Member
0 Likes
3,385

Hi Otto,

TO reply to you question. I have forgotten the password for my SDN ID which I normally use.

So I am using this ID, thats the reason you see no points in my name.

Read only

OttoGold
Active Contributor
0 Likes
3,385

Sandra, I admire your patience!!:)))

Is there a way I can reach you through email or anything? I can understand you don´t want to publicize anything...

Regards Otto

Read only

0 Likes
3,385

lol yep rather difficult to understand what's going on here

I temporary show my e-mail in my profile

Read only

Former Member
0 Likes
3,385

The conversion is still imcomplete

Read only

Former Member
0 Likes
3,385

Hi Abhay,

I also have the same requirement of passing the PDF binary data to printer. I am using the reference from report RSPO0023 as suggested by you. It is creating two files, one of type .pcl & one of type .pdf

Now the issue is when i pass the printer, whose ADSTYPE is 'PDF1', it doesnt create the .pcl file in the directory and therefore doesnt create the pdf as well.

But when i pass the printer with ADSTYPE 'PCL' , it creates both the .pcl & .pdf file in the directory , but doesnt print it. Then i have to go to spool and change the printer of the type 'PDF' and got it printed.

Please let me know what process are you following and how you are printing.

Please advice.

Thanks for the help in advance.

Regards

Manish Mittal