{"id":53,"date":"2007-10-22T18:54:29","date_gmt":"2007-10-23T01:54:29","guid":{"rendered":"http:\/\/www.mfooz.com\/bblog\/?p=53"},"modified":"2008-03-02T14:35:01","modified_gmt":"2008-03-02T21:35:01","slug":"card-conversion","status":"publish","type":"post","link":"https:\/\/www.mfooz.com\/bblog\/?p=53","title":{"rendered":"card conversion"},"content":{"rendered":"<p>Goal: convert TPB PDFs to baseball-card size (2.5&#215;3.5) with a layout compatible with batch cutting.<\/p>\n<p><!--more--><\/p>\n<p>The 1973 PDF cards are 2.75&#215;4. Horizontal margins are 0.25, but vertical margins are only 0.125. <\/p>\n<p><i>Margins on Scott&#8217;s 1977 set are equal! 0.25, I think. Also, I looked at a set of his  as-shipped TPB cards. They are a little bigger than the PDFs, and are cut to 2.75 x 4.25, which is letter in eight pieces. They&#8217;re <em>not<\/em> cut to exactly the same size. I wonder why the PDFs aren&#8217;t laid out like the print job. Found out that the cards are laid out in Excel. (!)<\/p>\n<p>Might be interesting to format them like print jobs (2.75 x 4.25) instead of 2.5 x 3.5.<br \/>\n<\/i> <\/p>\n<p>Installed <a href=\"http:\/\/darwinports.com\/\">DarwinPorts<\/a> and used it to install netpbm, Image Magick, and Xpdf.<\/p>\n<p>netpbm documentation: <a href=\"http:\/\/netpbm.sourceforge.net\/doc\/\">main page<\/a> and <a href=\"http:\/\/netpbm.sourceforge.net\/doc\/directory.html\">directory<\/a>.<\/p>\n<p>Xpdf is interesting. pdftotext will extract text, though it would take some complex parsing to grok it. (<tt>pdftotext -f 20 -l 20 -upw lenny -layout 1973_Hitters.pdf<\/tt>)<\/p>\n<pre>\r\nBrooks Robinson                       Baltimore 1973   \r\nBats: Rsp                    TPB 2      Salary 2378    \r\n.264 vs L                    .254 vs R       POS\/R\/E   \r\n   0 - 10 Crazy Play!           0 - 10      3B\/AV\/17   \r\n  11 - 70        Error?        11 - 70                 \r\n  71 - 80      ss LO 2b        71 - 80                 \r\n  81 - 96 Park Effects         81 - 96                 \r\n  97 - 136 gcf 1B gcf          97 - 141                \r\n 137 - 151 lcf 2B rcf                      Pwr L: 1    \r\n 152 - 188    ss DP 2b        142 - 188 Pwr R: 2       \r\n 189 - 229 lcf 1B rcf         189 - 234                \r\n              lcf 3B rcf      235 - 235 Speed: 6       \r\n                cf SF cf      236 - 245 Steal: 2       \r\n                   HR         246 - 253 Jump: 1        \r\n                   HB         254 - 257 Bunt: 4        \r\n 230 - 261    ss RG 2b        258 - 295 Clutch: T      \r\n 262 - 335         BB         296 - 331 H&R: SP        \r\n 336 - 349          K         332 - 345 Injury: 4      \r\n 350 - 364     lfl 2B rfl                   Age: 36    \r\n 365 - 397    ss RG 2b        346 - 384     RBI: 72    \r\n 398 - 499      cf EF cf      385 - 499     BB: 55     \r\nAVG: .257       www.          AB: 549         K: 50    \r\nOBP: .326 TPBaseball           H: 141       SB: 2      \r\nSLG: .344        .com         HR:     9     CS: 0      \r\n<\/pre>\n<p>Info on the PDF file:<\/p>\n<pre>\r\n% pdfinfo -upw *** 1973_Hitters.pdf \r\nTitle:          1973 Batters.xls\r\nAuthor:         ***\r\nCreator:        PScript5.dll Version 5.2\r\nProducer:       Acrobat Distiller 8.0.0 (Windows)\r\nCreationDate:   Sat May 12 09:14:26 2007\r\nModDate:        Sat Aug 25 07:37:25 2007\r\nTagged:         no\r\nPages:          63\r\nEncrypted:      yes (print:yes copy:yes change:yes addNotes:yes)\r\nPage size:      612 x 792 pts (letter)\r\nFile size:      299175 bytes\r\nOptimized:      yes\r\nPDF version:    1.6\r\n\r\n% pdffonts -upw *** 1973_Hitters.pdf\r\nname                                 type              emb sub uni object ID\r\n------------------------------------ ----------------- --- --- --- ---------\r\nArialNarrow,Bold                     TrueType          no  no  no     224  0\r\nArialNarrow                          TrueType          no  no  no     225  0\r\nArialNarrow                          TrueType          no  no  no     195  0\r\nArialNarrow-Bold                     TrueType          no  no  no     196  0\r\nArial-BoldMT                         TrueType          no  no  no     197  0\r\n<\/pre>\n<p>pdftoppm will convert any page, but there&#8217;s some fishy font substitution. (<tt>pdftoppm -f 20 -l 20 -r 300 -gray -upw lenny -t1lib yes -freetype no 1973_Hitters.pdf x && pnmtopng x-000020.pgm > ! x.png<\/tt>)<\/p>\n<p><a href='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/pdftoppm-example.png' title='pdftoppm-example.png'><img src='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/pdftoppm-example.thumbnail.png' alt='pdftoppm-example.png' \/><\/a><\/p>\n<p>pdftops does better on the fonts, but one of the bold faces is still wrong. Turns out the Arial is converted to Helvetica, but the bold &#038; the narrowness is lost. That&#8217;s easy to fix.<\/p>\n<p>Does the bold on the on-base rolls enhance or diminish readability? Here&#8217;s no bold:<\/p>\n<p><a href='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/nobold1.png' title='nobold1.png'><img src='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/nobold.thumbnail.png' alt='nobold1.png' \/><\/a><\/p>\n<p>Wrote <tt>card_munge.pl<\/tt> to rearrange a selected range of pages.<\/p>\n<ol>\n<li>PDF to Postscript.\n<li>Tweak font definition.\n<li>Convert to PBM.\n<li>Cut out, pad, &#038; scale each card. 2.5&#215;3.5 in = 900&#215;1260 pels @ 360 dpi. (Should scale, <em>then<\/em> pad.)\n<li>Cat them together.\n<li>Convert to PNG with resolution specified.\n<\/ol>\n<p><a href='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/1973_team_hitters_026.png' title='1973_team_hitters_026.png'><img src='http:\/\/www.mfooz.com\/bblog\/wp-content\/uploads\/1973_team_hitters_026.thumbnail.png' alt='1973_team_hitters_026.png' \/><\/a><\/p>\n<p>To do:<\/p>\n<ul>\n<li>Fix font tweak to be more general.\n<li>Add guide lines\/page.\n<li>Border, scale to scale, border.\n<li>Try big cards (8 up).\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Goal: convert TPB PDFs to baseball-card size (2.5&#215;3.5) with a layout compatible with batch cutting.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-triple-play-baseball"],"_links":{"self":[{"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53"}],"version-history":[{"count":0,"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mfooz.com\/bblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}