• gojyuan

    Thank you everyone for your suggestions. I finally have it working, including a form that has a background image. The styling is very touch and go - very easy to have it working one moment and not the next.

    My application is a hospitality reservation / crm system ( my own business ). I was surprised at the comments regarding printing - is there another alternative that I am not aware of. Are most pythonista apps technical or gaming?

    I use a lot of html for email layouts so to be able to use the same for printing is very convenient. and the app allows me to modify the template anytime.

    <body>
        <img src="{logo}" alt="logo.jpg" width="50" height="50">
        <h1>Guest Details</h1>
        <hr>
        <table>
            <tr>
    ...
    
    template = utils.template_path + '/GuestCheckIn.html'
    text = None
    with open(template,'r', encoding='utf-8') as infile:
        txt = infile.read() 
                            
    if txt is not None:         
        txt = txt.replace('{logo}',utils.get_file_url(utils.template_path + '/' + 'logo.jpg'))
        txt = txt.replace('{fullname}', self.booking.customer.full_name)
        txt = txt.replace('{fulladdr}', self.booking.customer.full_address(' '))
    ...
    utils.print_html_orientation(txt)
    

    posted in Pythonista read more
  • gojyuan

    Thank you, will give this a try. I am assuming i will be using this stream in the fileurl specified for the image.

    posted in Pythonista read more
  • gojyuan

    Hi,
    I am a beginner in Pythonista and ios ( 2 months ) coming from a windows c# environment ( 37 years )
    I am converting an existing c# application and trying to create printable html reports and forms ( not really sure what other options I have).

    I am printing the reports by opening the html template and using airprint code that I have found on this forum ( print_html_orientation )

    So far all has been good but now I am trying to include images and not having much luck. My application path structure has all of the html files in a separate directory..

    I have seen threads that suggest that the script and images be in the same directory but this hasn’t worked. I have tried to use a file url in the HTML base element and also a file url when specifying the name of the image but this does not work as well.

    Am I missing something regarding how the html is interpreted prior to printing.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!