How to convert JPG image to BMP ? (Printing jpg images in smartforms from content server)
Hi,
We have employee photos(JPG Format) stored in Content server. And now we want to print the photos in smartforms. For this I had written the below code to read the photo from content server in binary format as below.
REPORT ZTEST1.
PARAMETERS P_PERNR TYPE PERNR_D.
DATA: PS_CONNECT_INFO TYPE TOAV0,
IT_BINARY TYPE TABLE OF SDOKCNTBIN.
CALL FUNCTION 'HR_IMAGE_EXISTS'
EXPORTING
P_PERNR = P_PERNR
* P_TCLAS = 'A'
* P_BEGDA = '18000101'
* P_ENDDA = '99991231'
IMPORTING
* P_EXISTS =
P_CONNECT_INFO = PS_CONNECT_INFO
* EXCEPTIONS
* ERROR_CONNECTIONTABLE = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
IF PS_CONNECT_INFO IS NOT INITIAL.
CALL FUNCTION 'SCMS_DOC_READ'
EXPORTING
STOR_CAT = SPACE
CREP_ID = PS_CONNECT_INFO-ARCHIV_ID
DOC_ID = PS_CONNECT_INFO-ARC_DOC_ID
* PHIO_ID =
* SIGNATURE = 'X'
* SECURITY = ' '
* NO_CACHE = ' '
* RAW_MODE = ' '
* IMPORTING
* FROM_CACHE =
* CREA_TIME =
* CREA_DATE =
* CHNG_TIME =
* CHNG_DATE =
* STATUS =
* DOC_PROT =
TABLES
* ACCESS_INFO =
* CONTENT_TXT =
CONTENT_BIN = IT_BINARY
* EXCEPTIONS
* BAD_STORAGE_TYPE = 1
* BAD_REQUEST = 2
* UNAUTHORIZED = 3
* COMP_NOT_FOUND = 4
* NOT_FOUND = 5
* FORBIDDEN = 6
* CONFLICT = 7
* INTERNAL_SERVER_ERROR = 8
* ERROR_HTTP = 9
* ERROR_SIGNATURE = 10
* ERROR_CONFIG = 11
* ERROR_FORMAT = 12
* ERROR_PARAMETER = 13
* ERROR = 14
* OTHERS = 15
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF
Now the issue is I want to convert that binary data to bitmap image and upload the same in to SE78. So that I can use that BMP image from SE78 in my smartforms.
I had used the class CL_IGS_IMAGE_CONVERTER to covert the image into bmp but it is giving error that error in IMAGE DATA CORRUPT & Error Code 3. The conversion code used is as below.
******* CONVERT THE JPG IMAGE INTO BMP PHOTO. **********
DATA: L_IGS_IMGCONV TYPE REF TO CL_IGS_IMAGE_CONVERTER,
L_IMG_BLOB TYPE W3MIMETABTYPE,
L_IMG_SIZE TYPE W3PARAM-CONT_LEN,
L_IMG_TYPE TYPE W3PARAM-CONT_TYPE,
L_IMG_SUBTYPE TYPE W3PARAM-CONT_TYPE,
L_IMG_URL TYPE W3URL,
L_ERR_CODE TYPE I,
L_ERR_TEXT TYPE STRING,
P_DEST TYPE CHAR32 VALUE 'IGS_RFC_DEST'.
DATA: G_IMG_BLOB TYPE W3MIMETABTYPE,
G_IMG_TYPE TYPE W3PARAM-CONT_TYPE,
G_IMG_SIZE TYPE W3PARAM-CONT_LEN.
IF NOT IT_BINARY[] IS INITIAL.
G_IMG_BLOB[] = IT_BINARY.
CREATE OBJECT L_IGS_IMGCONV
EXPORTING
DESTINATION = P_DEST.
CALL METHOD L_IGS_IMGCONV->SET_IMAGE
EXPORTING
BLOB = G_IMG_BLOB
BLOB_SIZE = G_IMG_SIZE.
CASE PS_CONNECT_INFO-RESERVE.
WHEN 'TIF'.
G_IMG_TYPE = 'image/tiff'.
WHEN 'JPG'.
G_IMG_TYPE = 'image/jpeg'.
WHEN 'PNG'.
G_IMG_TYPE = 'image/png'.
WHEN 'GIF'.
G_IMG_TYPE = 'image/gif'.
WHEN 'BMP'.
G_IMG_TYPE = 'image/x-ms-bmp'.
WHEN OTHERS.
EXIT.
ENDCASE.
L_IGS_IMGCONV->INPUT = G_IMG_TYPE.
L_IGS_IMGCONV->OUTPUT = 'image/x-ms-bmp'.
* PERFORM GET_SIZE USING PICTURE_CONTAINER
* L_IGS_IMGCONV->WIDTH
* L_IGS_IMGCONV->HEIGHT.
CALL METHOD L_IGS_IMGCONV->EXECUTE
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC IS INITIAL.
CALL METHOD L_IGS_IMGCONV->GET_IMAGE
IMPORTING
BLOB = L_IMG_BLOB
BLOB_SIZE = L_IMG_SIZE
BLOB_TYPE = L_IMG_TYPE.
SPLIT L_IMG_TYPE AT '/' INTO L_IMG_TYPE L_IMG_SUBTYPE.
ELSE.
CALL METHOD L_IGS_IMGCONV->GET_ERROR
IMPORTING
NUMBER = L_ERR_CODE
MESSAGE = L_ERR_TEXT.
BREAK-POINT.
ENDIF.
ENDIF.
ENDIF.
So could you please some one help me how to convert JPEG Photo to BMP programatically.
Regards,
Mayur.
johnandersonpalmdesert wrote:
My printer is requesting a vector file.
Jpeg File format does not support vectors. Photoshop has limited vector support and tools. Photoshop can not save vector file formats like SVG. What File type does your printer want?
Adobe Illustrator is Adobe vector application.
Similar Messages
-
Hi does anybody know how to tile print an image On an iMac ? So blow an image up and print that image on several pieces of paper . ?
Appreciate any help Thank you LauraThere's an app for that...
https://www.macupdate.com/app/mac/45688/tile-photos-fx
Also see...
http://www.blockposters.com -
How to output 3D Surface Graph as image file (bmp or jpg or png)
I'd like to output a graph from the 3D surface.vi module as a regular
image (like a JPG or BMP). At this time, I'm going through an
awkward process of taking a screen cap, then isolating the image with
photoshop (painful and time consuming).
Any idea or input would be appreciated.RIght-click on the graph and "create...invoke node". On the diagram, select method "get image".
Save the output of "image data" as JPG, BMP, or PNG using the tools from the "Graphics Formats" palette.
(The code shows would get a 24bit PNG image)
See how far you get. Good luck!
Message Edited by altenbach on 08-12-2005 02:50 PM
Message Edited by altenbach on 08-12-2005 02:51 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
GetImage.png 3 KB -
How to convert a Graphics object into a JPG image?
I have this simple question about how to make a Graphics object into a JPG file...
I just need the names of the classes or the packages ... I'll figure out the rest of the details...
Thanks...Anyway this might come in handy
JPEGUtils.java
============
* Created on Jun 22, 2005 by @author Tom Jacobs
package tjacobs.jpeg;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.imageio.ImageIO;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageDecoder;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
* Utilities for saving JPEGs and GIFs
public class JPEGUtils {
private JPEGUtils() {
super();
public static void saveJPEG(BufferedImage thumbImage, File file, double compression) throws IOException {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
saveJPEG(thumbImage, out, compression);
out.flush();
out.close();
public static void saveJPEG(BufferedImage thumbImage, OutputStream out, double compression) throws IOException {
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
compression = Math.max(0, Math.min(compression, 100));
param.setQuality((float)compression / 100.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(thumbImage);
public static BufferedImage getJPEG(InputStream in) throws IOException {
try {
JPEGImageDecoder decode = JPEGCodec.createJPEGDecoder(in);
BufferedImage im = decode.decodeAsBufferedImage();
return im;
} finally {
in.close();
public static BufferedImage getJPEG(File f) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(f));
return getJPEG(in);
public static void saveGif(RenderedImage image, File f) throws IOException {
saveGif(image, new FileOutputStream(f));
public static void saveGif(RenderedImage image, OutputStream out) throws IOException {
// Last time I checked, the J2SE 1.4.2 shipped with readers for gif, jpeg and png, but writers only for jpeg and png. If you haven't downloaded the whole JAI, and you want a writer for gif (as well as readers and writers for several other formats) download:
// http://java.sun.com/products/java-media/jai/downloads/download-iio.html
ImageIO.write(image, "gif", out);
public static void main(String[] args) {
// TODO Auto-generated method stub
} -
Random image order when printing multiple images on one page.
If I filter images within a browser (lets say * stars or better) and then select print, and set up multiple different images per sheet to print, then the order of the images on the pages is seemingly random, certainly not the oder within the browser. If I print 4 images per sheet it might start with the 3rd image, then the 9th, then the 2nd, then the 12th. If I don't filter the images and select all the images in the browser it seems to be OK.
Any ideas?Cid,
This is a nice application that will let you do just that http://www.stuntsoftware.com/PhotoBooth/
You might also like to take a look at this http://www.econtechnologies.com/site/Pages/PortraitsPrints/pnpoverview.html -
Retrieving Invoice images from Content Server
Background
My problem is, that I need to retrieve images from the Content Server and save them on a local drive with a path provided by the user. Metadata that is available for the image includes Object ID and the URL to the image on the server.
However, the Object ID is not valid for DMS, so the Function Groups for this are invalid. The cl_gui_* function groups have several usable Function Modules, but the URL link provided for the image is something like this:
http://xxxxxx.xxxxxx.com:XXXX/ContentServer/ContentServer.dll?get&pVersion=0046&contRep=Z2&docId=123AB1C123D12E12345.... etc.
What makes the cl_gui FM unable to work, is the :, ?, % and & characters in the string - which makes the FMs look at the URL as invalid.
I have also tried more or less the entire content of FM in the SCMS_* Function Group (containing FMs for the Content Server), but to no avail.
Question
So, now to my question: Is there any way to translate the URL provided so the cl_gui FMs can understand it? Or, should I go the other way around and fetch the Invoice Image using the provided Object ID?
All needed at my program to finish off, is a method to retrieve the given images and save them to a local path.
I hope the Guru's of the SDN will be able to help me here
regards
Anders Haugbølle
Edited by: Anders Haugbølle on Feb 4, 2009 12:53 PMMoving this thread from ERP MM to [Enterprise Resource Planning (ERP) |Enterprise Resource Planning (SAP ERP);
-
How to extract original file contents from content server
Hi,
1)How can we extract original file contents from the content server (which in our case is SAP database itself)...
2)What exactly is PHIO_ID and LOIO_ID?
Thanks and regards,
Santhosh Kumar U.PHi,
concerning your first question - please decribe, what you are trying to do.
Question 2:
LOIO_ID is the ID of the Logical Information Object. A LOIO is not a real document, but kind of a virtual document, a containerfor all "real" versions of a document. A PHIO (physical info object) is a real document.
you can read more at http://sercie.sap.com/Kpro
Kind regards,
Carl -
Read and print PDF from content server
Hi,
I have a PDF document stored in the content server, I have a requirement to schedule a job to read the documents and print them. Is it possible to read and print them directly ?
Thanks in advanceGo Thru these links.
Hope it will help you.
http://help.sap.com/saphelp_nw04/helpdata/en/c8/4adf7ba13c4ac1b4600d4df15f8b84/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/37/47a2be350c4ac8afe36b691203971f/frameset.htm
Reward if help. -
Printing of files from content server
Hello Everyone,
I would like to know if there is any way (like Function module) to print archived documents stored on content server?
Thanks in Advance.
Priyanka Gupta.hi poonam,
Is your original files are strored to content server ?
if yes , then ask to your basis team wheather they have taken the back up or not.
it's purely basis team work
ragards,
nitin
award point if useful -
How to make a CD Jacket and print out Song order directly from playlist
I was wondering if there was a way to make a CD Jacket with artwork from songs selected and also how to make a same size sheet to fit in the CD holder that has the exact song order and titles by printing out directly from your playlist.
I am not sure I worded that right but hopefully you will know what I mean.
Any help would be greatly appreciated.
ThanksThere is a pretty basic CD insert that you can print from iTunes, if I remember correctly it will print whatever artwork is attached to the first song in the playlist.
Open iTunes, highlight the playlist in question, go to File>Print and choose the CD Jewel Caser Insert radio button. Theres also a little Theme menu.
However you can get much more flexibility from a dedicated CD Cover program. I use Cover Star, it's inexpensive and makes good quality CD booklets, back covers and disc overlays. It will generated artwork for you or you can drag your own picture files to it. You can download a trial version from this link: http://autostylus.com/coverstar.html. It's fully functional apart from printing so you can play around with it and save the inserts until you decide if it's for you. Purchasing a license then releases the final function and anything you saved previously can be printed off. -
How to get documents from content server on web pages
Hello,
I want to get the documents from the ECM(UCM server) of same document type and also want their metadata fields to displayed on adf application.
How can i fetch these documents?Hi,
You mean Data transfer between two components..
To pass the value from one component to other component, you can use used component scenario.
For example let use assume we have two comp ..
Comp A,
Comp B.
now we need to pass the value from Comp A to Comp B.
Then declare the Comp A as used component in Comp B.
Now then you can create a node in the comp A component controller and check the interface check box there then the
node and the attribute will be present in the interface controller also .
and this interface controller context you can access in the component and map it to view there and display it.
Webdynpro Application Integration..
http://wiki.sdn.sap.com/wiki/display/WDABAP/WebdynproApplicationsIntegration
cheers,
Kris. -
How to Upload Smartforms from Application Server
Hi Guys,
I have to upload the SMARTFORMS in to the System.That can be done as follows:
1- Tcode - Smartforms
2- Utilities -> Upload form
3- Give form Name
4- Give path of Form on presentation server and upload.
But I have to give the path of Form from the Application Server. As i have all the forms to be uploaed in New system on the Application Server.
I will be writing the program to program to read XML file(smartform) from application server to internal table and then upload it in the System.
Please let me know if it is possible to upload Smartforms from Application Server?
Regards
SandeepVinod,
Thanks for the reply.
But Actually I want to Automate this process of Uploading the Smartforms.
So I want to directly upload it from Application server.
As it is not possible to upload the Smartforms from Presentation Server Automatically.
In this human Intervention will be required. -
How to covert a PSD photo to a JPG photo?
How to convert a PSD photo to a JPG photo?
yes, or you can use : STR + alt + shift + s = save as web images.
-
How to convert .tod extension files
how to convert .tod extension files for use in final cut pro
DLewis from rocklin wrote:
Unfortunately you can not convert .TOD file extensions for Final Cut Pro to use. The .TOD is something proprietary that JVC used a few years ago. The best thing to use is MPEG Streamclip and convert the .TOD files to a Quicktime file using the AIC codec from the convert settings in the MPEG Streamclip program.
Good advice, except for the AIC codec part. The native codec for FCP X is ProRes. Use ProRes 422.
(AIC was used by FCE and is still used by iMovie; while you can use it with FCP X, it is not the preferred codec). -
I have all my images stored in Aperture. When I try to print (output/print image), I get a nice print dialogue box. I do not seem to have the option to print multiple images on a single page. With XP, there was a 'print wizard' that would allow me to choose a paper size, and then fill that paper with images (ex. 3 x 4x6 on a 8x10). I would also use MS Digital Imaging Suite to print multiple images on a single paper.
I am somewhat new to the Mac experience, maybe I'm not looking in the right place.
Please help me with thisWhile I am not familiar with Aperture, the print dialog box for Preview should be quite similar. If you have the full options showing, by clicking on the expansion triangle near the top right, the option to print N-up will be at the bottom of the dialog box. In order to do that, you need to have more than one photo selected for printing., of course. Then you should be able to adjust the layout and size of your photos.
Maybe you are looking for
-
Time behind by 1 hour - Nokia Messaging
Hello all, I'm have two accounts (gmail + work email) that both have incorrect times for both inbox AND sent folder. I send an email from my phone and it shows the time as 1 hour behind but shows up in my inbox on my computer as the correct time. W
-
Connecting a 144hz monitor to 15'' retina macbook pro?
Hi, I recently bought the benq xl2411z 24'' monitor which has the capacity to run in 140hz as opposed to 60hz. I have been told that you cannot run 144hz in OSX but you can do it in Windows (bootcamp), Right now the screen is connected via HDMI; howe
-
Print Preview Opens "Save File" Dialog
A week or so ago (possibly related to my install of Snow Leopard, not quite sure), when I hit Preview in a Print dialog, I'm taken to a "Save" dialog before Preview opens with the file for preview. Before it would save it to a temp location somewhere
-
Digital Signature & Encryption for PDF
Irrelevant Links. Please provide answer specific to question asked. Edited by: Bhavesh Kantilal on Feb 27, 2009 3:56 AM
-
Photo goes black when editing it
Hi, I acknowledge this is a fairly common matter, but let me try to share my on experience. For the past few days, I have been importing photos in my iPhoto library either from .jpg docs or brand new ones from my digital camera. Each time I try to ed