function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TylorTylor 

PDF出力時の向き

お世話になっております。

 

Visualforce Pagesにて、タグ「apex:page」の属性「renderAs」を使用して

PDF出力すると、縦向きのPDFが出力されるのですが、

横向きに出力する方法はありますでしょうか?

 

Best Answer chosen by Admin (Salesforce Developers) 
timatima

こんにちわ。

他の方と同様で私もCSSで実現しています。

参考にした記事から抜粋してみました。

<style type="text/css"> @page { /* Landscape orientation */ size:landscape; /* Put page numbers in the bottom right corner of each page in the pdf document. */ @bottom-right { content: "Page " counter(page); } } </style>

http://community.salesforce.com/sforce/board/message?message.uid=161817

 

 

ご参考までに。

All Answers

nabemarunabemaru

スタイルシートで

@page {

size: 29.7cm 21.0cm;

margin-top: 1.0cm;

margin-left: 1.0cm;

margin-right: 1.0cm;

margin-bottom: 1.0cm;

としたら、横向きになるかもしれないです。

 

いちいち記載するのが面倒だと、

CSSファイル(pdf_style.css)を作成して、

そのCSSファイルを静的リソースにUP(pdf_styleというZIPにしたとします)します。

 

VisualForce側では、 

<apex:stylesheet value="{!URLFOR($Resource.pdf_style, 'pdf_style.css')}"/>

というかんじで読み込むといいかもしれないです。

 

私は、ここの内容 とかここの内容 を参考にしています。

 

timatima

こんにちわ。

他の方と同様で私もCSSで実現しています。

参考にした記事から抜粋してみました。

<style type="text/css"> @page { /* Landscape orientation */ size:landscape; /* Put page numbers in the bottom right corner of each page in the pdf document. */ @bottom-right { content: "Page " counter(page); } } </style>

http://community.salesforce.com/sforce/board/message?message.uid=161817

 

 

ご参考までに。

This was selected as the best answer
TylorTylor

nabemaru  さん

tima さん

 


両者の方法、どちらでもとてもすばらしいです!!

横向きに表示することができました。 :smileyvery-happy:

 

tima さんの方は、フッターにページ数も表示できるのですね!すごいです!

他にも総ページ等、色々でるんですかね~

 

とりあえす、助かりました! ありがとうございました!!

 

 

2010-03-04 09:35 AM
にTylorにより編集されたメッセージ