Internal link problem and justified text + float problem

227 views
Skip to first unread message

Philippe

unread,
May 23, 2012, 10:36:51 AM5/23/12
to dom...@googlegroups.com
Hi,

I have two problems.
When using internal link, the pdf scale to fit the whole page, how can I prevent that and keep the user zoom?


When using "text-align: justify;" and having float elements, if a text line is not complete (does not take the full line), it will ignore the float element. ie: go to the left margin even if there's a float left div.


Any solution for those two problems?

Also, it's user-generated content, so I can't really modify the input html except with regex. (like switching <sup><a></a></sup> to <a><sup></sup></a>, no super effect otherwise)

BrianS

unread,
Jun 2, 2012, 10:15:52 PM6/2/12
to dom...@googlegroups.com
On Wednesday, May 23, 2012 10:36:51 AM UTC-4, Philippe wrote:
When using internal link, the pdf scale to fit the whole page, how can I prevent that and keep the user zoom?

There isn't really a solution for this beyond modifying the dompdf source. Linking to "Fit" is hard coded as the default internal linking style. It's not really possible to keep the user zoom level because (at the very least) CPDF expects some kind of view attached to the link. Plus, how would this be specified if configurable?

If you want to modify the default view you can modify the dompdf source. Look for the add_named_dest() method in dompdf/include/cpdf_adapter.cls.php. Modify the line that reads $this->_pdf->addDestination($anchorname, "Fit"); to use the view you want. Available options are: 'XYZ'; 'Fit'; 'FitH'; 'FitV'; 'FitR'; 'FitB'; 'FitBH'; 'FitBV'. I'd have to refresh my memory as to how some of these are rendered.

When using "text-align: justify;" and having float elements, if a text line is not complete (does not take the full line), it will ignore the float element. ie: go to the left margin even if there's a float left div.

Since float is still under development this is probably a bug. It would help us as we refine the feature if you posted a note to the relevant issue in the tracker.
 
Also, it's user-generated content, so I can't really modify the input html except with regex. (like switching <sup><a></a></sup> to <a><sup></sup></a>, no super effect otherwise)
 
That appears to be a bug ... I'll add a report to the issue tracker.

BrianS

unread,
Jun 2, 2012, 10:32:05 PM6/2/12
to dom...@googlegroups.com
FYI, issue 493. The issue affects any inline element contained inside a superscript element. I believe you can work around the issue by adding the following to your stylesheet: sup * { vertical-align: super; }
Reply all
Reply to author
Forward
0 new messages