Worksheet.pm 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  1. # DISCLAIMER OF WARRANTY
  2. # Because this software is licensed free of charge, there is no warranty for the software,
  3. # to the extent permitted by applicable law. Except when otherwise stated in writing
  4. # the copyright holders and/or other parties provide the software "as is" without
  5. # warranty of any kind, either expressed or implied, including, but not limited to,
  6. # the implied warranties of merchantability and fitness for a particular purpose.
  7. # The entire risk as to the quality and performance of the software is with you.
  8. # Should the software prove defective, you assume the cost of all necessary
  9. # servicing, repair, or correction.
  10. # In no event unless required by applicable law or agreed to in writing will any
  11. # copyright holder, or any other party who may modify and/or redistribute the software
  12. # as permitted by the above licence, be liable to you for damages, including any general,
  13. # special, incidental, or consequential damages arising out of the use or inability
  14. # to use the software (including but not limited to loss of data or data being rendered
  15. # inaccurate or losses sustained by you or third parties or a failure of the software
  16. # to operate with any other software), even if such holder or other party
  17. # has been advised of the possibility of such damages.
  18. # AUTHOR
  19. # Current maintainer 0.40+: John McNamara jmcnamara@cpan.org
  20. # Maintainer 0.27-0.33: Gabor Szabo szabgab@cpan.org
  21. # Original author: Kawai Takanori (Hippo2000) kwitknr@cpan.org
  22. # COPYRIGHT
  23. # Copyright (c) 2009-2010 John McNamara
  24. # Copyright (c) 2006-2008 Gabor Szabo
  25. # Copyright (c) 2000-2006 Kawai Takanori
  26. # All rights reserved. This is free software. You may distribute under the terms of
  27. # the Artistic License(full text of the Artistic License http://dev.perl.org/licenses/artistic.html).
  28. package Spreadsheet::ParseExcel::Worksheet;
  29. ###############################################################################
  30. #
  31. # Spreadsheet::ParseExcel::Worksheet - A class for Worksheets.
  32. #
  33. # Used in conjunction with Spreadsheet::ParseExcel.
  34. #
  35. # Copyright (c) 2009 John McNamara
  36. # Copyright (c) 2006-2008 Gabor Szabo
  37. # Copyright (c) 2000-2006 Kawai Takanori
  38. #
  39. # perltidy with standard settings.
  40. #
  41. # Documentation after __END__
  42. #
  43. use strict;
  44. use warnings;
  45. use Scalar::Util qw(weaken);
  46. our $VERSION = '0.57';
  47. ###############################################################################
  48. #
  49. # new()
  50. #
  51. sub new {
  52. my ( $class, %properties ) = @_;
  53. my $self = \%properties;
  54. weaken $self->{_Book};
  55. $self->{Cells} = undef;
  56. $self->{DefColWidth} = 8.43;
  57. return bless $self, $class;
  58. }
  59. ###############################################################################
  60. #
  61. # get_cell( $row, $col )
  62. #
  63. # Returns the Cell object at row $row and column $col, if defined.
  64. #
  65. sub get_cell {
  66. my ( $self, $row, $col ) = @_;
  67. if ( !defined $row
  68. || !defined $col
  69. || !defined $self->{MaxRow}
  70. || !defined $self->{MaxCol} )
  71. {
  72. # Return undef if no arguments are given or if no cells are defined.
  73. return undef;
  74. }
  75. elsif ($row < $self->{MinRow}
  76. || $row > $self->{MaxRow}
  77. || $col < $self->{MinCol}
  78. || $col > $self->{MaxCol} )
  79. {
  80. # Return undef if outside allowable row/col range.
  81. return undef;
  82. }
  83. else {
  84. # Return the Cell object.
  85. return $self->{Cells}->[$row]->[$col];
  86. }
  87. }
  88. ###############################################################################
  89. #
  90. # row_range()
  91. #
  92. # Returns a two-element list ($min, $max) containing the minimum and maximum
  93. # defined rows in the worksheet.
  94. #
  95. # If there is no row defined $max is smaller than $min.
  96. #
  97. sub row_range {
  98. my $self = shift;
  99. my $min = $self->{MinRow} || 0;
  100. my $max = defined( $self->{MaxRow} ) ? $self->{MaxRow} : ( $min - 1 );
  101. return ( $min, $max );
  102. }
  103. ###############################################################################
  104. #
  105. # col_range()
  106. #
  107. # Returns a two-element list ($min, $max) containing the minimum and maximum
  108. # defined cols in the worksheet.
  109. #
  110. # If there is no column defined $max is smaller than $min.
  111. #
  112. sub col_range {
  113. my $self = shift;
  114. my $min = $self->{MinCol} || 0;
  115. my $max = defined( $self->{MaxCol} ) ? $self->{MaxCol} : ( $min - 1 );
  116. return ( $min, $max );
  117. }
  118. ###############################################################################
  119. #
  120. # get_name()
  121. #
  122. # Returns the name of the worksheet.
  123. #
  124. sub get_name {
  125. my $self = shift;
  126. return $self->{Name};
  127. }
  128. ###############################################################################
  129. #
  130. # sheet_num()
  131. #
  132. sub sheet_num {
  133. my $self = shift;
  134. return $self->{_SheetNo};
  135. }
  136. ###############################################################################
  137. #
  138. # get_h_pagebreaks()
  139. #
  140. # Returns an array ref of row numbers where a horizontal page break occurs.
  141. #
  142. sub get_h_pagebreaks {
  143. my $self = shift;
  144. return $self->{HPageBreak};
  145. }
  146. ###############################################################################
  147. #
  148. # get_v_pagebreaks()
  149. #
  150. # Returns an array ref of column numbers where a vertical page break occurs.
  151. #
  152. sub get_v_pagebreaks {
  153. my $self = shift;
  154. return $self->{VPageBreak};
  155. }
  156. ###############################################################################
  157. #
  158. # get_merged_areas()
  159. #
  160. # Returns an array ref of cells that are merged.
  161. #
  162. sub get_merged_areas {
  163. my $self = shift;
  164. return $self->{MergedArea};
  165. }
  166. ###############################################################################
  167. #
  168. # get_row_heights()
  169. #
  170. # Returns an array_ref of row heights.
  171. #
  172. sub get_row_heights {
  173. my $self = shift;
  174. return @{ $self->{RowHeight} };
  175. }
  176. ###############################################################################
  177. #
  178. # get_col_widths()
  179. #
  180. # Returns an array_ref of column widths.
  181. #
  182. sub get_col_widths {
  183. my $self = shift;
  184. return @{ $self->{ColWidth} };
  185. }
  186. ###############################################################################
  187. #
  188. # get_default_row_height()
  189. #
  190. # Returns the default row height for the worksheet. Generally 12.75.
  191. #
  192. sub get_default_row_height {
  193. my $self = shift;
  194. return $self->{DefRowHeight};
  195. }
  196. ###############################################################################
  197. #
  198. # get_default_col_width()
  199. #
  200. # Returns the default column width for the worksheet. Generally 8.43.
  201. #
  202. sub get_default_col_width {
  203. my $self = shift;
  204. return $self->{DefColWidth};
  205. }
  206. ###############################################################################
  207. #
  208. # _get_row_properties()
  209. #
  210. # Returns an array_ref of row properties.
  211. # TODO. This is a placeholder for a future method.
  212. #
  213. sub _get_row_properties {
  214. my $self = shift;
  215. return $self->{RowProperties};
  216. }
  217. ###############################################################################
  218. #
  219. # _get_col_properties()
  220. #
  221. # Returns an array_ref of column properties.
  222. # TODO. This is a placeholder for a future method.
  223. #
  224. sub _get_col_properties {
  225. my $self = shift;
  226. return $self->{ColProperties};
  227. }
  228. ###############################################################################
  229. #
  230. # get_header()
  231. #
  232. # Returns the worksheet header string.
  233. #
  234. sub get_header {
  235. my $self = shift;
  236. return $self->{Header};
  237. }
  238. ###############################################################################
  239. #
  240. # get_footer()
  241. #
  242. # Returns the worksheet footer string.
  243. #
  244. sub get_footer {
  245. my $self = shift;
  246. return $self->{Footer};
  247. }
  248. ###############################################################################
  249. #
  250. # get_margin_left()
  251. #
  252. # Returns the left margin of the worksheet in inches.
  253. #
  254. sub get_margin_left {
  255. my $self = shift;
  256. return $self->{LeftMargin};
  257. }
  258. ###############################################################################
  259. #
  260. # get_margin_right()
  261. #
  262. # Returns the right margin of the worksheet in inches.
  263. #
  264. sub get_margin_right {
  265. my $self = shift;
  266. return $self->{RightMargin};
  267. }
  268. ###############################################################################
  269. #
  270. # get_margin_top()
  271. #
  272. # Returns the top margin of the worksheet in inches.
  273. #
  274. sub get_margin_top {
  275. my $self = shift;
  276. return $self->{TopMargin};
  277. }
  278. ###############################################################################
  279. #
  280. # get_margin_bottom()
  281. #
  282. # Returns the bottom margin of the worksheet in inches.
  283. #
  284. sub get_margin_bottom {
  285. my $self = shift;
  286. return $self->{BottomMargin};
  287. }
  288. ###############################################################################
  289. #
  290. # get_margin_header()
  291. #
  292. # Returns the header margin of the worksheet in inches.
  293. #
  294. sub get_margin_header {
  295. my $self = shift;
  296. return $self->{HeaderMargin};
  297. }
  298. ###############################################################################
  299. #
  300. # get_margin_footer()
  301. #
  302. # Returns the footer margin of the worksheet in inches.
  303. #
  304. sub get_margin_footer {
  305. my $self = shift;
  306. return $self->{FooterMargin};
  307. }
  308. ###############################################################################
  309. #
  310. # get_paper()
  311. #
  312. # Returns the printer paper size.
  313. #
  314. sub get_paper {
  315. my $self = shift;
  316. return $self->{PaperSize};
  317. }
  318. ###############################################################################
  319. #
  320. # get_start_page()
  321. #
  322. # Returns the page number that printing will start from.
  323. #
  324. sub get_start_page {
  325. my $self = shift;
  326. # Only return the page number if the "First page number" option is set.
  327. if ( $self->{UsePage} ) {
  328. return $self->{PageStart};
  329. }
  330. else {
  331. return 0;
  332. }
  333. }
  334. ###############################################################################
  335. #
  336. # get_print_order()
  337. #
  338. # Returns the Worksheet page printing order.
  339. #
  340. sub get_print_order {
  341. my $self = shift;
  342. return $self->{LeftToRight};
  343. }
  344. ###############################################################################
  345. #
  346. # get_print_scale()
  347. #
  348. # Returns the workbook scale for printing.
  349. #
  350. sub get_print_scale {
  351. my $self = shift;
  352. return $self->{Scale};
  353. }
  354. ###############################################################################
  355. #
  356. # get_fit_to_pages()
  357. #
  358. # Returns the number of pages wide and high that the printed worksheet page
  359. # will fit to.
  360. #
  361. sub get_fit_to_pages {
  362. my $self = shift;
  363. if ( !$self->{PageFit} ) {
  364. return ( 0, 0 );
  365. }
  366. else {
  367. return ( $self->{FitWidth}, $self->{FitHeight} );
  368. }
  369. }
  370. ###############################################################################
  371. #
  372. # is_portrait()
  373. #
  374. # Returns true if the worksheet has been set for printing in portrait mode.
  375. #
  376. sub is_portrait {
  377. my $self = shift;
  378. return $self->{Landscape};
  379. }
  380. ###############################################################################
  381. #
  382. # is_centered_horizontally()
  383. #
  384. # Returns true if the worksheet has been centered horizontally for printing.
  385. #
  386. sub is_centered_horizontally {
  387. my $self = shift;
  388. return $self->{HCenter};
  389. }
  390. ###############################################################################
  391. #
  392. # is_centered_vertically()
  393. #
  394. # Returns true if the worksheet has been centered vertically for printing.
  395. #
  396. sub is_centered_vertically {
  397. my $self = shift;
  398. return $self->{HCenter};
  399. }
  400. ###############################################################################
  401. #
  402. # is_print_gridlines()
  403. #
  404. # Returns true if the worksheet print "gridlines" option is turned on.
  405. #
  406. sub is_print_gridlines {
  407. my $self = shift;
  408. return $self->{PrintGrid};
  409. }
  410. ###############################################################################
  411. #
  412. # is_print_row_col_headers()
  413. #
  414. # Returns true if the worksheet print "row and column headings" option is on.
  415. #
  416. sub is_print_row_col_headers {
  417. my $self = shift;
  418. return $self->{PrintHeaders};
  419. }
  420. ###############################################################################
  421. #
  422. # is_print_black_and_white()
  423. #
  424. # Returns true if the worksheet print "black and white" option is turned on.
  425. #
  426. sub is_print_black_and_white {
  427. my $self = shift;
  428. return $self->{NoColor};
  429. }
  430. ###############################################################################
  431. #
  432. # is_print_draft()
  433. #
  434. # Returns true if the worksheet print "draft" option is turned on.
  435. #
  436. sub is_print_draft {
  437. my $self = shift;
  438. return $self->{Draft};
  439. }
  440. ###############################################################################
  441. #
  442. # is_print_comments()
  443. #
  444. # Returns true if the worksheet print "comments" option is turned on.
  445. #
  446. sub is_print_comments {
  447. my $self = shift;
  448. return $self->{Notes};
  449. }
  450. ###############################################################################
  451. #
  452. # Mapping between legacy method names and new names.
  453. #
  454. {
  455. no warnings; # Ignore warnings about variables used only once.
  456. *sheetNo = *sheet_num;
  457. *Cell = *get_cell;
  458. *RowRange = *row_range;
  459. *ColRange = *col_range;
  460. }
  461. 1;
  462. __END__
  463. =pod
  464. =head1 NAME
  465. Spreadsheet::ParseExcel::Worksheet - A class for Worksheets.
  466. =head1 SYNOPSIS
  467. See the documentation for L<Spreadsheet::ParseExcel>.
  468. =head1 DESCRIPTION
  469. This module is used in conjunction with Spreadsheet::ParseExcel. See the documentation for Spreadsheet::ParseExcel.
  470. =head1 Methods
  471. The C<Spreadsheet::ParseExcel::Worksheet> class encapsulates the properties of an Excel worksheet. It has the following methods:
  472. $worksheet->get_cell()
  473. $worksheet->row_range()
  474. $worksheet->col_range()
  475. $worksheet->get_name()
  476. $worksheet->get_h_pagebreaks()
  477. $worksheet->get_v_pagebreaks()
  478. $worksheet->get_merged_areas()
  479. $worksheet->get_row_heights()
  480. $worksheet->get_col_widths()
  481. $worksheet->get_default_row_height()
  482. $worksheet->get_default_col_width()
  483. $worksheet->get_header()
  484. $worksheet->get_footer()
  485. $worksheet->get_margin_left()
  486. $worksheet->get_margin_right()
  487. $worksheet->get_margin_top()
  488. $worksheet->get_margin_bottom()
  489. $worksheet->get_margin_header()
  490. $worksheet->get_margin_footer()
  491. $worksheet->get_paper()
  492. $worksheet->get_start_page()
  493. $worksheet->get_print_order()
  494. $worksheet->get_print_scale()
  495. $worksheet->get_fit_to_pages()
  496. $worksheet->is_portrait()
  497. $worksheet->is_centered_horizontally()
  498. $worksheet->is_centered_vertically()
  499. $worksheet->is_print_gridlines()
  500. $worksheet->is_print_row_col_headers()
  501. $worksheet->is_print_black_and_white()
  502. $worksheet->is_print_draft()
  503. $worksheet->is_print_comments()
  504. =head2 get_cell($row, $col)
  505. Return the L</Cell> object at row C<$row> and column C<$col> if it is defined. Otherwise returns undef.
  506. my $cell = $worksheet->get_cell($row, $col);
  507. =head2 row_range()
  508. Returns a two-element list C<($min, $max)> containing the minimum and maximum defined rows in the worksheet. If there is no row defined C<$max> is smaller than C<$min>.
  509. my ( $row_min, $row_max ) = $worksheet->row_range();
  510. =head2 col_range()
  511. Returns a two-element list C<($min, $max)> containing the minimum and maximum of defined columns in the worksheet. If there is no column defined C<$max> is smaller than C<$min>.
  512. my ( $col_min, $col_max ) = $worksheet->col_range();
  513. =head2 col_range()
  514. The C<col_range()> method returns TODO.
  515. my $col_range = $worksheet->col_range();
  516. Returns 0 if the property isn't set.
  517. =head2 get_name()
  518. The C<get_name()> method returns the name of the worksheet.
  519. my $name = $worksheet->get_name();
  520. =head2 get_h_pagebreaks()
  521. The C<get_h_pagebreaks()> method returns an array ref of row numbers where a horizontal page break occurs.
  522. my $h_pagebreaks = $worksheet->get_h_pagebreaks();
  523. Returns C<undef> if there are no pagebreaks.
  524. =head2 get_v_pagebreaks()
  525. The C<get_v_pagebreaks()> method returns an array ref of column numbers where a vertical page break occurs.
  526. my $v_pagebreaks = $worksheet->get_v_pagebreaks();
  527. Returns C<undef> if there are no pagebreaks.
  528. =head2 get_merged_areas()
  529. The C<get_merged_areas()> method returns an array ref of cells that are merged.
  530. my $merged_areas = $worksheet->get_merged_areas();
  531. Each merged area is represented as follows:
  532. [ $start_row, $start_col, $end_row, $end_col]
  533. Returns C<undef> if there are no merged areas.
  534. =head2 get_row_heights()
  535. The C<get_row_heights()> method returns an array_ref of row heights.
  536. my $row_heights = $worksheet->get_row_heights();
  537. Returns C<undef> if the property isn't set.
  538. =head2 get_col_widths()
  539. The C<get_col_widths()> method returns an array_ref of column widths.
  540. my $col_widths = $worksheet->get_col_widths();
  541. Returns C<undef> if the property isn't set.
  542. =head2 get_default_row_height()
  543. The C<get_default_row_height()> method returns the default row height for the worksheet. Generally 12.75.
  544. my $default_row_height = $worksheet->get_default_row_height();
  545. =head2 get_default_col_width()
  546. The C<get_default_col_width()> method returns the default column width for the worksheet. Generally 8.43.
  547. my $default_col_width = $worksheet->get_default_col_width();
  548. =head2 get_header()
  549. The C<get_header()> method returns the worksheet header string. This string can contain control codes for alignment and font properties. Refer to the Excel on-line help on headers and footers or to the Spreadsheet::WriteExcel documentation for set_header().
  550. my $header = $worksheet->get_header();
  551. Returns C<undef> if the property isn't set.
  552. =head2 get_footer()
  553. The C<get_footer()> method returns the worksheet footer string. This string can contain control codes for alignment and font properties. Refer to the Excel on-line help on headers and footers or to the Spreadsheet::WriteExcel documentation for set_header().
  554. my $footer = $worksheet->get_footer();
  555. Returns C<undef> if the property isn't set.
  556. =head2 get_margin_left()
  557. The C<get_margin_left()> method returns the left margin of the worksheet in inches.
  558. my $margin_left = $worksheet->get_margin_left();
  559. Returns C<undef> if the property isn't set.
  560. =head2 get_margin_right()
  561. The C<get_margin_right()> method returns the right margin of the worksheet in inches.
  562. my $margin_right = $worksheet->get_margin_right();
  563. Returns C<undef> if the property isn't set.
  564. =head2 get_margin_top()
  565. The C<get_margin_top()> method returns the top margin of the worksheet in inches.
  566. my $margin_top = $worksheet->get_margin_top();
  567. Returns C<undef> if the property isn't set.
  568. =head2 get_margin_bottom()
  569. The C<get_margin_bottom()> method returns the bottom margin of the worksheet in inches.
  570. my $margin_bottom = $worksheet->get_margin_bottom();
  571. Returns C<undef> if the property isn't set.
  572. =head2 get_margin_header()
  573. The C<get_margin_header()> method returns the header margin of the worksheet in inches.
  574. my $margin_header = $worksheet->get_margin_header();
  575. Returns a default value of 0.5 if not set.
  576. =head2 get_margin_footer()
  577. The C<get_margin_footer()> method returns the footer margin of the worksheet in inches.
  578. my $margin_footer = $worksheet->get_margin_footer();
  579. Returns a default value of 0.5 if not set.
  580. =head2 get_paper()
  581. The C<get_paper()> method returns the printer paper size.
  582. my $paper = $worksheet->get_paper();
  583. The value corresponds to the formats shown below:
  584. Index Paper format Paper size
  585. ===== ============ ==========
  586. 0 Printer default -
  587. 1 Letter 8 1/2 x 11 in
  588. 2 Letter Small 8 1/2 x 11 in
  589. 3 Tabloid 11 x 17 in
  590. 4 Ledger 17 x 11 in
  591. 5 Legal 8 1/2 x 14 in
  592. 6 Statement 5 1/2 x 8 1/2 in
  593. 7 Executive 7 1/4 x 10 1/2 in
  594. 8 A3 297 x 420 mm
  595. 9 A4 210 x 297 mm
  596. 10 A4 Small 210 x 297 mm
  597. 11 A5 148 x 210 mm
  598. 12 B4 250 x 354 mm
  599. 13 B5 182 x 257 mm
  600. 14 Folio 8 1/2 x 13 in
  601. 15 Quarto 215 x 275 mm
  602. 16 - 10x14 in
  603. 17 - 11x17 in
  604. 18 Note 8 1/2 x 11 in
  605. 19 Envelope 9 3 7/8 x 8 7/8
  606. 20 Envelope 10 4 1/8 x 9 1/2
  607. 21 Envelope 11 4 1/2 x 10 3/8
  608. 22 Envelope 12 4 3/4 x 11
  609. 23 Envelope 14 5 x 11 1/2
  610. 24 C size sheet -
  611. 25 D size sheet -
  612. 26 E size sheet -
  613. 27 Envelope DL 110 x 220 mm
  614. 28 Envelope C3 324 x 458 mm
  615. 29 Envelope C4 229 x 324 mm
  616. 30 Envelope C5 162 x 229 mm
  617. 31 Envelope C6 114 x 162 mm
  618. 32 Envelope C65 114 x 229 mm
  619. 33 Envelope B4 250 x 353 mm
  620. 34 Envelope B5 176 x 250 mm
  621. 35 Envelope B6 176 x 125 mm
  622. 36 Envelope 110 x 230 mm
  623. 37 Monarch 3.875 x 7.5 in
  624. 38 Envelope 3 5/8 x 6 1/2 in
  625. 39 Fanfold 14 7/8 x 11 in
  626. 40 German Std Fanfold 8 1/2 x 12 in
  627. 41 German Legal Fanfold 8 1/2 x 13 in
  628. 256 User defined
  629. The two most common paper sizes are C<1 = "US Letter"> and C<9 = A4>. Returns 9 by default.
  630. =head2 get_start_page()
  631. The C<get_start_page()> method returns the page number that printing will start from.
  632. my $start_page = $worksheet->get_start_page();
  633. Returns 0 if the property isn't set.
  634. =head2 get_print_order()
  635. The C<get_print_order()> method returns 0 if the worksheet print "page order" is "Down then over" (the default) or 1 if it is "Over then down".
  636. my $print_order = $worksheet->get_print_order();
  637. =head2 get_print_scale()
  638. The C<get_print_scale()> method returns the workbook scale for printing. The print scale fctor can be in the range 10 .. 400.
  639. my $print_scale = $worksheet->get_print_scale();
  640. Returns 100 by default.
  641. =head2 get_fit_to_pages()
  642. The C<get_fit_to_pages()> method returns the number of pages wide and high that the printed worksheet page will fit to.
  643. my ($pages_wide, $pages_high) = $worksheet->get_fit_to_pages();
  644. Returns (0, 0) if the property isn't set.
  645. =head2 is_portrait()
  646. The C<is_portrait()> method returns true if the worksheet has been set for printing in portrait mode.
  647. my $is_portrait = $worksheet->is_portrait();
  648. Returns 0 if the worksheet has been set for printing in horizontal mode.
  649. =head2 is_centered_horizontally()
  650. The C<is_centered_horizontally()> method returns true if the worksheet has been centered horizontally for printing.
  651. my $is_centered_horizontally = $worksheet->is_centered_horizontally();
  652. Returns 0 if the property isn't set.
  653. =head2 is_centered_vertically()
  654. The C<is_centered_vertically()> method returns true if the worksheet has been centered vertically for printing.
  655. my $is_centered_vertically = $worksheet->is_centered_vertically();
  656. Returns 0 if the property isn't set.
  657. =head2 is_print_gridlines()
  658. The C<is_print_gridlines()> method returns true if the worksheet print "gridlines" option is turned on.
  659. my $is_print_gridlines = $worksheet->is_print_gridlines();
  660. Returns 0 if the property isn't set.
  661. =head2 is_print_row_col_headers()
  662. The C<is_print_row_col_headers()> method returns true if the worksheet print "row and column headings" option is turned on.
  663. my $is_print_row_col_headers = $worksheet->is_print_row_col_headers();
  664. Returns 0 if the property isn't set.
  665. =head2 is_print_black_and_white()
  666. The C<is_print_black_and_white()> method returns true if the worksheet print "black and white" option is turned on.
  667. my $is_print_black_and_white = $worksheet->is_print_black_and_white();
  668. Returns 0 if the property isn't set.
  669. =head2 is_print_draft()
  670. The C<is_print_draft()> method returns true if the worksheet print "draft" option is turned on.
  671. my $is_print_draft = $worksheet->is_print_draft();
  672. Returns 0 if the property isn't set.
  673. =head2 is_print_comments()
  674. The C<is_print_comments()> method returns true if the worksheet print "comments" option is turned on.
  675. my $is_print_comments = $worksheet->is_print_comments();
  676. Returns 0 if the property isn't set.
  677. =head1 AUTHOR
  678. Maintainer 0.40+: John McNamara jmcnamara@cpan.org
  679. Maintainer 0.27-0.33: Gabor Szabo szabgab@cpan.org
  680. Original author: Kawai Takanori kwitknr@cpan.org
  681. =head1 COPYRIGHT
  682. Copyright (c) 2009-2010 John McNamara
  683. Copyright (c) 2006-2008 Gabor Szabo
  684. Copyright (c) 2000-2006 Kawai Takanori
  685. All rights reserved.
  686. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
  687. =cut