Menu

Custom page size

Help
2009-04-21
2013-04-19
  • Alessio Calvio

    Alessio Calvio - 2009-04-21

    from flypdf import Pdf

    if __name__ == "__main__" :
      
        #pdf = flypdf.Pdf ()
       
        pdf = Pdf("L","mm",[100,100])
        pdf.AddPage ()
        pdf.SetFont ( 'Arial', 'B', 16 )
        pdf.Cell ( 40, 10, 'Hello World!' )
        pdf.Output ();

    I have written this code but return this error:

    Traceback (most recent call last):
      File "test.py", line 7, in <module>
        pdf = Pdf("L","mm",[100,50])
      File "/usr/lib/python2.5/site-packages/flypdf.py", line 172, in __init__
        this = _flypdf.new_Pdf(*args)
    NotImplementedError: Wrong number of arguments for overloaded function 'new_Pdf'.
      Possible C/C++ prototypes are:
        Pdf(PyObject *,std::string const &,std::string const &,std::string const &)
        Pdf(PyObject *,std::string const &,std::string const &)
        Pdf(PyObject *,std::string const &)
        Pdf(PyObject *)

    What a way to define a page to size 100mm * 50 mm ?

    Thanks for help and sorry for my bad english

     
  • Alessandro Molina

    Currently FlyPDF doesn't support custom page sizes.

    Available page sizes are:
    &quot;A3&quot;, &quot;A4&quot;, &quot;A5&quot;, &quot;Letter&quot;, &quot;Legal&quot;

     

Log in to post a comment.