The Html and use IextextRenderer to create pdf file css, I have a footer to the right of the current page I
I
But now I would like to present the current date to the left.
I found it:
& lt; Div data-line = "1" & gt; & Lt; / Div & gt; Div [data-line]: {content: "[line" attr (data-line) "] after ;;;;;;}
But I want to combine it how Do not know:
@ bottom-left {content: "Date:";}
Is this possible or is there any other way?
I want to see the footer like this: Date: 2015-03-17 12:04
Update 1:
I have a method PDF ( String HTML, string processing URL), which looks like this:
BitReRone output stream out = new byte array Stream (); HtmlCleaner cleaner = new HtmlCleaner (); Tagnod node = cleaner. Skeln (HTML); Clinrproprtij Props = Clinrkjetproprtijh (); new SimpleXmlSerializer (Sahara) KwriteToStream (node out, "ISO -885 9 -1 "); Aitekst Rederr renderer = new Itekst Rederr (); RendererksetPDFVersion (PdfWriterkVERSION_l_7); RendererksetDocumentFromString (new string (Autktobiteare ()," ISO -885 9 -1 "));. Renderer.getSharedContext () SetBaseURL (resourceUrl); renderer.layout (); Bytereon output stream output stream = new byteOnputstream (); Renderer.createPDF (outputStream); Renderer.finishPDF (); OutputStream.flush (); OutputStream.close (); Return Output STream.toByteArray ();
It quoted you data-line
Use CSS is an interesting way to generate css based on data dynamically - * HTML properties can be generated dynamically in a web page by server-side or client-side script, but it seems that May not be the appropriate method for your case.
If you are already using a Java class like ITExander to make this PDF, then the best method for you is to use Java only to generate the current format in the desired format. , Then print directly in the CSS as a string.
If you are loading CSS from a manually created file, then there will be a way to do this, for example with some text you want to change INSERTDATE
Write your CSS then in Java, load your document the way you normally do, then load some Java code like string.Ray Place with
Update 1:
Based on my sample code above, you can type INSERTDATE
, where your Want the date of appearing in HTML / CSS, then call:
SimpleDetermutation SDF = New SimpleDateform ("YYA-MM-DD HH: MM"); # Your desired format string strDate = sdf.format (new date ()); # Get the current date html = html.replace ("INSERTDATE", strDate);
On top of your method.
No comments:
Post a Comment