Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
10php
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yu Kimiduka
10php
Commits
a9330410
Commit
a9330410
authored
Jul 14, 2016
by
君塚 悠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
プログラム作製(pdf_create.php:PDF生成)
parent
004c4c8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
rss.php
php/php10/day06-3/rss.php
+1
-1
pdf_create.php
php/php10/day07-1/pdf_create.php
+39
-0
No files found.
php/php10/day06-3/rss.php
View file @
a9330410
...
@@ -20,7 +20,7 @@ foreach ($objXml -> site as $site) {
...
@@ -20,7 +20,7 @@ foreach ($objXml -> site as $site) {
?>
?>
<dl>
<dl>
<dt
style =
"font-weight:bold;"
>
<?php
<dt
style =
"font-weight:bold;"
>
<?php
//タイトルが
//タイトルが
nullや空でな場合はEUC-JPに変換して出力
if
(
!
is_null
(
$site
->
title
)
&&
$site
->
title
!=
""
)
{
if
(
!
is_null
(
$site
->
title
)
&&
$site
->
title
!=
""
)
{
print
(
mb_convert_encoding
(
$site
->
title
,
"EUC-JP"
,
"auto"
));
print
(
mb_convert_encoding
(
$site
->
title
,
"EUC-JP"
,
"auto"
));
}
else
{
}
else
{
...
...
php/php10/day07-1/pdf_create.php
0 → 100644
View file @
a9330410
<?php
//PDFlib/PDIによるPDFの自動生成
//PDFファイル生成
$objPdf
=
pdf_new
();
pdf_begin_document
(
$objPdf
,
""
,
""
);
//PDFの構成文書設定(Author -> Yoshihiro yamada)
pdf_set_info
(
$obfPdf
,
"Author"
,
"Yoshihiro yamada"
);
//テンプレートとなるファイルを指定する
$objTmp
=
pdf_open_pdi
(
$objPdf
,
dirname
(
__FILE__
)
.
"/template.pdf"
,
""
,
0
);
//利用するページを選択する
$objPag
=
pdf_open_pdi_page
(
$objPdf
,
$objTmp
,
1
,
""
);
//PDFファイルに新規にページを追加する
pdf_begin_page_ext
(
$objPdf
,
10
,
10
,
''
);
//テンプレートとなるファイルを作成したページに貼り付ける
//adjustpageを指定することで、サイズが自動調整される
pdf_fit_pdi_page
(
$objPdf
,
$objPag
,
0
,
0
,
"adjustpage"
);
//フォントや行間などを設定する
$objFnt
=
pdf_load_font
(
$objpdf
,
"HeiseiMin-W3"
,
"EUC-H"
,
""
);
pdf_serfont
(
$obgPdf
,
$objFnt
,
14
);
pdf_set_valuse
(
$objPdf
,
"leading"
,
20
);
pdf_set_text_pos
(
$objPdf
,
100
,
600
);
//作製したPDFに文字列を出力する
pdf_show
(
$objPdf
,
"サーバサイド技術の学び舎 - WINGS"
);
pdf_continue_text
(
$objPdf
,
"http://www.wings.msn.to/"
);
pdf_end_page
(
$objPdf
);
pdf_close
(
$ogjPdf
);
pdf_close_pdi
(
$objPdf
,
$objTmp
);
header
(
"Content-type: application/pdf"
);
header
(
"Cotent-disposition: attachment; filename = result.pdf"
);
print
(
pdf_get_buffer
(
$ogjPdgf
)
pdf_delete
(
$objPdf
);
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment