2014 May 06 6:35 PM
Hi ABAP experts,
We have converted an existing invoice layout smart form into PDF layout in print preview mode. However, we have an issue with PDF layout alignment. Earlier, it used to print the documents correctly (layout is aligned properly at the middle of the page). But when use this 'PDF' preview layout (triggered from smart form) the layout is left aligned/ larger right margin (but not at the middle).
We have gone through the existing forum links on this PDF layout generating from smart form. But no luck on this left alignment issue. Do we need to modify the OTF data that is being populated in the layout. Can it be modifed with the position of the layout dynamically. Please advise.
Technical team has used "CONVERT_OTF_2_PDF" to populate the OTF data.
In SAP note # 323736 (issued in 2006), the below limitation was mentioned. But do we have any way to resolve this page alignment issue.
Page size for SAPscript/SmartForms: PDF conversion uses the page format from the form definition as page size for the PDF document. If this has been defined larger than the page size that is actually used (for example for INCH12, INCH11 and so on), a reduced document or a larger right margin are the
result when you view/print in Acrobat Reader.
Thanks in advance.
Regards,
Satya
2014 May 06 7:07 PM
Hi,
The only thing that I understood for sure is that you are using obsolete FM CONVERT_OTF_2_PDF to try to do something with PDFs. The correct FM for converting (newly created) OTF to other Formats (including PDF) is CONVERT_OTF.
cheers
Janis
2014 May 06 7:07 PM
Hi,
The only thing that I understood for sure is that you are using obsolete FM CONVERT_OTF_2_PDF to try to do something with PDFs. The correct FM for converting (newly created) OTF to other Formats (including PDF) is CONVERT_OTF.
cheers
Janis
2014 May 06 7:34 PM
Hi Janis,
The function module CONVERT_OTF_2_PDF is calling the CONVERT_OTF inside. And we are not sure, what difference is going to make if we use this CONVERT_OTF directly.
Please correct me If I'm wrong.
Regards,
Satya
2014 May 06 7:47 PM
One can never be sure without testing, but I'd expect it to work correctly then. In english the obsolete FM has no description in my Basis release 702 ERP system, but in german it says so explicitly - "Please do not use, but CONVERT_OTF!! This FM is deprecated":
There is not a single use of CONVERT_OTF_2_PDF to be found in our system; there are many uses (in SAP standard and in our custom logic) of CONVERT_OTF.
If the standard PDF preview for some reason is not working correctly on Basis release 700 or later, I'd check if some notes are missing perhaps, and if not - report it to OSS.
cheers
Janis
2014 May 06 7:24 PM
Hi,
if you want to see it in preview mode PDF, just when you display the smarform (preview) then in the command write PDF!
it wil convert automatically to PDF without code anything. Try it.
Regards
Miguel
2014 May 06 7:31 PM
Hi Miguel,
We tried that option of "PDF!" but it didn't work for this smart form. Do we need to include/activate any option for this in the smart form.
Regards,
Satya
2014 May 06 7:54 PM
Nop, it is standard, no need to activive anything, check this
just need to view the smartform first, preview mode and the write the PDF! on the command line of SAP.
Regards
Miguel
2014 May 07 1:21 PM
Hi Satya,
Can you please try with SSFCOMP_OTF_OUTPUT once. I hope it may solve your alignment issue. Also please check the page size to be sure.
Regards,
Anubhab
2014 May 13 6:05 AM
Hi Satya,
'We tried that option of "PDF!" but it didn't work for this smart form. Do we need to include/activate any option for this in the smart form.'..What do you mean by it didn't work for this smartform.?
Execute your smartform and when you are in the print preview mode of the form means you get the output, then type PDF! in the command and hit ENTER. A popup will get displayed if you are using windows 7
or Allow and decline type of radiobutton option will be displayed if you are using Windows XP. So just click Allow and your smartform output will be displayed in pdf. Now you can save the pdf output file while clicking the save option in PDF. Your smartform output will be aligned properly in the PDF.
You don't need any activation or any FM for converting the output in pdf for this.
Basically, we do this to attach the smartform output in test plan.
NOTE: This is for only to get the output in PDF while you are in Print preview of the form.
Regards
Syed
2014 May 12 11:32 PM
Hi All,
We tried to do that by using CONVERT_OTF but still the pdf file is not aligned (left aligned) properly and getting more space on the right side. Do we need to convert that into BINARY format before we download it into '.pdf' file with proper alignment. Is there any way to adjust the alignment.
Thank you.
Best Regards,
Satya
2014 May 13 7:49 AM
Hi again,
I must be too fixated on how we do pdfs in our solution to grasp the problem... What I don't get is (and maybe your technical team can answer): if your solution prints to output devices of type PDF1 (or customer adjusted copies thereof), where and why does the custom logic to convert otf to pdf come into play? And vice versa: if your solution does custom convert from otf to pdf - where and why does the output device of type PDF1 come into play..?
And where and why does the mismatch between the page size in form(s) and converted data actually occurs - because of the page size(s) assigned to output device of type PDF1?
cheers
Janis
2014 Oct 16 5:57 AM
Hi Friends,
How to set middle alignment in table of SAP Smartform as i mention in image , Please tell me how to do that
2014 Oct 16 6:48 AM
Hi,
AFAIK, there is only a cumbersome an unreliable workaround, if you are certain all table rows will be of the same height - as is often the case in table header. Then you can use "Space before" attribute of Paragraph format assigned to the second cell to "push" the content down, say, half a line. Set the attribute to about 0.5 LN (it's impossible to give precise value, you'll have to play around with it).
I always feel a bit guilty and "dirty" when I have to talk the owner of requirement out of wanting to have vertical centering in smartform table cell...
cheers
Jānis
2014 Oct 16 8:41 AM
Hi,
Not fixed height of the cell , some time output in 2 line some time in single line
2014 Oct 16 9:20 AM
Hi,
That IMO borders on being impossible to implement in a transparent and maintainable (future-proof) way. One could try to create two row types - for single and double line (with different Paragraph formats) and try to determine in advance (via ABAP node or something), which row type should be used for output. But what if there comes time, when there is a row of 3 line height..? One has to add another row type then... What if the client suddenly wants more than one column vertically centered? The row type number doubles... There is no way that I know of to set the "Space before" dynamically, so I'd definetely also try to talk the client out of trying to have the vertical centering.
EDIT in: actually, if you can devise a reliable algorithm to determine the resulting row height and the height of cell to be centered before they are output, assigning a paragraph format dynamically could be achieved via dynamic text node. Meaning - you predefine the paragraph formats with the necessary "Space before", calculate which paragraph format would be needed, and output the cell contents via dynamic text node (instead of the "normal" one), where you can assign the necessary paragraph format. It's significantly more maintainable than having to multiply rows, but I'd still try to talk the client out of it...
cheers
Janis
Message was edited by: Jānis B