There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Specifically, I will be converting HTML to PDF, including all manner of styles and images.
Neither rotativa nor Pechkin work on Azure App Service due to its limitations.
There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked.
Based on my test with following sample, I can use iText 7 to generate PDF file, and it works fine on Azure App Service Web App.
var path = Server.MapPath("test.pdf");
FileInfo dest = new FileInfo(path);
var writer = new PdfWriter(dest);
var pdf = new PdfDocument(writer);
var document = new Document(pdf);
document.Add(new Paragraph("hello world"));
document.Close();
Generated PDF:
Besides, I am using the basic feature of iText, which works fine on Azure Web App sandbox. If any advanced features of iText can not work on sandbox, you can try another hosting options (such as Cloud Services, Virtual Machines).
Related
I'm trying to create a PDF file using data from Google Sheets. I've searched for a solution without using Google Docs as I have made my template in Google Sheets, but none of them seems to have this method as they usually use Google Docs for in-between to these two platforms. So, is there any way I could create a PDF using both template and data in Google Sheets without using Google Docs?
PDF created will be based on dynamic HTML page.
Using ITEXT 5 or 7 with XMLWORKERHELPERCLASS would be lengthy process.
If i am using pdfcrowd API it seems to be ok but not able to generate on localhost or any other private ip. I am ready to pay for their services if they achieve above issue.
First you need to get iText 7 (the core library) and the pdfHtml add-on (the part that will parse the HTML+CSS and convert it to iText objects). Go to github to find out how to download these.
Suppose that you have this HTML:
With this corresponding CSS:
Then you can use this code snippet:
ConverterProperties converterProperties =
new ConverterProperties().setBaseUri(resoureLocation);
HtmlConverter.convertToPdf(
new FileInputStream(HTMLSource),
new FileOutputStream(pdfDestination), converterProperties);
Where resourceLocation points at your base URI, HTMLSource is the path to your HTML file, and pdfDestination is the path where you want the resulting PDF to be written.
When you execute this code, you will get the following PDF:
Note that buying a commercial license may be necessary if you intend to use iText in the context of a proprietary software project.
I am new to mobile development. As i am familiar with c# .net so i am using xamarin plugin for visual studio. I have created a sample app in which i have used SQLite, created a DB and then performed CRUD operations. At this point all things are working good. But i already have a local DB and i want to use it. For this i have made an offline Azure api using swagger and on Release i have saved the files locally by using File System in release option in VS. Now i want to add my app as rest api client and want to use my local DB. But when i try to add as rest api client and then i select select an existing swagger file so while browsing i can't find any file. For reference please see the images bellow
So when i click browse and goto the location where i have saved my files for swagger i get nothing as shown in bellow image
Also it's finding the .json extension file which is not present in my publish api.
I don't know why it's happening, also as already told above i am new to mobile development i am not sure what to do. Kindly see the bellow image of my swagger UI
Any help would be highly appreciated
The URL you listed is for the user-friendly reference docs for your API; there should be a corresponding URL for the JSON definition endpoint for your API. Use this instead in the Add Rest API Client dialog in the "Swagger URL" option.
The other option is to use this peer URL to download the JSON description of your REST API into a local .json file and reference that when generating your client access classes.
For an example of these two endpoints, see https://msdn.microsoft.com/en-us/library/mt788315.aspx#Anchor_1.
Why you are using azure? I guess your are working in a company so they must have a server. Just publish your services on the server and then sync it with your mobile app and DB. This is the easiest and free way to do it. You can use Rest services for that
I am trying to pass values to be shown in fields inserted in Microsoft Word documents or be an overlay (what is the correct word). Can it be done?
You can't selectively modify portions of a file on Dropbox remotely using the API, if that's what you mean. The API only allows you to upload new entire new versions. So you can download the file, modify it as desired, and upload the new version
I need to extract text from DOC, DOCX and PDF files.
I've downloaded two Windows Forms Application demo projects, one here:
http://www.codeproject.com/Articles/31944/Implementing-a-TextReader-to-extract-various-files
the other here:
http://www.codeproject.com/Articles/13391/Using-IFilter-in-C
Both are working just fine within the windows Form Application. But both do not work within my ASP.NET MVC2 application, it gets saying it can't find a filter or throws a method not implemented exception.
Could this be a security error? Like ASP.NET cannot reach the various IFilter's installed on the machine.
DOC files are working by the way.
All is x64 and the files are first saved on disk and have the proper permissions set.
Any help is appreciated.
edit:
PDF error is: The method or operation is not implemented.
DOCX error is: No filter defined
Windows Forms Application both are working. I'm considering getting the output from a Windows Forms/Console application.