parser.add_option("-t", "--test", dest="test", help="Test checks against swf", action="store_true")
(options, args) = parser.parse_args()
- if options.test:
- TESTMODE = True
+ TESTMODE = options.test
app = wx.PySimpleApp()
model = Model.load(args[0])
--- /dev/null
+from sys import *
+from pdflib_py import *
+p = PDF_new()
+PDF_open_file(p, "smalltext.pdf")
+
+PDF_set_parameter(p, "usercoordinates", "true")
+
+PDF_set_info(p, "Creator", "smalltext.py")
+PDF_begin_page(p, 612, 200)
+font = PDF_load_font(p, "Helvetica", "host", "")
+
+PDF_setfont(p, font, 6.0)
+PDF_set_text_pos(p, 40, 100);PDF_show(p, "|")
+PDF_set_text_pos(p, 80, 100);PDF_show(p, "i")
+PDF_set_text_pos(p, 120, 100);PDF_show(p, "l")
+PDF_set_text_pos(p, 160, 100);PDF_show(p, "-")
+
+PDF_setfont(p, font, 9.0)
+PDF_set_text_pos(p, 40, 50);PDF_show(p, "|")
+PDF_set_text_pos(p, 80, 50);PDF_show(p, "i")
+PDF_set_text_pos(p, 120, 50);PDF_show(p, "l")
+PDF_set_text_pos(p, 160, 50);PDF_show(p, "-")
+
+PDF_end_page(p)
+PDF_close(p)
+PDF_delete(p);
--- /dev/null
+require File.dirname(__FILE__) + '/spec_helper'
+
+describe "pdf conversion" do
+ convert_file "smalltext.pdf" do
+ area_at(37,93,44,103).should_not_be_plain_colored
+ area_at(77,94,86,104).should_not_be_plain_colored
+ area_at(117,94,123,104).should_not_be_plain_colored
+ area_at(157,94,165,103).should_not_be_plain_colored
+ area_at(37,139,45,155).should_not_be_plain_colored
+ area_at(76,139,85,154).should_not_be_plain_colored
+ area_at(116,142,125,152).should_not_be_plain_colored
+ area_at(155,145,167,151).should_not_be_plain_colored
+ area_at(27,110,180,115).should_be_plain_colored
+ end
+end