Forum Replies Created
-
AuthorPosts
-
in reply to: PD4Device.finalize() closes output stream and causes mixup! February 17, 2012 at 15:50#28893
Currently PD4Device.finalize() looks like that:
/** * @see java.lang.Object#finalize() */ public void finalize() { // dispose(); }Unfortunately I could not find in our source control system when exactly the dispose() call has been commented out. But it definitely happened more that 2 years ago.
dispose() method is triggered once now. The method forces collected PDF metadata to be written and it still closes the output stream.
I would recommend to wait the next 2-3 hours – we plan to get from QA and to release the newest version today. Of you can get it on Monday.
in reply to: PD4Device.finalize() closes output stream and causes mixup! February 17, 2012 at 15:31#28891The issue has been solved in the actual versions of PD4ML. Just give a try to any fully-functional evaluation version (or request a commercial one to evaluate from support pd4ml com).
> usual contract is that the one who opened a stream is the one responsible for closing it
You are right. But if we leave the output stream not closed, there is a probability the hosting framework writes some finalizing content/tags there, which corrupts the generated binary PDF data.
A safer (and recommended) approach would be to pass ByteArrayOutputStream to render() method. That would also let you measure generated PDF size and send correct Content-length HTTP header.
in reply to: question for pd4ml using CSS February 17, 2012 at 15:01#28894border-collapse: collapse is supported since v3.21, however a correct table break (by a page break) with the style is applied is implemented in v3.80b1.
Your version definitely does not support the feature.
in reply to: How to optimize the size of the generated PDF? February 17, 2012 at 13:55#28885right.
in reply to: How to optimize the size of the generated PDF? February 17, 2012 at 13:48#28883Since one of the recent versions, there is a bug in our code. In some situations it does not compress image bytes. Most probably you faced with the effect.
The issue is already solved and we are almost ready to release an updated version. Currently the new build is under QA. If everything is ok, we’ll release the version later today.
in reply to: Cache issue February 16, 2012 at 18:08#28745PD4ML does not test if a particular resource (image or stylesheet) has been changed: if it has a cached version – it uses it.
You may explicitly disable caching with pd4ml.cache.enable=false environment variable, or with a dynamic parameter.
Map m = new HashMap(); m.put(PD4Constants.PD4ML_CACHE_ENABLE, false); pd4ml.setDynamicParams(m);
We’ve just refined clearCache() method in the development build, but as I got it worked for you before.
Another workaround would be to add a harmless dynamically generated parameter to the stylesheet reference:
./styles/main.css?rnd=
<random_number>It should distinguish a new stylesheet from ones loaded before. As a drawback of the approach it will accumulate stylesheet versions in the cache. It is not that dramatic, as they are cached as soft references, but anyway it is a good idea to perform clearCache() from time to time.
in reply to: pd4ml.cache.enable=false February 16, 2012 at 17:15#28874We’ve just refined pd4ml.clearCache() method to remove ALL cached objects, including harmless parsed CSS properties.
But it seems the issues with the cache reset happened only if you reuse PD4ML instance for multiple conversions (which is not recommended, in general). So I am not sure if we addressed exactly the issue you faced with
Also -Dpd4ml.cache.enable=false prevents downloaded objects from being cached. Bearing in mind the image size has been changed in the debug output, I’ve got no explanation from where the old image comes from.
Should we send you an actual development build to test the caching issues on your side?
in reply to: pd4ml:transform does not seem to work February 16, 2012 at 10:10#28882No, there is no tag to define initial conversion parameters.
As long as you do not use the JSP taglib, I guess you instantiate PD4ML object and call render() method. Why don’t you define needed parameters via the API before the render() call?
in reply to: [High Priority] HTML inline-Hyperlinks not working in RTF February 15, 2012 at 17:57#28877We’ve just added the feature. It will be available with the forthcoming beta release (hopefully, this week)
in reply to: pd4ml:transform does not seem to work February 15, 2012 at 12:40#28880There is no dedicated tag for that. It can be configured with PD4ML API: pd4ml.setHtmlWidth(), pd4ml.setPageSize() and pd4ml.setPageInsets()
there is also a possibility to change the parameters on-a-fly with
<pd4ml:page.break>: https://pd4ml.com/cookbook/pdf_dynamic_format_change.htmin reply to: pd4ml.cache.enable=false February 14, 2012 at 17:31#28873We’ll address the issue tomorrow. Hopefully it will be fixed with the beta release planned this week.
in reply to: display current date every time the PDF is opened February 14, 2012 at 17:09#28794It is going to be released this week.
in reply to: pd4ml:transform does not seem to work February 14, 2012 at 17:08#28878<pd4ml:transform>is a custom JSP tag, which works only with JSP.The tag is a wrapper for PD4ML API, so all its attributes have equivalents in PD4ML class methods.
in reply to: Table cell border not drawn after page break February 10, 2012 at 15:11#28852It seems the simplest workaround would be to add
style=”border-collapse: separate”
attribute to the main
<table>in reply to: Spaces being stripped February 10, 2012 at 13:50#28870Is the third-party app based on PD4ML?
If so, the only theoretical explanation is that the application has misconfigured TTF embedding feature or it uses corrupted TTF fonts with spaces defined wrong way.
(Sounds strange, but it is usual for special TTF fonts, intended to display digits from 0 to 9 only)
I would also suspect a buggy version of PD4ML, but I do not remember any version with a problem like that.
-
AuthorPosts
