Click here to Skip to main content
14,698,950 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am making a good comeback at programming after 25 years (I was an expert C programmer at one time). Am trying to start a website similar to issuu.com, which will convert PDF files into a book format. I've registered pdf2book.com. Am currently experimenting with iTextSharp (C#), and PyPDF2 (Python). Both Python as well as C# compile into "bytecode", which requires an interpreter for execution on any machine. Now, I know instagram and google rely on Python. My question is, how do I get the server to execute either Python code or the bytecode? And same question for C#. Not sure how to use it. Do I need a VPS? Can I get a shared host (e.g. wix, tierra net, go daddy, or Wordpress - I use them all), to run a Python or C# script? And can I include Python or C# code or "scripts" in an HTML file - how does the browser "invoke" the Python or C# code?? Php seems to be better suited for the task, since most servers have Php included... and I can include Php scripts in HTML...

What I have tried:

I am making a good comeback at programming after 25 years (I was an expert C programmer at one time). Am trying to start a website similar to issuu.com, which will convert PDF files into a book format. I've registered pdf2book.com. Am currently experimenting with iTextSharp (C#), and PyPDF2 (Python). Both Python as well as C# compile into "bytecode", which requires an interpreter for execution on any machine. Now, I know instagram and google rely on Python. My question is, how do I get the server to execute either Python code or the bytecode? And same question for C#. Not sure how to use it. Do I need a VPS? Can I get a shared host (e.g. wix, tierra net, go daddy, or Wordpress - I use them all), to run a Python or C# script? And can I include Python or C# code or "scripts" in an HTML file - how does the browser "invoke" the Python or C# code?? Php seems to be better suited for the task, since most servers have Php included... and I can include Php scripts in HTML...
Posted
Updated 9-Oct-20 14:29pm
v2
Comments
Gerry Schmitz 9-Oct-20 19:37pm
   
Linux, Apache Web Server, MySQL, PHP. Or, Windows, IIS, SQL Server, C#. Then add HTML, CSS and JavaScript.
Santos Perez 9-Oct-20 20:34pm
   
Can I just use an Azure virtual machine? I've used Azure before, a Windows-based virtual machine... Is that sufficient or does Azure have a VPS I can purchase??? I did not see VPS as a "resource" in Azure....
Richard MacCutchan 10-Oct-20 4:19am
   
The C# code is executed on the server, not in the browser.
Santos Perez 10-Oct-20 12:16pm
   
Thank you... Ok - so Wordpress, Wix, GoDaddy shared hosting doesn't allow for me to update its servers with a C# interpreter - I'd have to get a VPS, right? Can I just use an Azure Virtual Machine and run Apache or IIS on the Virtual Machine??? AWS VPS??? Azure doesn't have VPS listed as a resource....
Richard MacCutchan 10-Oct-20 12:31pm
   
You don't update the server, you update the webpage that is built on the server and sent to the client browser. But that is only valid for that one pass, it is not saved anywhere. And that holds true whatever server system you are using whether it be PHP or ASP.NET, or anything else. The real issue you need to address is your conversion process. Once you have that working then creating a website that provides this feature is probably not such a big issue. I am still somewhat unclear what you mean by converting PDF to book format, since PDF is almost in that format already.
Santos Perez 10-Oct-20 13:42pm
   
Thank you for your answer. Probably will convert PDF file to images, or extract each individual page, then display using a format similar to issuu.com (basically a PDF reader). Now, I use Tierra Net, Go Daddy, Wix, and Wordpress shared hosting, but am not a fan of the last three. Tierra Net, on the other hand, allows me to configure server for Php server-side scripting - but it has no option for Python scripts or bytecode. Let's say a user accesses my website using Chrome client-browser, and I am using Apache and Php @ Tierra Net. The client then sends the server a PDF file, and the Php server-script can, for instance, rotate the pdf file, and return the rotated pdf file to the client along with HTML code as a string. The client then displays the rotated file using the HTML code generated by Php. How can I accomplish this with Python? How do I configure the Apache server to run Python scripts or to execute Python code? Thanks in advance...
Santos Perez 10-Oct-20 14:02pm
   
I found some answers online, e.g. https://www.linux.com/training-tutorials/configuring-apache2-run-python-scripts/, but am wondering if I can get shared hosting pre-configured to run Python scripts....
Santos Perez 10-Oct-20 17:10pm
   
I found the answer online.... Lots of resources out there, this site also helped: https://pythonschool.net/server-side-scripting/create-your-first-server-side-script/

Thanks again!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900