Creating PDF file in XI using iText

Hi all,
I am trying to create a PDF file in XI using itext. The PDF file is getting created in my target ftp server but I am not able to open the PDF. It is throwing the below error while opening.
"Adobe Reader could not open the sample.pdf because it is either not a supported file or because the file has been damaged(for example,it was sent as an e mail attachment and wasn't correctly decoded)"
I am using the below code in my udf
String filename= "Sample.pdf";
try
Document document= new Document();
PdfWriter pdfwriter=PdfWriter.getInstance(document,new FileOutputStream(filename));
document.open();
document.add(new Paragraph("Hi How are you?"));
document.close();
DynamicConfiguration conf = (DynamicConfiguration) container
       .getTransformationParameters()
       .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
conf.put(key,filename);
catch(Exception e)
return "";
Kindly let me know if you have any information on this.
With Regards
jaisu.
Edited by: jaisu118 on Feb 12, 2010 8:04 AM

hi,
I had used custom adapter module for creating the PDF file.
you have to use java mapping if you want to create pdf without using adapter module.
You need to import iText library available at http://itextpdf.com/.
How to use external jar files ??
External Jar files in UDF
code may look like this:
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
//1. AbstractTransformation class is imported.
// The associated jar file is: com.sap.xpi.ib.mapping.lib.jar
import com.sap.aii.mapping.api.AbstractTransformation;
import  com.sap.aii.mapping.api.DynamicConfiguration;
import com.sap.aii.mapping.api.DynamicConfigurationKey;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
import com.sap.aii.mapping.api.InputHeader;
public class xyz extends AbstractTransformation {
public void transform(TransformationInput inp, TransformationOutput out) throws StreamTransformationException {
     getTrace().addInfo("JAVA Mapping Called");
                     InputStream inData = inp.getInputPayload().getInputStream();
                    // pdf conversion code
                    out.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
check http://help.sap.com/javadocs/pi/SP3/xpi/index.html for java mapping api.
Thanks.

Similar Messages

  • Can we create pdf files from oracle using UTL FILE

    i have sample code---
    create or replace procedure UTLTEST as
    f1 utl_file.file_type;
    begin
    -- Open a file in write mode
    f1 := utl_file.fopen('UTL_FILE_DIR1','NEWFILE.pdf','W');
    -- Write a line to a file
    utl_file.put_line(f1,'1. This is a test of UTL_FILE packages');
    utl_file.put_line(f1,'2. Oracle has added a new procedures in the package');
    utl_file.put_line(f1,'3. We will see all the procedure one by one');
    -- Close a file
    utl_file.fclose(f1);
    end;
    file is created but when i opened it ,it gives me error that file can not open
    is there any way to do it?

    Hi!
    you can see the following link ---
    http://forums.oracle.com/forums/search.jspa?threadID=&q=how+to+create+pdf+from+pl+sql&objID=f75&dateRange=all&userID=&numResults=15 .
    And also -- http://www.plpdf.com/ .
    Hope this will help u a bit.
    Regards.
    Satyaki De.

  • Firefox 8... Unable to create PDF files from screen using Adobe Acrobat X...what happened?

    I'm no longer able to use the Adobe feature to create PDF's from the Firefox screen.
    Unable to find any information on correcting this issue.
    I would not have upgraded to Firefox 8 if I knew the loss of the Adobe PDF feature would be effected.
    I reinstalled the standard Adobe Acrobat X with no results...
    What happened?

    Firefox Support - I even create a Firefox account just to agree with [email protected] I appreciate the word "Thank you for being awesome!" when I registered the account and I certainly do hope you all guys being awesome to. Please do something with all this Firefox update - add-on plugin no longer support thingy. Firefox still awesome, it's just that I can't do much wit it anymore like I used to do. Ohh yayy theres Safari..

  • Display Pdf report on Frame using iText library

    Hi,
    I am able to generate pdf reports using iText library. but i want to display these generated pdf into frame. can u please help for this.
    this is web based application. Through servlet i am generating the pdf report using iText library. I am waiting for your reply ....

    Does this PDF file absolutely need to be displayed within a JFrame? You say you are generating this document on the server side, so if this is a web application, what I might do is place the generated document on directory accessible through http, then on the client browser side open a pop-up browser window with a URL to the PDF document.
    Most browsers have a PDF viewer plugin of some kind.
    If this is a swing application then you can do the same thing but instead of redirecting the browser to the PDF file you can use iText to convert the PDF document to an RTF document and use an RTFEditorKit within a JEditorPane to display the same document in RTF format.

  • Create pdf-files trough prn-files in a windows service applicatio

    Hi,
    i have also the problem to create pdf-files from .prn-files.
    in normall windows aplication we ar using the distiller but we would like to create the pdf's by running our application as windows service.
    in this case it is not possible to use the distiller. As i understood we have to use the acrobat PDG Generator as a server application.
    My question is, is it possible to make function calls to the service where i pass trough the prn-file and the according pdf-file is than created immediately.
    This is important because the created pdf-file ist than used for different purposes.

    Hi psprenge,
    As per your request of refund,
    I have cancelled your subscription, and set the refund process in motion.
    Your refund no.is 66193634.
    Regards,
    Florence

  • FAQ: Creating PDF Files from FrameMaker v.6 & earlier Documents -- Why you should not use "save as PDF"! -- Windows & MacOS Only!

    An issue that has come up over and over again on several FrameMaker and Acrobat/PDF email lists as well on the corresponding Adobe User-to-User forums is that of creation of PDF files. FrameMaker 5.5.6 and 6 have what looks like a convenient feature that is supposed to allow you to create PDF files via simply saving the document as a PDF file. I have gone on record as advising end-users not to use this approach for reliable creation of PDF files from FrameMaker documents under Windows and MacOS with FrameMaker 6 and earlier. Why do I most vociferously offer this advice and why doesn't the problem get fixed? And how SHOULD you create PDF files from FrameMaker?
    GOOD NEWS
    I will start with the good news. The "next major version" of FrameMaker will indeed have "save as PDF" re-implemented in a manner that it will be as reliable as printing to the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS. I am personally working with the FrameMaker development organization to make sure this really happens and is fully and properly tested and debugged! Furthermore, this next major revision of FrameMaker, unlike FrameMaker 6, will come with a Distiller installer that will properly install the "Acrobat Distiller" printer instance under Windows and the "Create Adobe PDF" desktop printer on the Macintosh (of course assuring that the latest PostScript driver is also automatically and correctly installed).
    DON'T USE "SAVE AS PDF"
    But what's wrong with "save as PDF" as currently implemented?
    The following are some of the SYMPTOMS reported over the last few years by FrameMaker users that were traced back to use of "save as PDF" under FrameMaker:
    (1) No PDF file is produced at all, possibly with a log file showing not-readily apparent PostScript errors during distillation.
    (2) The PDF file "loses" color in images. All or some images (raster, bitmap images, NOT vector artwork) appear in the PDF file in grayscale.
    (3) The resultant PDF file is on the wrong paper size, i.e., the document's logical page size does not match the output page size as seen in Acrobat or Acrobat Reader.
    (4) Some or all text in the resultant PDF file is blotchy looking or overly bold.
    (5) Some or all text in the resultant PDF file cannot be searched or indexed.
    (6) Some or all text in the resultant PDF file appears in Courier or in some other substitution font.
    (7) Interword or intercharacter spacing is a bit irregular in the resultant PDF file.
    (8) Content is missing in the margin areas of the page, i.e. you cannot do full-page bleeds.
    (9) Some or all page content is missing (other than margin areas).
    (10) Relatively inefficient PDF is generated.
    If this list by itself isn't enough for you, please note that some of these symptoms are very subtle and may escape attention when the PDF is first viewed or printed. Oftimes, it is when one attempts to manipulate the PDF file in Acrobat or repurpose its content or even view or print on a system other than the one on which the PDF file was created, that some of these symptoms make themselves obnoxiously visible (or invisible in some cases I won't make any bad jokes here about graphic examples!).
    It is important to understand that FrameMaker does NOT have its own native ability to create PDF. Any and all PDF created from FrameMaker documents is actually done by creating PostScript via the PostScript driver and having the Acrobat Distiller create PDF from that PostScript. The only exception to this is creation of PDF via the Acrobat PDFWriter driver, which is likewise not recommended (see below).
    In order for "save as PDF" to work correctly, FrameMaker must do the equivalent of calling Printer Setup and selecting the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS followed by setting the driver's options correctly for paper size, page range, etc., followed by sending the proper commands to the driver to create PostScript.
    Contrary to popular belief, PostScript as generated by the Windows and MacOS PostScript drivers is VERY device-dependent. The information in the PPD file associated with a printer driver instance provides critical parameters for generation of PostScript including:
    Whether the printer supports color (Acrobat Distiller does)
    What PostScript language level is supported (Acrobat Distiller 4.x and Acrobat Distiller 5.x are both PostScript language level 3)
    Whether native TrueType support is available (Acrobat supports native TrueType as Type 42 fonts)
    Available binary communications (Acrobat Distiller supports pure binary and ASCII, but NOT TCP, TBCP, or PJL)
    Resident fonts (Acrobat Distiller doesn't really have resident fonts)
    Available paper sizes and custom paper size availability (Acrobat Distiller supports a wide range of predefined sizes and continually variable "custom" sizes up to 200" by 200")
    Margins / printable areas (for PDF and the Acrobat Distiller, there are no margins in which imaging is not permitted)
    Device resolution (Acrobat Distiller can be set to any value from 72 to 4000 dpi; as a convenience, the Acrobat Distiller PPD provides a series of values for use by the driver. Since there is no inherent "resolution" of a PDF file, this parameter is used only for purposes of allowing PostScript programs that query for such a value to be satisfied and for the driver to be able to communicate this value to the operating system and/or application as required.)
    Paper handling (totally irrelevant to Acrobat Distiller if input or output tray selection via "setpagedevice" is found in the PostScript stream, it is ignored by Acrobat Distiller)
    Thus, if the wrong printer driver instance is selected (i.e., it isn't associated with the Acrobat Distiller PPD file) or that driver instance is improperly configured, improper PostScript will result and one or more of the symptoms described above can occur. As currently implemented, FrameMaker depending upon version will not necessarily choose the correct printer driver instance and/or correctly parameterize the print job via driver setup options. In fact, FrameMaker 5,5,6 might even try to generate PDF via calling a PCL driver, FAX driver, or even a non-PostScript inkjet printer!
    DON'T USE PDFWRITER
    The Acrobat PDFWriter is a relic of older versions of Acrobat. In fact, it is no longer installed by default in the "easy install" or the "typical install" of Acrobat 5. It hasn't really be updated since Acrobat 3 and only supports PDF 1.2. It is a GDI (Windows) / QuickDraw (MacOS) driver that directly generates PDF without any intermediary PostScript. Since it is not a PostScript printer driver, applications cannot pass through EPS graphics and/or PDFMark information (used for a wide variety of purposes by FrameMaker). For EPS graphics, most applications will send the low resolution TIFF (or PICT) EPS header in lieu of the PostScript text, if they send anything at all, to the driver. Forget about links, structure, or any other PDF "goodies." Expect that PDFWriter will fully "bite the dust" in the next major version of Acrobat.
    SO HOW DO I GENERATE PDF FILES FROM FRAMEMAKER 6 & EARLIER?
    The ONLY method that is really reliable for producing PDF files with FrameMaker 6 and earlier requires the generation of PostScript via a properly set printer driver instance associated with the Acrobat Distiller PPD and distillation of the resultant PostScript by Acrobat Distiller.
    Case 1: FrameMaker and the Full Acrobat 4.05 or Acrobat 5.0x Products
    PDF file from a "chapter" -- print directly to the Acrobat Distiller printer instance (Windows) or the Create Adobe PDF desktop printer (MacOS) already installed by Acrobat. If you check the "Acrobat data" option, then make sure to UNcheck the "print to file" option that gets set at the same time. As a result, the driver will automatically send the generated PostScript to the Distiller for you and delete the intermediate PostScript when done.
    PDF file from a "book" -- print directly to the Acrobat Distiller printer instance with the "print to file" option checked (Windows) or the Virtual Printer desktop printer (MacOS) associated with the Distiller PPD (see details below under Case 2/MacOS). You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    In both the above sub-cases, the default driver options generally will be OK, but check on paper size and communication protocol (Use pure binary, not ASCII, for optimal performance AND no CTRL-D characters under Windows. Make sure to set Level 3 only and Binary under MacOS. Font inclusion "All" for Acrobat 4.05 and "None" for Acrobat 5 under MacOS.). With Acrobat 4.05, make sure you preset the Distiller to use the joboptions you want. With Acrobat 5, you can set this on a job-by-job basis via the driver printer setup interface (or print dialog on MacOS).
    Case 2: FrameMaker 6 and the Bundled Acrobat 4.05 Distiller
    Windows -- Create a new printer driver instance using the latest version of the Adobe Universal PostScript Driver Installer, downloadable from Adobe's web site AND the Acrobat Distiller PPD file (located in the XTRAS subdirectory of the Distiller directory). This driver instance should be set to print to the local port named "FILE:". Name this driver instance as "Acrobat Distiller". The default driver options generally will be OK, but check on paper size and communication protocol (use pure binary, not ASCII, for optimal performance AND no CTRL-D characters). Make sure you preset the Distiller to use the joboptions you want. Print directly to this Acrobat Distiller printer instance. Make sure that the "print to file" option is checked. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    MacOS -- Install the latest version of AdobePS 8.7.x, downloadable from Adobe's web site. In FrameMaker, go to Page Setup and select the "Virtual Printer" and go to the "Virtual Printer" window pane. Select the Acrobat Distiller PPD file (located in the XTRAS subfolder of the Distiller folder). Print directly to the "Virtual Printer" (Make sure to set Level 3 only, Binary, and font inclusion "All".). Make sure you preset the Distiller to use the joboptions you want. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    Case 3: Acrobat 3
    Acrobat 3 is not officially supported for the latest OS versions and I personally would no longer recommend its use for generation of PDF files given that Acrobat 5.0.5 is the current version of Acrobat.
    - Dov

    You're asking a lot of ancient Acrobat to work with an Office that never existed when it was made. "Just updated my office suite" is a massive change, and Window 8 didn't exist at that time either...

  • Creating PDF files using file adapter

    Hi,
    Is it possible to create a pdf file using, File/FTP adapter? If yes can someone please suggest how to do it.
    Thanks,
    Phani

    Hi Phani,
    I would say pdf files are binary files with a specialized format.
    You can move pdf files through BPEL or ESB (i.e. file/ftp -> file/ftp), or from file to database BLOB and database to file, by importing the schema as opaque.
    However I doubt that file adapter can create PDF files from a plain-text xml file, i.e. as PDFCreator would.
    In a sense a pdf file is much like a jpg, mp3, or zip file, it can be passed through bpel but not created.
    In other words if you have a base64Binary element in xml, that you know is the complete bytes to a pdf, jpg, or other file, you can write it out as a file using the File adapter.
    Thanks
    Steve

  • No ability to create PDF Files using Acrobat 6.01_6.06 after installing Word 2010. (Windows XP)

    Since installing Word 2010 (upgrading from Word 2003) there are no visable PDF Icons nor ability to create PDF Files using Adobe Acrobat 6.06.  Operating system is Windows XP.  Browser is IE8.  Various attempts to bypass this situation have not been successful.  No problems had been experienced earlier using Acrobat 6.01 through 6.06 with Word 2003 and earlier Word versions during the passed 10 years or so.  Adobe's support is not responding to recognize mentioned situations, nor is there any a solution to fix the problem.  Low volume small businesses,with limited need to create PDF files, are being considerably burdened to substante a $200 investment to upgrade to Acrobat X, which may as well not be the solution.  It is appealed for Adobe Forums readers to share similar experiences with possible fixes at hand.  Responses will be greatly appreciated.  Thank you...

    Your response is greatly appreciated, Bernd...
    Unfortunately, those of us who milk software packages for eons such as
    Acrobat 6.06 Standard, a full version of Acrobat X is quoted to be $299
    with no ability to upgrade since 7.0 is the cutoff which remains to be
    only $139.
    It seems to me, Military personal, retired or just ole toots who did
    their think, would offer considerations such as Staples, Lowe's, and
    other big boxes offer.  Such is greed for some who do not consider 
    alternatives above their noses...
    Thank you,
    Skip

  • Does pages create pdf files or should i use adobe

    I need to have software that can read and create pdf files.  Does "pages" do this or should I use adobe?

    Welcome to Apple Support Communities
    Pages can create PDF files. To do it, create a document and, when you have finished it, choose the File menu (on the menu bar) > Export > PDF, so you will be able to read this document with any other PDF software.
    However, Pages can't read PDF files. To read PDF files, Mac OS X comes with Preview, so you don't need to get Adobe Reader to use PDF files on your Mac

  • Is there a way to create pdf files offline?

    Is there a way to create pdf files offline?

    Certainly, that's what Acrobat does. (But not Adobe's PDF Pack).
    Note that you will need an internet connection to install Acrobat and (so far as I know) every month to check your license. So it's no use if you will be off net.

  • I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway inst

    I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway installing PSE-10 or uninstalling it. If I send the  PDF file that has been automatically converted to a PSE-10 the person I send the file to can not open it because they do not have PSE-10. What can I do to stop PSE-10 from converting my PDF files? Don't tell me to upgrade PSE-10 I tried their on-line program and  it is too advance for a hobby photographer like myself and their Help Desk is impossible to reach.

    Hi,
    Can you please share the logs?
    You can use the Adobe  Log Collector tool (Log Collector Tool) and share the corresponding zip file @ [email protected]
    Thanks,
    Shikha

  • How to create PDF files in Arabic?

    Hello,
    I work with Adobe Acrobat 7.0 Professional to create PDF files, but I can not insert Arabic characters, could you help me please?
    Thank you!
    (see the attached file)

    You need to use Arabic edition of Adobe Acrobat Pro-ME, which allows you to type, view, copy paste Arabic within PDF. To create Arabic PDF you could use a program like Adobe InDesign CS4-ME, and export to PDF in one step! Once the Arabic PDF is created, you can share with anyone, and they can open, view Arabic PDF. If you create PDF correctly, they can type Arabic within the PDF using a free Acrobat ME Reader. Many many options, see http://www.fontworld.com/me/acrobatme.html

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • Unable to create PDF files from any application in any Acrobat version

    Hello, I am hoping someone can help me find a solution to a problem I am having creating PDF files.
    I have searched the Internet for a solution to this problem and can't find any information that helps me.
    I am running OSX 10.8.5 on a 2.5 GHZ Intel i5 Mac Laptop
    I cannot create PDFs from any program, Quark, Word, ect.
    When I try to print to the PDF printer, the printer pauses when it tries to open the Distiller. When I click resume, it pauses itself again.
    I have tried to save the document and create the PDF from within the distiller itself and get this error log:
    %%[ Error: undefined; OffendingCommand: MMXPR3 ]%%
    %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
    %%[ Warning: PostScript error. No PDF file produced. ] %%
    I was originally using Acrobat 8, But I installed the trial version of Acrobat 11 and it has the same problem.
    The problem seems to be something to do with the distiller. I have a lot of Adobe software so I am trying to avoid a clean/re-install of Adobe software but will do it as a last resort.
    Thanks in advance for any suggestions.

    Hi,
    Besides pamma has suggested, here are similar issues, you can take a look at:
    http://unsolicitedbutoffered.blogspot.com/2014/01/quick-fix-volume-syntax-error-when.html
    http://crowdsupport.telstra.com.au/t5/T-Suite-Applications/There-was-an-error-opening-this-document-The-filename-directory/td-p/197425
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

  • Adobe v9 on W7 and office 2007. cannot create PDF from MS word using Adobe. But can from Excel, PPT

    Adobe v9 on W7 and office 2007. cannot create PDF from MS word using Adobe. But can from Excel, PPT and other MS office apps. Reinslalled Adobe, updated Office, and Adobe no help! Also I can create a pdf from the MS Word and it is using the Adobe 9. So one would think that's good. No it isn't when you need to combine different files to one big PDF document. Any suggetions? Thank you

    Yes, I’m saying that I can in WORD use “Save As ADOBE pdf” but cannot in ADOBE create a pdf file from a WORD (.doc or .docx) document. While I can from other MS Office apps like Excel and PowerPoint.
    I understand I can use “work around” and save doc in WORD as pdf then compile all files needed (xml, ppt, pdf) in the ADOBE v9. to one big pdf document. But that is not the point of this post.  
    Jarda @ PC+NET Solutions
    Mobile 613-532-7023
    Office  613-385-1268
    <http://www.pcplusnet.net/> www.pcplusnet.net

Maybe you are looking for

  • How to install 10.5 if erased HDD with 10.4?

    I wanted to install 10.4 fresh so I erased the HDD with a program I use on my PC all the time to do fresh installs of XP (formats the drive). I stupidly thought the 10.4 disk that came with my mac was a full install. I soon found out that wasn't true

  • How to delete a custom columns from a content-type in Sharepoint Client object model

    I have a windows interface where I create a content-type and then create a column and adds that column to the content-type. //availableCT is my content-type where the column is present. //get all available fields within this content-type FieldCollect

  • How can I decouple the pagination for a global region?

    I was having a delightful time using a common region defined on a global page when I determined that pagination setting was begin carried from one page to the next.  Arghhhh!  So for example, if I have paged to the second set (page) of rows (11-20) o

  • OPI in a SOA Architecture

    As we know, OPI works under simple http request/response model. In our proyect we need to focus the architecture to SOA. The question is. Is possible to enable the OPI interfaces under the SOA model (Web Services interchange under WSDL) in a SRM 4.0

  • Win2000 service pack 4 message

    When attempting to start up the i-tunes software, it comes back with a message that I need to install the latest Windows 2000 service pack (4) from Microsoft. I've done that, both the express and the full version. I've uninstalled, reinstalled and re