예제 #1
0
    def URLToPDF(self, url, options=None):
        if (options == None):
            options = GrabzItPDFOptions.GrabzItPDFOptions()

        self.request = Request.Request(
            self.protocol + self.WebServicesBaseURLGet + self.TakePDF, False,
            options, url)
예제 #2
0
def convert_url_pdf(url):
    filename1 = datetime.now().strftime("%Y%m%d-%H%M%S")
    path = "tmp\pdf\{}.pdf".format(filename1)
    try:
        grabzIt = GrabzItClient.GrabzItClient(
            "YmI5YzRiY2U1NzI3NDNkMTk5OGJjNDRkNjNkNmUxNGE=",
            "RT8/Pz8/egY/Pz8/Vz8/OD8/Cz8RRj8/Pz8/PyEOMz8=")

        options = GrabzItPDFOptions.GrabzItPDFOptions()
        grabzIt.URLToPDF(url, options)
        grabzIt.SaveTo(path)
        grabzIt.SaveTo(path)
    except pdfcrowd.Error as why:
        # report the error
        sys.stderr.write('Pdfcrowd Error: {}\n'.format(why))

        # rethrow or handle the exception
        raise
    return path
예제 #3
0
    def HTMLToPDF(self, html, options=None):
        if (options == None):
            options = GrabzItPDFOptions.GrabzItPDFOptions()

        self.request = Request.Request(
            self.WebServicesBaseURLPost + self.TakePDF, True, options, html)