1. Help says IMPORT DOCUMENT Statement.StatementDocument FROM 'c:/mydocuments/myfile.doc'
Can you use BO.Attribute that contains the path of the file to import the document or does it have to be a hard coded path?
2. Has anyone IMPORTED or download a PDF from a URL so it can be imported into a Document Attribute so it can be displayed on a form?
HOW do you import a PDF from a URL
HOW do you import a PDF from a URL
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Re: HOW do you import a PDF from a URL
Hi,
Yes you can use an Attribute that contains the path and I suggest to do so.
I use this method in my apps. Also I do NOT recommend to store the documents in DB (the DB becomes huge and not good for the app).
In my apps I make a folder for each tenant and I store his documents in that folder.
MAKE DIRECTORY '<<SystemSettings.PDFInvoicesPath>>\'+CustomerCompanyBO.ID+'\DOCS'
I don't have time right now, but I can prepare a small bsv for you if you want, just let me know. Provide me details and I will do it closer to your needs (no charge)..
cheers,
Yes you can use an Attribute that contains the path and I suggest to do so.
I use this method in my apps. Also I do NOT recommend to store the documents in DB (the DB becomes huge and not good for the app).
In my apps I make a folder for each tenant and I store his documents in that folder.
MAKE DIRECTORY '<<SystemSettings.PDFInvoicesPath>>\'+CustomerCompanyBO.ID+'\DOCS'
I don't have time right now, but I can prepare a small bsv for you if you want, just let me know. Provide me details and I will do it closer to your needs (no charge)..
cheers,
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Re: HOW do you import a PDF from a URL
How can you download the pdf from a url and store it for future reference?
Roger is dealing with an API which provides a link to the PDF, but the link is temporary so we need to download it and store it for our own App to be able to access as needed in the future....
Cheers,
Callum
Roger is dealing with an API which provides a link to the PDF, but the link is temporary so we need to download it and store it for our own App to be able to access as needed in the future....
Cheers,
Callum
Re: HOW do you import a PDF from a URL
Is there supporting documentation of the API?
Interested.
Interested.
Avid Linux user....
Re: HOW do you import a PDF from a URL
Install "Curl" on your server (cURL is a free very powerful lightweight command line tool and library for transferring data with URLs.) https://curl.haxx.se/
Then use Execute Program in AwareIM , something like ' curl -O http://example.com/download/myfile.zip.' This will download the file to a folder and let you use IMPORT DOCUMENT in AwareiM
Familiarise yourself with all the command line options in Curl to achieve the correct command that matches the api you are interfacing to.
Then use Execute Program in AwareIM , something like ' curl -O http://example.com/download/myfile.zip.' This will download the file to a folder and let you use IMPORT DOCUMENT in AwareiM
Familiarise yourself with all the command line options in Curl to achieve the correct command that matches the api you are interfacing to.
Re: HOW do you import a PDF from a URL
George,
yes please.
start a demo BSV for dealing with PDFs.
yes please.
start a demo BSV for dealing with PDFs.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: HOW do you import a PDF from a URL
Hi,Jaymer wrote:George,
yes please.
start a demo BSV for dealing with PDFs.
In this scenario ACDC pointed very well how to download a PDF from a URL.
You have to install cURL on your system. It's very simple: https://www.youtube.com/watch?v=4QNWUbrLpCk
I have made a sample bsv to Roger, but this one contains particular things/links to his business, I cannot publish that.
I've talked with him today and he will publish the final bsv under TIPS&Tricks.
With PDF's you can have many scenarios. For example you can create them form your app, transforming a HTML report to PDF with a command line tool like https://wkhtmltopdf.org/ .
If you provide your specific scenario I will reply to your specific needs.
Cheers,
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Re: HOW do you import a PDF from a URL
George,
Having an issue with MAKE DIRECTORY
I need to create the folders to store the PDF documents under the \C:\AwareIM\Tomcat\webapps\AwareIM\
So we can display the PDF in an iframe, the PDF needs to be located under the Tomcat folder
So the complete path would like like:
C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\Company#\Venue#
portion in red is what I need to create.
My Rule looks like this:
If Venues IS NEW OR Venues.PDFDocumentFolder IS UNDEFINED Then
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID+'\'+Venues.ID
Venues.PDFDocumentFolder='C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments'+Venues.sc_TenantID+'\'+Venues.ID
I get this error:
Having an issue with MAKE DIRECTORY
I need to create the folders to store the PDF documents under the \C:\AwareIM\Tomcat\webapps\AwareIM\
So we can display the PDF in an iframe, the PDF needs to be located under the Tomcat folder
So the complete path would like like:
C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\Company#\Venue#
portion in red is what I need to create.
My Rule looks like this:
If Venues IS NEW OR Venues.PDFDocumentFolder IS UNDEFINED Then
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID+'\'+Venues.ID
Venues.PDFDocumentFolder='C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments'+Venues.sc_TenantID+'\'+Venues.ID
I get this error:
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Re: HOW do you import a PDF from a URL
George,
Try using 2 MAKE DIRECTORY commands:
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID+'\'+Venues.ID
That is how it worked back in 2009 see http://www.awareim.com/forum/viewtopic. ... ORY#p13778
Try using 2 MAKE DIRECTORY commands:
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID
MAKE DIRECTORY 'C:\AwareIM\Tomcat\webapps\AwareIM\PDFDocuments\'+Venues.sc_TenantID+'\'+Venues.ID
That is how it worked back in 2009 see http://www.awareim.com/forum/viewtopic. ... ORY#p13778
Bob