HTML table are not coming on PDF using xhtml2fo.xsl - pdf

The HTML tables are not coming on the PDF when converting it using xhtml2fo.xsl.
This the HTML page(Sampler.html) location:
https://www.antennahouse.com/hubfs/6895749/uploads/XSL%20Sample/sample-xhtml.zip?hsLang=en
This the XSL(xhtml2fo.xsl) location:
https://www.antennahouse.com/hubfs/6895749/uploads/XSL%20Sample/sample-xsl-xhtml2fo.zip?hsLang=en
All the contents are coming, but the tables are not coming on PDF. What can I do?

Related

Add uploaded PDF file to Word doc generated in front end

Looking for a way to add a user-uploaded PDF file to a Word document generated in the browser.
The user fills out a questionnaire and has the option to upload a document. At the end, the user clicks on a button and a Word document is generated with the gathered data (using docxtemplater).
The JSON data used for the doc generation is not stored anywhere after these steps.
Is there
a) a library that allows the uploaded file (which will be a PDF) to be added to/embedded in the generated Word document in the front end or
b) a way to display the file in the Word document by referencing the data URL in the template?
Example JSON (after generating the document):
"attachmentUpload": [
{
"name": "Example.pdf",
"type: "application/pdf",
"content": "data:application/pdf;base64,[.......]"
}
]
All I have found so far are libraries to merge two or more PDF files.
Any pointers would be highly appreciated!
Thanks!

How to submit PDF File in a JSP to Servlet?

I have a formular in my JSP, that has an input field for a PDF-file and besides that also other inputs for text and numbers. This is my line for the data upload of the PDF-File and that is how my form starts:
Upload for PDF: <input type="file" name="datei" />
When in my Servlet, I just get the name of the PDF-File, when i request it like this:
String pdf = request.getParameter("datei");
Now how do I upload a pdf-File, submit that to my Servlet, so I can get all the data and Update a row with all this data in my PostGreSQL database?
First the problem is in the form that must have the enctype="multipart/form-data", but so I can't bring over inputs from the type="text". And another form in another one is not possible either. If I leave out the enctype and just pass the to my servlet, I don't know more than to request this parameter e.g. with String pdf = request.getParameter("file");, but there I only get the PDF file name. Additionally I need to store the PDF file in the database. For this I will create another column pdf of type oid, but I don't know how to pass this PDF file through all methods, so that I can finally save it in PostGreSQL and assign it to a seminar.
Thank you

PHPExcel write html file into existing xlsx file

I have a template file that I fill using PHPExcel. But I have terms and conditions that are saved in database with html tags and inline css. Now these terms and conditions are subject to change so I cant put it into template. So only solution is t take it from database and put it inside created template but I have no clue how to open xlsx file and insert .html file inside it perhaps as second sheet.
This is my current code:
$objPHPExcel = new PHPExcel();
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($outputFileName);
And of course there is lot of code that specifically deal with writing data to excel file but that is working perfectly.
Could someone please explain how could I go about doing it.
Thanks
You can't simply insert an HTML file inside an xlsx file
The latest develop branch of PHPExcel does include an HTML to Rich Text wizard that will take a block of HTML markup and convert it to a Rich Text object that can then be stored in a cell, and /Examples/42richText.php demonstrates how it can be used. At present, this only covers basic markup tags (<br />, <font>, <b>, <i>, <em>, <strong>, <sub>, <sup>, <ins>, <del>, etc) and doesn't handle inline style in any way. However, it might provide the basis for what you want with some additional work.

Remove extra ASCII symbol rendering in PDF

I have a user that is storing a 'registered trademark' symbol in her name in our database and when we retrieve it when the database it renders correctly, but when we actually place it onto the website itself in HTML it renders with an extra 'A' symbol in front of it:
You can see above the database value compared to what is rendered in the PDF file. I can access the database value in the backend and edit it through vb code but I am really not sure how or what the code would be to do that as I don't want to remove all ASCII characters just the extra symbol being generated and rendered in the PDF.
Any idea how to do this would be great.
I think the Main-Problem is that you generate wrong HTML-Code by just inserting your Database-Result-Strings into your Website
You can encode your Database String to HTML by using the HtmlEncode-Function from HttpUtility in .NET
Here is an Example from vb.net
myEncodedString = HttpUtility.HtmlEncode(myString)
If you use "myEncodedString" inside your WebPage you'll get no additional Characters and a valid HTML-Code.

Add a cover page to a PDF document

I create a PDF document with EVO PDF library from a HTML page using the code below:
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
byte[] outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", String.Format("attachment; filename=Merge_HTML_with_Existing_PDF.pdf; size={0}", outPdfBuffer.Length.ToString()));
Response.BinaryWrite(outPdfBuffer);
Response.End();
This produces a PDF document but I have another PDF document that I would like to use as cover page in the final PDF document.
One possiblity I was thinking about was to create the PDF document and then to merge my cover page PDF with the PDF produced by converter but this looks like an inefficient solution. Saving the PDF and loading back for merge seems to introduce a unnecessary overhead. I would like to merge the cover page while the PDF document produced by converter is still in memory.
The following line added in your code right after you create the HTML to PDF converter object should do the trick:
// Set the PDF file to be inserted before conversion result
htmlToPdfConverter.PdfDocumentOptions.AddStartDocument("CoverPage.pdf");