Creating PDF indexes
This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/using/WS58a04a822e3e50102bd615109794195ff-7c37.w.html
Can I make a catalog of PDFs on my website and load the catalog to my website?
Similar Messages
-
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.
- DovYou'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...
-
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 -
Acrobat 8 Pro and Create PDF from a Website
Hi,
I'm out of sorts. I can't seem to be able to turn a website thread into PDF file using my Acrobat 8 Pro (Mac user)....
The thread I'm trying to save has multiple pages and all Acrobat 8 does is save only the first page and not any of the subsequent pages.... unless I manually go page by page but then I end up with multiple PDF files that I would have to combine and that is just too time consuming --and would have to learn to do that as well.
Here's the link to the website thread I'm trying to convert into PDF:http://tinyurl.com/6guqpf
Could someone please advice what I may be doing wrong?
Thanks,
RThanks Paul, I've tried to Save as PDF in the OSX print dialogue box- but it only saves the first page of the thread I'm trying to save (when most threads have more than 1 page, sometimes up to 30 pages each)
This is what my friend wrote and how she found a way to solve her problem.... however I don't have Adobe 5 as she does and I would like to not have to get Adobe 5 but use only Adobe 8....
<<I start Adobe 8.
Select Create PDF from Web Page and paste in:
http://learningcenter.atkins.com/sessions/discussions/index.jsp?courseSessionId=7233&webPa geId=1000007&courseId=3856
When it's made the first page (see attached) [<<=== can't attach here since you need a password to view it.]
I save it and exit.
Then I open Adobe 5 and then I can click on each topic to start capturing the information (meaning all pages to each thread without a problem).
If I click on a topic in Adobe 8 ... it makes a page in a new browser window ... and I'm lost.>>
Do you or anyone else know why this is so? Why Adobe 8 would open a page in a new browser window and Adobe 5 doesn't?
Thanks again,
R -
FrameMaker 11 very slow to create PDF
Hello All
Using FrameMaker 11 (TCS4) on Windows Vista SP2 (32-bit), dual-core 2.8GHz, 4GB RAM.
I have a book file with nine chapters, title, TOC and Index, adding up to about 550 pages when printed. It used to take about 10 minutes to create PDF using FrameMaker 9. Now that we have upgraded to FM11 it takes over 90 minutes. The chapters contain screenshots as well as text, and I am printing the whole book as one file.
I have tried this using Save Book As (then choosing PDF), printing to Adobe PDF as .ps and then distilling, and Save as PDF, all with similar results.
Then, because I was working across our network, I copied all the files to my local drive and tried again. Same results. I have also set the printer to not start printing until all pages are spooled.
Watching the activity in the printer dialog, I see that pages are spooled quickly (about 1-2 sec/page) if the chapter file is small (up to 40 pages). But in the case of large files (up to 140 pages) each page takes over 10 seconds to spool, and some take 20 seconds. I wondered if this indicates insufficient RAM?
I've read lots of useful information about PDF creation from FM, and tried most of the recommendations (including Dov's recommendations for printer/Distiller settings from years back), but nothing makes a difference.
Any recommendations are welcome. Thanks.
Roger Shuttleworth
London, CanadaBased on the number of recent complaints about PDF rendering performance, it rather looks like there might be a problem with the newer FM releases. I can't personally say, because we're still on FM7/Unix, and don't use our FM9/Win764 versions for production.
Printing to .ps and Distilling separately should help at least get your FM GUI prompt back sooner, and unless Adobe has broken it, the full Acrobat Pro product can be set to have Distiller "watch" directories for new .ps files, and generate PDFs without any user attention.
It would be interesting to know if the rendering process is multi-threaded to any significant degree. if so, having more cores in your CPU would help.
I'm also wondering if FM11 gets any benefit from installation on Win64.
And at the risk of stimulating conspiracy theories, would using Framemaker Server print any faster? I at least presume that it would free up the workstations during print.
Per-core CPU clocks hit the wall 10 years ago. Per core perf has been creeping up since then, with most of the per-chip gain in the form of more cores. Application coders, however, seem to be assuming that per-core performance is still ramping up at 2x@2yr as a side effect of Moore's Conjecture. -
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 AMhi,
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. -
Create PDF from Web page using Acrobat X - Page Order
I have a structured web site that is in fact Program Help The web pages are structured as follows:
index.html - Main Topic Index page with links to all topic subject index pages
topic/index.html - Topic Subject Index Page with links to all subject pages
topic/subject.html - Subject page
.....etc
Using Acrobat 5 "Create PDF from Web Page" created a perfect logical PDF page structure in the page order of of the web site. In Acrobat 5 page 1 was the Main Topic Index Page, page 2 was the 1st Topic Subject Index Page, page 3 was the 1st Subject Page, then the 2nd subject of the 1st Topic, etc. until the Topic Subjects were exhausted after which the 2nd Topic Subject Index Page and so it went on. As a result the bookmark structure was sensible. The page order was as follows:
Main Topic Contents
Topic 1 Contents
Subject 1 of Topic 1
Subject 2 of Topic 1
Topic N Contents
Subject 1 of Topic N
Subject 2 of Topic N
Acrobat X (just purchased) produces a differently structured PDF from the same HTML pages. The order is:
Main Topic Contents
Topic 1 Contents
Topic 2 Contents
Topic N Contents
Main Topic Contents (a second time)
Subject 1 of Topic 1
Subject 2 of Topic 1
Subject N of Topic 1
Subject 1 of Topic 2
Subject 2 of Topic 2
Subject N of Topic N
Question: Is there any way I can get back with Acrobat X the same page order I got with Acrobat 5?
Any help appreciated. The website is www.caliach.com/caliach/vision/help/index.html
ChrisAcrobat is using the underlying mark up of the rendered HTML page.
This may or may not provide an adequate input to Acrobat when it is noodling out how and what to tag.
I suspect you may find that, to obtain an adequately tagged PDF, you may have to capture the web page content with the create bookmarks and create tags options off.
Once you have the PDF make working copies.
Try letting Acrobat tag this already created PDF to see what happens.
You may have to manually tag the PDF.
n.b., The default read order for western language can be altered by user selections in the accesibility setup or by selection in the PDF page(s) Page Properties.
Be well... -
Hi,
I have imported a multipage PDF using the multipage script I downloaded from Adobe.
I multipage PDF imports ok, but I cant Highlit any text withing the document to create an index.
Can you advise how i can use the text tool to highlight text and create an index.
ThanksI have not used the plugin, but it is supposed to create a fully editable InDesign file from the PDF, which means you should be able to make an index.
Do you have a lot of entries you need to make? It might work to place the PDF on one layer, then add a second layer to the file and add text frames above the PDF. Enter the index terms in these new layers (lots of hand typing) and add the index markers. You can make the second layer non-printing and still include it in the indexing, I think. You might also be able to extract the text from the PDF in Acrobat Pro and flow that (in fact you could rebuild the whole document this way if you were so inclined, extracting both the text and the images).
But the larger question is why you are trying to work from the PDF instead of the original layout, which should b e relatively simple to index.
Peter -
Create PDF based on spool ID and store on content server
Hi all,
I need to create a PDF file from a spool ID and store this in a repository on the content server (archive). How can I do this <b>without creating a physical file on the local workstation</b>?
All helpful answers will be rewarded!
- Mari VirikHi Mari,
This is a sample report pgm which create pdf file from spool id :
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
<b>and then use archiving object to store the photo i have explained you as an example</b>
You have to create a content repository "A2" or another . You have to follow then next steps :
Create a content repository with storage type FILE archive.
Tcode OAC0
IMG: Basis Components Basis Services SAP Archive Link Basic Settings Maintain content repositories
(Embedded image moved to file: pic00041.pcx)
Swap from display to amend. Select a current entry and 'copy' or just hit 'create'. Then select .
(Embedded image moved to file: pic18467.pcx)
Then fill in the details as below:
Choose a two char name
Set DocArea to be 'Archive Link'
Storage type FILE archive (see Note below on how to get this!)
Choose Version no. 0031
Enter the path name where the photos are to be loaded from. Note this is for loading only. When the photos are linked into the sap system (see later), actually, SAP takes a 'copy' and stores it elsewhere. The path may only need to be entered to 'Arch.path', but entering to all three doesn't seem to hurt.
Note on storage type:
Storage type 'FILE archive' may not be in the dropdown list, and F4 (poss entries) may not work! If this is the case, click on the field Storage type (left mouse button) and then click the right mouse button. Choose Possible entries and a full list of all
possible storage types is shown. FILE archive is entry number 08 and then
Check which content repository (Archive) is linked to document type HRICOLFOTO in object type PREL.
Tcode OAC3
Table TOAOM_C
IMG: Basis Components Basis Services SAP Archive Link Basic Settings Maintain Links
(Embedded image moved to file: pic06334.pcx)
Set the 'Content R' field to the one you've just set in the step above.
Note the Ret.per. field is the retention period for the photo in MONTHS. (so the default is 833 years and 3 months!)
Now you can link the photo to the employee.
<b>Pls reward pts if found usefull :)</b>
Regards
Sathish -
"Create PDF from Web Page" Yields Authorization Failure
Acrobat 9 Pro Extended running on Windows XP Service Pack 3:
When using "Create PDF from Web Page," certain linked pages result in an "Authorization Failure" error message. Is there any way to instruct Acrobat to disregard pages that are not downloadable and continue creating the PDF?I am having the same issue AND none of my pages or files require a UserID or Password. My issue appears to be something with the domain because a and b work just fine and produce a PDF file while item c does not work and produces the error msg.
http://www.dot.wi.gov/projects/neregion/151/index.htm works just fine and produces a PDF file.
http://www.dot.state.wi.us/projects/neregion/151/index.htm works just fine and produces a PDF file.
http://www.wisconsindot.gov/projects/neregion/151/index.htm produces an error msg. ‘Nothing done’.Error info. - Authorization Failure http://www.wisconsindot.gov/projects/neregion/151/index.htm
[email protected] -
Create PDF From Web Page - Authenticated SharePoint Sites generate "Authorization Failure" error
We have several authenticated sharepoint sites on our intranet, and we are trying to create a PDF of a site (x levels down) using the Acrobat create PDF from web page feature. When you try to create a PDF from a non-sharepoint, authenticated website, a login prompt appears asking for login credentials. However, when you try to use the same feature on an authenticated sharepoint site, you do not get prompted for credentials and instead get an Authorization Failure error. the popup says "Error: Nothing Done". We have successfully PDF'd anonymous sharepoint sites on the WWW. Has anyone successfully PDF'd an authenticated SharePoint site?
Thanks in advance,
-Richard.I am having the same issue AND none of my pages or files require a UserID or Password. My issue appears to be something with the domain because a and b work just fine and produce a PDF file while item c does not work and produces the error msg.
http://www.dot.wi.gov/projects/neregion/151/index.htm works just fine and produces a PDF file.
http://www.dot.state.wi.us/projects/neregion/151/index.htm works just fine and produces a PDF file.
http://www.wisconsindot.gov/projects/neregion/151/index.htm produces an error msg. ‘Nothing done’.Error info. - Authorization Failure http://www.wisconsindot.gov/projects/neregion/151/index.htm
[email protected] -
Create PDF from dynamic content link?
How can I make a button [download PDF] wich creates a PDF
from the content & the images of a dynamic posts..?
Is there an extension to download which creates this more
easy? I have the developer box.. is there something there?
Thankx for any tips.Ullitasch wrote:
> How can I make a button [download PDF] wich creates a
PDF from the content &
> the images of a dynamic posts..?
> Is there an extension to download which creates this
more easy? I have the
> developer box.. is there something there?
> Thankx for any tips.
What server language are you using? I have used a server
component
called www.asppdf.com which is fairly expensive, but can
create PDFs on
the fly from dynamic data. Its comlex, but worth the effort.
There are other solutions for PHP and CF, but no extensions,
so will
need some serious coding.
Dooza
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html
How To Report A Bug To Adobe
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform -
Creating the index takes forever
Hi,
I'm trying to index ~1100 PDF documents, who size varies between 20KB and 4MB, those PDF are stored in two directories on our Web server, so I use a URL_DATASTORE to get them. I have a column that contains the correct URL to the PDF, the column is a VARCHAR2(2000). 55% of documents are in French, the 45% remaining are English documents. I created this set of preferences :
begin
ctx_ddl.create_preference('AAPDF_DATA_PREF','URL_DATASTORE');
ctx_ddl.set_attribute('AAPDF_DATA_PREF','NO_PROXY','acaiq.com');
ctx_ddl.set_attribute('AAPDF_DATA_PREF','Timeout','60');
end;
begin
ctx_ddl.create_preference('LEXIQUE_ANGLAIS','BASIC_LEXER');
ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','index_themes','no');
ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','index_text','yes');
ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','theme_language','english');
end;
begin
ctx_ddl.create_preference('LEXIQUE_FRANCAIS','BASIC_LEXER');
ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','index_themes','no');
ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','index_text','yes');
ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','theme_language','french');
end;
begin
ctx_ddl.create_preference('LEXIQUE_GLOBAL','MULTI_LEXER');
ctx_ddl.add_sub_lexer('LEXIQUE_GLOBAL','DEFAULT','LEXIQUE_ANGLAIS');
ctx_ddl.add_sub_lexer('LEXIQUE_GLOBAL','french','LEXIQUE_FRANCAIS','fre');
end;
begin
ctx_ddl.create_preference('PREF_FUZZY', 'BASIC_WORDLIST');
ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_MATCH','FRENCH');
ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_SCORE','30');
ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_NUMRESULTS','200');
ctx_ddl.set_attribute('PREF_FUZZY','SUBSTRING_INDEX','TRUE');
ctx_ddl.set_attribute('PREF_FUZZY','STEMMER','FRENCH');
end;
And I created the index with this DML :
CREATE INDEX ACAIQ.aapdf_index ON AA_PDF(AAPDF_CONTENU) INDEXTYPE IS ctxsys.context PARALLEL 1 PARAMETERS ('datastore AAPDF_DATA_PREF lexer LEXIQUE_GLOBAL language column AAPDF_LANGUE_ISO wordlist PREF_FUZZY memory 10M');
The problem is that it takes forever to create the index. I started the create process yesterday after lunch, and it still running :-/ I looked at my Web server logs and I do see my Oracle server fetching the PDF, but it fetch ~12 PDF per hour.
I'm doing this on our test server, it's a P4 1.4 Ghz with RedHat Linux 8 and Oracle 9i 9.2.02. It's not a fast server, but still I don't think it's normal to take 24 hours to index about 1 GB of data.I recreated the index with a 50M memory parameter instead of 10M. It don't speed up the process, in 40 minutes it only indexed 17 documents.
vmstat stats when indexing the PDF documents :
# vmstat -n 15
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
1 2 0 116104 6796 18120 489684 0 0 3 0 3 7 4 7 2
0 3 0 116104 6776 18200 489256 0 0 62 1500 671 317 48 3 49
1 1 0 116104 7084 18216 489728 0 0 37 1578 673 333 44 3 53
0 1 0 116104 6776 18256 489256 0 0 24 1577 669 322 50 3 47
1 0 0 116104 6908 18300 489876 0 0 18 1375 662 305 33 3 65
0 1 0 116104 7000 18328 488136 0 0 19 1425 662 314 33 3 64
0 1 0 116104 7812 18356 488892 0 0 31 1066 609 207 44 2 53
1 1 0 116104 6776 18380 489168 1 0 19 1198 648 285 19 2 79
0 1 0 116104 6776 18412 488212 0 0 23 1193 627 244 41 2 57
2 0 0 116104 6776 18432 489324 0 0 34 1524 664 313 48 3 49
1 0 0 116104 6780 18456 488572 0 0 26 1430 660 308 39 3 58
2 0 0 116104 6776 18500 488424 0 0 32 1484 667 316 45 3 52
1 1 0 116104 6776 18516 487488 0 0 11 1301 650 287 28 3 69
0 1 0 116104 6776 18560 488316 0 0 35 1183 637 264 30 2 68
0 1 0 116104 6776 18584 487344 0 0 34 1363 645 276 47 3 50
2 0 0 116104 6776 18604 488424 0 0 22 1437 660 306 39 3 58 -
Using Automator to Batch Create PDFs
I've been trying to find a way to make an Automator workflow that will take the name of a folder and combine it's files into a PDF with as little manual input as possible and have finally figured out how to do so. I've seen others ask how to do this for a while so I wanted to share how I did it.
Why would you want to create PDFs? If you have scanned books, photos, documents or anything else on your Mac, you can create PDFs out of them. You can then store these in iTunes and either read them using Preview on your Mac or iBooks on your iOS device.
What this workflow will do:
Take a folder with images, get the folder's name, and create a PDF of the images with it's name.
On the next pass of the workflow, it will send the previous folder to the trash.
Create/have a backup of your files!
Create a folder somewhere that you can drop your folders in. Name it Automator Dropbox. You can create one wherever you want, but this workflow was created with Automator Dropbox in mind so you'll need to change it as necessary.
Open Automator and create a new workflow.
Find Finder Items
- Search Automator Dropbox
- [All] of the following are true:
- [Label] is [Red]
This will search for any folders that were done before.
Move Finder Items to Trash
This will move the previous folder/files to the trash.
Ask for Finder Items
- Prompt: [Choose a Folder]
- Start at: Automator Dropbox
- Type: [Folders]
This will ask you to choose the next item to convert to PDF.
Set Value of Variable
- Variable: pdfvariable
This will take the name of the folder you just selected and use it to to rename your PDF.
Label Finder Items
- [Red]
This will mark the folder you're working on for deletion the next time the workflow is ran.
Get Folder Contents
This will grab all the image files within the folder so that it can create a PDF out of them.
Scale Images
- To size (pixels): 1600
This will scale the maximum dimension of your image down (or up) to 1600px. I find this to be the sweet spot for performance on the iPad 3, and it looks just fine. If the maximum dimension of your image is lower than 1600px, I'd create a duplicate workflow of this and leave out this step; otherwise you will be upscaling and your image won't look as good. You can also leave this step out if you want your original image size kept, but on the iPad 3 and below there will be a delay going from page to page.
New PDF From Images
- Save Output to: [Desktop]
- Output File Name: tempname
This will save your finalized PDF to the Desktop. You can change this to whatever you want; I would suggest the Automatically Add to iTunes folder located in [Music > iTunes > iTunes Media > Automatically Add to iTunes]. You will find your PDF in the Books category in iTunes.
Rename Finder Items
- [Replace Text]
- Find: tempname in [Full Name]. Ignore Case checked.
- Replace: [pdfvariable] (Drag pdfvariable from the variables window into the text field for "Replace". If you don't see the variables, go to "View > Variables."
You can't just drag the variable into the PDF name field in the step above, so this extra step is necessary. It will rename your PDF with the name of the folder it was created from. It will also add the full file path, which will be taken care of in the next step.
Rename Finder Items
- [Replace Text]
- Find: Users/yourname/Documents/Automator Dropbox in [Full Name]. Ignore Case checked.
- Replace: LEAVE EMPTY
This will delete the name of the path from the name of your PDF. If your working folder is not Documents/Automator Dropbox, change it to whatever that is.
If you're running this workflow on a bunch of folders, you can simply keep your cursor over the workflow's play button and press the right arrow + enter to select the next item in queue. This workflow was made for using a little human interaction as possible, so if anyone has suggestions on how to improve on it please post below.
One last thing - if you're seeing a red folder when you run the workflow to choose a folder, it's because spotlight hasn't indexed it yet and the workflow could not find it to delete it. Just go on to the next item.Someone (not me) has created an automator workflow that does this, using a shell script that runs the "pstopdf" unix command. I just downloaded it and tested it on 10 .eps files. You will need to edit the first automator action in the workflow to find the eps files you want (by default it looks for all eps files on your computer), but once you do that, it works like a charm! Converted my eps files to pdf's. Of course, once they are pdf files, you can use automator to convert them to whatever format you want.
http://mad-sci.blogspot.com/2007/12/why-i-hate-computers.html
(link to the actual zip file containing the workflow below)
http://www.physics.mcgill.ca/~burkes/code/PDFworkflows.zip -
Create pdf attachment to the mail
Hi folks,
My requirement is to attach pdf document to the mail step in workflow programatically and document is on presentation server.
i have tried with SOFM object type, but it is asking for document number , but i could not provide it because it is not in SAP system.
how to acheive this.
Thanks,
janakiram.try this copy and paste is and make changes as required
Enjoy.............
To create pdf from internal table.
Two steps
1. get spool no.
2. create pdf.
1. get spool no.
SELECT *
FROM zwftrack
INTO TABLE it_zwftrack
WHERE wf_id = p_wf_id
AND action = 'FYA'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING destination = 'LP01' " 'LT50'
copies = 1
list_name = g_rq2name
list_text = 'COMM-PDF NEW-PAGE PRINT ON'
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = g_days
line_size = g_ln_size " 255 ZTG12
line_count = g_ln_count " 65 ZTG12
layout = g_layout " 'X_PAPER'ZTG12
SAP_COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
SAP_OBJECT = 'RS'
AR_OBJECT = 'TEST'
ARCHIVE_ID = 'XX'
ARCHIVE_INFO = 'III'
ARCHIVE_TEXT = 'Description'
no_dialog = 'X'
IMPORTING out_parameters = g_params
out_archive_parameters = g_arparams
valid = g_valid.
"end of get
NEW-PAGE PRINT ON
NEW-SECTION
NO-TITLE
PARAMETERS g_params
ARCHIVE PARAMETERS g_arparams
NO DIALOG.
***add at top of comments list
WRITE:/ 'Contract Analysis Worksheet', 150 'Current Data ( ', l_date, ' ', l_time, ' )'.
WRITE:/150 'Run # :', wa_zzbedsheet-bdshnum.
WRITE:/ 'Project ID :',g_object_no.
WRITE:/ 'Project :',g_psr_desc.
WRITE:/ 'Profit Center :',g_prctr.
WRITE:/ 'Project Manager :',g_final_abb_contact.
WRITE:/ 'RA key :',g_abgsl.
WRITE:/ 'Customer :',l_cust.
WRITE:/ 'Project Start :',l_proj_start.
SKIP 3.
SORT it_zwftrack BY approver_level.
LOOP AT it_zwftrack INTO wa_zwftrack.
AT FIRST.
WRITE:/ 'Approvers Comments:'.
SKIP 1.
WRITE:/1 'Role', 35 'Approved By', 50 'Signature', 75 'Comments'.
ULINE.
ENDAT.
IF wa_zwftrack IS INITIAL.
SKIP.
ELSE.
PERFORM f_get_name USING wa_zwftrack-approved_by
CHANGING g_final_abb_contact.
WRITE :/ wa_zwftrack-role UNDER 'Role',
g_final_abb_contact UNDER 'Approved By',
wa_zwftrack-signature UNDER 'Signature',
wa_zwftrack-comments UNDER 'Comments'.
ENDIF.
CLEAR: g_final_abb_contact.
insert page break
IF sy-tabix = w_lines .
NEW-PAGE .
w_lines = 2 * w_lines.
ENDIF.
ENDLOOP.
NEW-PAGE PRINT OFF .
CLEAR w_tsp01.
SELECT SINGLE *
FROM tsp01
INTO w_tsp01
WHERE rqowner = sy-uname
AND rq2name = g_rq2name. "'COMM-PDF' .
g_spool_comm = w_tsp01-rqident.
2. create pdf
CLEAR g_lines .
REFRESH it_tab1 .
****get comments page from spool
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
rqident = g_spool_comm "spool1
TABLES
buffer = it_tab1
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
OTHERS = 8.
IF sy-subrc = 0.
ENDIF.
to record line no for page break .
DESCRIBE TABLE it_tab1 LINES g_lines.
MOVE g_lines TO wa_eof-line .
APPEND wa_eof TO it_eof .
CLEAR g_lines .
APPEND LINES OF it_tab1 TO it_tab.
REFRESH it_tab1 .
SELECT SINGLE spld INTO w_spld FROM usr01 WHERE bname = sy-uname.
SHIFT g_wf_id LEFT DELETING LEADING '0'.
CONCATENATE g_wf_id '-ONEPDF' INTO g_list_name.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING destination = w_spld " 'LT50'
copies = 1
list_name = g_list_name
list_text = 'PM-PDF NEW-PAGE PRINT ON'
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = g_days
line_size = g_ln_size " 255 ZTG12
line_count = g_ln_count " 65 ZTG12
layout = g_layout " 'X_PAPER'ZTG12
SAP_COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
SAP_OBJECT = 'RS'
AR_OBJECT = 'TEST'
ARCHIVE_ID = 'XX'
ARCHIVE_INFO = 'III'
ARCHIVE_TEXT = 'Description'
no_dialog = 'X'
IMPORTING out_parameters = g_params
out_archive_parameters = g_arparams
valid = g_valid.
NEW-PAGE PRINT ON
NEW-SECTION
NO-TITLE
PARAMETERS g_params
ARCHIVE PARAMETERS g_arparams
NO DIALOG.
w_idx = 1 . " for reading EOF line no .
w_tabix = 0 .
READ TABLE it_eof INTO wa_eof INDEX w_idx .
MOVE wa_eof-line TO g_lines .
w_lines = w_tabix + g_lines .
DATA: w_linestr LIKE sy-tabix . "#EC NEEDED
LOOP AT it_tab INTO wa_tab.
IF wa_tab-line CP 'Current Budget' .
w_linestr = sy-tabix .
ENDIF .
IF wa_tab IS INITIAL OR wa_tab-line CA '?' . " ZTG15
SKIP . " ZTG15
ELSE . " ZTXX
WRITE / wa_tab .
ENDIF . " ZTG15
insert page break
IF sy-tabix = w_lines .
NEW-PAGE .
w_idx = w_idx + 1 .
w_tabix = sy-tabix + w_tabix .
READ TABLE it_eof INTO wa_eof INDEX w_idx .
MOVE wa_eof-line TO g_lines .
w_lines = w_tabix + g_lines .
CLEAR: w_tabix.
ENDIF .
ENDLOOP .
NEW-PAGE PRINT OFF .
CLEAR w_tsp01.
SELECT * INTO TABLE t_tsp01 FROM tsp01
WHERE rqowner = sy-uname
AND rq2name = g_list_name .
IF sy-subrc = 0 .
SORT t_tsp01 BY rqcretime DESCENDING . "RBE24 rqident DESCENDING .
ENDIF .
READ TABLE t_tsp01 INTO W_TSP01 INDEX 1 .
CLEAR w_tsp01.
SELECT SINGLE *
FROM tsp01
INTO w_tsp01
WHERE rqowner = sy-uname
AND rq2name = g_list_name. "'COMM-PDF' .
WHILE g_numbytes = 0 .
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = w_tsp01-rqident "spoolno
no_dialog = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = g_numbytes
pdf_spoolid = g_pdfspoolid
LIST_PAGECOUNT =
btc_jobname = g_jobname
btc_jobcount = g_jobcount
TABLES
pdf = it_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
ENDWHILE.
**DATA : DATA_TAB TYPE TABLE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = g_numbytes
filename = g_lv_file
filetype = 'BIN'
IMPORTING
filelength = g_numbytes
TABLES
data_tab = it_pdf
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.
report ZTEST12345678.
tables:
tsp01.
*STRUCTURES
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 255, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename TYPE string.
*----Data for Mail
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA: V_MAILID(241) TYPE C .
DATA: BEGIN OF DATA_TAB OCCURS 20,
LINE(255),
END OF DATA_TAB.
start-of-selection.
concatenate 'c:\abap\'
p_repid
'.pdf'
into mc_filename.
*Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
*in_archive_parameters = space
*in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*Make sure that a printer destination has been set up
*If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LP01'.
endif.
*Explicitly set line width, and output format so that
*the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
CALL FUNCTION 'ENQUE_SLEEP'
EXPORTING
seconds = 2.
*Find out what the spool number is that was just created
P_REPID = SY-REPID.
perform get_spool_number using p_repid sy-uname
changing mi_rqident.
*Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
perform create_mail_data.
PERFORM SEND_MAIL.
*FORM get_spool_number
*Get the most recent spool created by user/report *
*--> F_REPID *
*--> F_UNAME *
*--> F_RQIDENT *
form get_spool_number using f_repid
f_uname changing f_rqident.
data: lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
concatenate f_repid+0(9)
f_uname+0(3)
into lc_rq2name.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
**& Form create_mail_data
form create_mail_data.
*Creation of the document to be sent
DOC_CHNG-OBJ_NAME = 'TEST MAIL ATTACHMENTS'.
DOC_CHNG-OBJ_DESCR = 'Test for PDF'.
OBJTXT = 'Contents of mail'.
APPEND OBJTXT.
OBJTXT = 'PDF'.
APPEND OBJTXT.
OBJTXT = 'PDF'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
*Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
*-DOWNLOADING AND AGAIN UPLOADINGIN BIN FORMAT TO TRANSFER TO OBJBIN
*MC_FILENAME = 'c:\test.doc' .
*--pdf--
*MC_FILENAME = 'c:\test.pdf'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = MI_BYTECOUNT
filename = MC_FILENAME
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 = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
tables
data_tab = MTAB_PDF[]
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*CALL FUNCTION 'GUI_DOWNLOAD'
*EXPORTING
*BIN_FILESIZE = MI_BYTECOUNT
*FILENAME = MC_FILENAME
*FILETYPE = 'BIN'
*TABLES
*DATA_TAB = MTAB_PDF
*EXCEPTIONS
*FILE_OPEN_ERROR = 1
*FILE_WRITE_ERROR = 2
*INVALID_FILESIZE = 3
*INVALID_TYPE = 4
*NO_BATCH = 5
*UNKNOWN_ERROR = 6
*INVALID_TABLE_WIDTH = 7
*GUI_REFUSE_FILETRANSFER = 8
*CUSTOMER_ERROR = 9
*OTHERS = 10.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = MC_FILENAME
FILETYPE = 'BIN'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = OBJBIN
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*CALL FUNCTION 'GUI_UPLOAD'
*EXPORTING
*FILENAME = MC_FILENAME
*FILETYPE = 'BIN'
*TABLES
*DATA_TAB = OBJBIN.
*--uncommnet this for pdf--
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'TEST.pdf'. APPEND OBJHEAD.
*Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Testing PDF Attachment'.
OBJPACK-OBJ_DESCR = 'Customes Ageing report PDF Output Attachment'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
CLEAR V_MAILID.
V_MAILID = <mail id>.
RECLIST-RECEIVER = V_MAILID.
RECLIST-REC_TYPE = 'U'. "B for SAP Inbox
APPEND RECLIST.
endform. " create_mail_data
**& Form SEND_MAIL
form SEND_MAIL.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
*EXCEPTION HANDLING
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Mail sent with attachment'.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE.
endform. " SEND_MAIL
Maybe you are looking for
-
Tecra M3 - touchpad is not working with Windows 7
I have a Tecra M3 that I have updgraded to Windows 7. The touchpad is not working. The Toshiba website does not have Windows 7 drivers for this model. I have tried installing the touchpad driver and TVAP from the A11 model but still cannot get it to
-
Kernel upgrade having ABAP+JAVA instance
Hi team, Can you provide the procedure how to kernel upgrade for our windows system having ABAP+JAVA instance releae version 700. Provide the links, your replies are very helpful. Regards Bhaskar
-
GURUS-----How can any one proof he is a RAC expert
Hi, In my recent interview with one of the top company they asked me "ARE YOU A RAC EXPERT" person who interviewd me was claiming he is an RAC expert. How can I proof that I am a RAC expert. If I know RAC installation on AIX/HP-UX/SUN and have good k
-
hiii, i want to display one by one multiple image in same region after click next button how will do that... plz reply fast???????
-
Re: DVD drive not working on Equium A100
I have a problem with my drive it has power but wont read or write, no it is not error code 39 This happened when SP1 on Vista was installed it upset my chipset drivers. So I have uninstalled SP1 and tried to update BIOS but I get an error code on wi