10-31-2016 02:53 AM - last edited on 10-31-2016 03:15 AM by Reeza
I am trying to create a rtf or pdf file using some existing lst outputs. It is producing rtf or pdf by the following code segement but the page is not fitting to the PDF or RTF according to LST file. That means page break is not working properly even I used PS and LS as the options. So would you please help me in this regard so that I can create a RTF/PDF according to the existing LST files.
Thanks in advance!
Here is my program:
proc document name=import(write);
import textfile='D:\study\study_001\lst\disp_t1.lst' to ^; setlabel textfile 'Table 1: 1 Test Table - 1';
import textfile='D:\study\study_001\lst\disp_t2.lst' to ^; setlabel textfile 'Table 3: 1 Test Table - 2';
obpage textfile /after;
options nodate nostimer papersize=a4 orientation=landscape topmargin=".8in" leftmargin=".5in" rightmargin=".5in" bottommargin=".5in";
ods rtf file="D:\study\study_001\lst\rtf\test1.rtf" contents=yes toc_data;
ods rtf toc_data;
ods rtf close;
10-31-2016 03:13 AM
Make sure to set style = listing on your ODS PDF/RTF statement.
I'm not sure exactly what you're trying to achieve, if the suggestion above doesn't work please detail your problem more clearly. Explaining your problem in the following method helps: Here's what I have, here's what I want, and here's what I've tried.
10-31-2016 04:38 AM
Thanks for your reply.
Actually in my LST output suppose the pagesize is 40 for each page but whenever I am trying to convert these LST outputs to the RTF/PDF there is showing discripency in the page break according to LST file. That means 2 pages fitting into one page like the attachment or splitting one page into two pages and the second page is starting in the middle of the next page in the RTF/PDF. But I want that every page of the LST file will be fit into every page of the RTF/PDF.
I think now you will get my point.
10-31-2016 05:45 AM
Sorry, I am not sure what you mean either. Why do you have list output if you want RTF or PDF, why not just go directly to RTF/PDF using ODS. Lst is plain text, i.e. it has nothing to indicate to document processor how it should be displayed, so you would need to do those kind of calculations yourself - which is really a bit pointless. To do so, you would read in the text files to a dataset, then process to add page breaks/formatting etc., then report them out to RTF/PDF.
10-31-2016 05:58 AM
If you read the details section of the pagesize option you'll see that page size doesn't apply to PDF/RTF. You have other options for page control, specifically pagestart option.