Converting from SAPSCRIPT to PDF

Sir,
I am converting form from sapscript to pdf. The form is converting but the ouput font in pdf is seen in bigger size so the alignment is getting distorted. Kindly advise solution. I am in 4.6C
Thanks & Regards

Hi
See the sample code and do accordingly
REPORT zzz_jaytest .
Types Declaration
TYPES : BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
END OF ty_pa0001.
Internal Table Declaration
DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
i_content_txt TYPE soli_tab, "Content
i_content_bin TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
Work Area Declaration
w_pa0001 TYPE ty_pa0001, "For pa0001 Details
w_res TYPE itcpp, "SAPscript output
"parameters
w_otf TYPE itcoo, "For OTF
w_pdf TYPE solisti1, "For PDF
w_transfer_bin TYPE sx_boolean, "Content
w_options TYPE itcpo, "SAPscript output
"interface
Variable Declaration
v_len_in TYPE so_obj_len,
v_size TYPE i.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN', "BIN
c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
"File Name
c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
START-OF-SELECTION.
Selecting the records from pa0001
SELECT pernr bukrs werks FROM pa0001
INTO TABLE i_pa0001 UP TO 10 ROWS.
Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device
Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.
LOOP AT i_pa0001 INTO w_pa0001.
Writting into the form
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
Closing the form
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Converting OTF data to single line
LOOP AT i_otf INTO w_otf.
CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
INTO w_pdf.
APPEND w_pdf TO i_content_txt.
ENDLOOP.
Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
Downloading the PDF File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_size
filename = c_name
filetype = c_bin
TABLES
data_tab = i_content_bin.
If you r using this function module check it once....
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location
follow this link for sample program.
http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • How to use .joboptions file while converting from Word to PDF

    Hi,
    I'm pretty new to Acrobat. I'm using Acrobat XI. I need to convert a word document to a PDF file which conforms to certain requirements described by a given .joboptions file. The .joboptions file can be opened by distiller, but as far as I know distiller is not invovled in the conversion (Word to PDF) process. So how can I make sure the converted PDF file meets the requirement described by the .joboptions file?

    Distiller is used when converting from Word to PDF, if you do it via the Acrobat panel, not the Adobe PDF printer or Word's internal Export to PDF command. If you've loaded your joboptions file in Distiller (via Settings - Add Adobe PDF Settings), then you will see it in the drop-down of Conversion Settings when you click the Preferences button in the Acrobat panel in Word.
    After you've selected your job options profile click the Create PDF button, and the file will be converted using the selected options.

  • After 9.3 update getting error printing to Adobe PDF while converting from Powerpoint to PDF

    That happened after upgrading Acrobat Pro 9.1.2 to 9.2->9.3 on Windows XP sp2 platform. Converting from other Microsoft Office 2003 products is totally normal(Excel, Word) Did anyone came accross and know how to fix that?? We have many users with exactly same issue.

    thanks...figured out my problem!
    Date: Wed, 3 Feb 2010 12:24:29 -0700
    From: [email protected]
    To: [email protected]
    Subject: Re: After 9.3 update getting error printing to Adobe PDF while converting from Powerpoint to PDF
    What happens if you try to print to the Adobe PDF printer?
    >

  • Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?

    Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?
    Depending on the system version, and Office Word version:
    - a pure URL link starting with http or even www sometimes works in PDF, either produced by Aperçu or Adobe, sometimes does not work;
    - other kind of links where the text under display is not a URL, never work!
    I like everything with Apple computers and software, except PDF generation. Output files are usually bigger in size, and no better quality, than under Windows. Furthermore, it is weird that something as common as hyperlinks does not work correctly!
    I related this question with Mac OS X Snow Leopard, but the problem is still there with Mac OS Lion.
    This problem seems to have been around for years, without any proper solution from Apple and/or Adobe! To me, this is very embarrassing!

    Greetings NoNameGiven,
    If I understand the problem correctly (I’m not sure I do) you would prefer ‘iii’ to be read as “eye eye eye” rather than “three”? The alt text property is the only way that I know of to make this happen. Hope this helps.
    a ‘C’ student

  • How to convert from image based pdf to text based pdf

    I have Adobe 9 Pro. How to convert from image based pdf to text based pdf? For example, if someone emails a scanned pdf to me, how do I convert that document into a text based pdf?

    To perform OCR, open the document and select: Document > OCR Text Recognition > Recognize Text Using OCR
    More information on the various options is in the Acrobat help doc.

  • Converting from publisher to pdf

    When I convert from publisher to pdf my page size changes? Why? And how do I stop this from happening?

    Try in the Acrobat Print menu:
    I'd try choose paper source by PDF Page size
    Note appearance of the Print window will be different on PC although the Controls should roughly be the same.

  • Black Pages - Convert from Word to PDF

    When I convert a Word document to a PDF, the pages on the PDF document are black.  This only happens on select Word document that use a specific cover graphic.  I've sent the same document to a co-worker and they were able to convert the document to PDF with no issues.  I have verified my preferences with my co-worker and these are the same.  I have the latest version of Adobe Reader (10).  I was previously able to convert a Word document with the same graphic to PDF without any issues.  Any ideas on how to fix this?

    Adobe Reader can't convert from Word to PDF.

  • Since 11-4-14 every convert from Word to PDF has failed online or desktop - when will this be sorted

    Since 11-4-14 EVERY convert from Word to PDF either online or desktop has failed, when will this be fixed?

    No replies on here so went online and tried various options including "repair reader installation" plus uninstall and reinstall etc, some posts suggested a repair from the Printers file (Vista) so installed AdobeCreatePDF desktop printer plus Xerox Phaser PS printer as advised. All without any obvious sucess ie still no word docs converted after hours of trying. Then unexpectedly a further test convert attempt succeeded; tested again on desktop plus online and now all works fine as it did before. Who knows why - possibly only Adobe know. Will leave this thread here just in case the fail reappears over next few days!

  • Image Missing In PDF Converted from SapScript

    Hi Experts,
    I was supposed to convert SapScript into PDF for sending as an attachment with mail.
    When I am doing that the image (client's logo) in SapScript is not present in PDF file.
    Strange scenario here is that when I am downloading that same file to my hard disk then it is absolutely fine.
    I have used FM 'CONVERT_OTF_2_PDF' to get PDF table. Then I compressed the PDF table data using the follwoing code snippet:
    LOOP AT lt_pdftab INTO wa_pdftab.
    TRANSLATE wa_pdftab USING ' ~'.
    CONCATENATE wa_buffer wa_pdftab INTO wa_buffer.
    CLEAR wa_pdftab.
    ENDLOOP.
    TRANSLATE wa_buffer USING '~ '.
    DO.
    wa_record = wa_buffer.
    APPEND wa_record TO lt_record.
    CLEAR wa_record.
    SHIFT wa_buffer LEFT BY 255 PLACES.
    IF wa_buffer IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    I think in this above process only some thing is going wrong because when I am downloading PDF file using GUI_DOWNLOAD then I am passing directly internal table lt_pdftab & not lt_record. But on exporting lt_pdftab data as attachment with mail the PDF file is getting opened with error.
    Any help regarding the same is highly appreciated.
    Thanks,
    Shaurya Jain

    Hi,
    Just observe this Code:
    REPORT zsuresh_test.
    Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
    " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    t_otf] = t_otf_from_fm-otfdata[.
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    others = 4
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = T_pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    If helpful reward with points(Don't forget).

  • Distorting text/images in converting from pmd to pdf

    My company uses PageMaker 7.0 to create our manuals and brochures and then converts them into pdf's. I've run into this problem before and found that if I didn't properly place or import an image (not copy and paste an image or text) that once converting it into a pdf only a portion of the image would be there or everyother 3rd letter would exist. Thought we had corrected it. The creator of this last document saw everything correctly but when another employee opened the pdf file through the network it was distorted and wrong. I opened the document and "saved as" in my documents and then everything seemed fine from my computer but then the creator opened the file on his computer and it was wrong. The link info on some of the images is wrong even though it was placed properly- the text was entered in Pagemaker but on the pdf is missing letters and causing odd spacing. I'm at a loss now on how to correct this. I hate to upgrade when pagemaker is more than sufficient for the basic manuals we do. I did notice that I was using Reader 9 wheras they still had 8 on their computers- already had them upgrade but didn't think this would be a real issue. Any ideas on the problem or how to correct would be greatly appreciated!!

    Look in the application where the users are generating the PostScript.
    Many of them have an option "print last page first", so this naturally
    produces a backwards PDF.
    Aandi Inston

  • Converting from WORD to pdf always fails the first time

    OS is XP. Acrobat Pro 8.1.5. When I first convert from WORD, EXCEL, whatever the program appears to be working but no file is created.  This happens always on the first time I convert to pdf for the day.  Once I do it again, it works and continues to work throughout the day.  I turn off my computer at night and again the next day when I come in it doesn't convert the first time but will work again.  Is there something in Windows or Acrobat that I can fix to get this to work properly?

    If you are using Word 2007 (you don't say) you might try the Microsoft plugin... this is instead of Acrobat
    http://www.microsoft.com/downloads/details.aspx?FamilyId=4D951911-3E7E-4AE6-B059-A2E79ED87 041&displaylang=en
    If you are using an earlier version of Word (or Word '07) make sure you have installed all Microsoft Office updates, so you'll know this is not a Microsoft bug

  • Lines Not Converting From Autocad to Pdf

    I am using Windows 7 Pro, Autocad 2011 (full version), Acroplot Pro 2013 and Adobe Acrobat Pro.
    Using Acroplot Pro, we convert Autocad files to pdf. We are having issues with some lines, or entire sections of a drawing, not converting to pdf file. As if someone erased random lines from the drawing.
    I've walked through this process with Acroplots help line and they say it's not on their end. I know the issues has nothing to do with Autocad because I can re-do this process and the pdf will come out fine the 2nd time. It's rare and random, maybe one file per 100, but causes a problem when you're converting hundreds of files and don't know which one may be wrong.
    Thanks in advance.

    Sorry if I was unclear, we load our cad files into Acroplot which then utilizes Adobe Acrobat Pro claims it's an issue with Acrobat Pro to create the pdf. After walking through the process with Acroplot, they say it's an issue with Acrobat Pro.

  • Why is Adobe changing my fonts when I convert from publisher to pdf?

    I've just started using the pdf conversion plug-in to convert from publisher 2007 to pdf.  The way it was explained to me was that no matter what style of font you use it should be embedded in the file so that when someone opens the file they will read it in exactly the same style as I used to create it.  I am a volunteer for a non-proft org. (my church) and each year we publish a small booklet and sell space to local businesses who contribute to the well-being of my church.  This is the first year I'm using the pdf conversion but when I checked how the ad would look in adobe reader some of the fonts were changed and I can't seem to correct the problem.  It doesn't happen with all the fonts which makes it even stranger.  Anyone got any advice, suggestions, etc.  Thanks.
    Manny

    I'm having the same problem and unfortunately, it doesnt matter which software i'm using... Word,
    Publisher, and even photoshop.  I have Adobe Acrobat Pro and no matter how I try to convert, i'm still getting the same problem.

  • Converting from Word to PDF and printer settings

    I have a program that writes letters automatically in Word and if we have a PDF file as an enclosure when the letter prints, it actually converts the word document as a whole to a PDF. This part works great, however, when the letter begins with Word we have the Page setup for the printer to print the first page on letterhead (tray 1) and all pages after to plain paper (tray 2). When the word document converts to pdf, it is printing everything from tray 1 which is letterhead.
    Is there any way to convert a document to pdf and keep the page settings as well?
    Thanks for any input!

    Don't have an answer. However, you might consider creating the WORD document so that the letterhead is built in and you do not need the paper.

  • Converting from word to pdf

    When converting from a Word doc to a pdf using joboptions file settings, the layout changes - text is moved up as if the bottom margin is decreased.  This is a problem when the heading on a new page is moved to bottom of the previous page.  Please help - thanks.

    I've noticed the problem in multiple words docs but it doesn't always happen.  I tried again, using print to adobe as I usually do, and noticed that the last line of the first page moved to second page after I converted.  However, this didn't happen when I converted using PDFMaker - thanks!  I will convert using PDFMaker from now on to hopefully avoid the problem. 

Maybe you are looking for

  • Importing Kodac camera photos (*.fpx) into iPhoto 6.0.2

    Hello, I switched from Windows PC to Mac (Mac Mini Core Duo) - now I am using iPhoto for my Photo collection. I used to have a Kodac digital camera of the DC series and used the format *.fpx - unfotunately I can not import these pictures into iPhoto.

  • FireWire ports disabled and gone missing

    I'm having a major issue with all my firewire connections. They are not existing or active anymore. In the system profiler, it mentions no sign of having any connections only that the maximum speed is 800 mbps. I installed a FireWire 800 PCI card but

  • Muse "Missing fonts" warning?

    Hi, does anyone know if there is a "Missing Fonts" warning in Muse or some way to check if all the correct fonts are loaded when opening a file? Like the InDesign and Illustrator warning (see pic). Thanks!

  • Resolution too high for me

    All of the current Mac Book Pros and Mac Books have a native screen resolution that makes it difficult for me to read without getting a head ache. I do not believe that I have special needs and I am not a senior (in my fourties). However I still pref

  • Huey Pro and Windows 7 64bit Issues

    Hi there, having problems I am afraid. If I calibrate my two monitors with the Huey pro all works fine except when I run LR 3.0. None of the thumbnails or pictures display at all. They are there as I can see the histogram for each one. Delete the hue