PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Horizontal overflow to a new page
   PostPosted: 13 Apr 2011, 13:20 
Hello,

Could it be possible to have horizontally overflowing content to be printed on a separate page? Because of my content's completely dynamic nature, I have no control over how many horizontal pages are required. It just is one huge table which can span in every direction. Scaling is not possible here either because font sizes are defined by the user.

Currently it seems that PD4ML just skips the overflown part altogether. In my opinion, it should be treated differently.

Is there a some kind of switch I've missed that could be used to fix this issue.

I have no example here, but I bet you can imagine what happens to a too wide table.


  Subject: Re: Horizontal overflow to a new page
   PostPosted: 15 Sep 2011, 20:54 
Determine the width of the table with javascript (or other method) and then pass that as the screen width (screenWidth="400" for example)

That should get it to render the whole table, at least it has worked for us via the command line interface.


  Subject: Re: Horizontal overflow to a new page
   PostPosted: 20 Sep 2011, 18:05 
PD4ML does not support JavaScript, so for the approach the measurement must be performed in a third-party tool (which adds yet another level of complexity).

You may compute a content right edge position using PD4ML API and an idle render() call:

pd4ml.setHtmlWidth(400);
pd4ml.render(url, byteArrayOutputStream);
System.out.println("right edge: " + (Long)pd4ml.getLastRenderInfo(PD4Constants.PD4ML_RIGHT_EDGE_PX));


The returned right edge value (plus optionally some more margin pixels) can be used as pd4ml.setHtmlWidth() parameter value for an effective render() call.



[Reply]     [ 3 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share