Hi all, 
I have one problem with PdfContentByte's addTemplate() , I need to perform
custom scaling functionality(scale in X axis and y axis separately ) so here
is my code 

                float rotate = element.getAngle();
                float angle = (float) (-rotate * (Math.PI / 180));
                float xScale = (float) (Math.cos(angle));
                float yScale = (float) (Math.cos(angle));
                float xRote = (float) (-Math.sin(angle));
                float yRote = (float) (Math.sin(angle));

                float xs = this.scaleX;
                float ys = this.scaleY;
                if (element.getAngle() == 90 || element.getAngle() == -90) {
                        xs = this.scaleY;
                        ys = this.scaleX;
                }

                cb.addTemplate(template, xScale * xs, xRote * xs, yRote * ys, 
yScale
                                * ys, this.scaleX * element.getPosX(), 
this.scaleY
                                * element.getPosY());
it works randomly , for example when the scale  == 1.55 it works well, but
for 1.57 ,1,59 or 1,52 it works 
not really correct,  e.g for 1.57 the template is smaller then for 1,52
scale.
Please suggest what to do, 
could it be the addTemple method problem , or something else ?
thanks in advance ,
regards, 
Harroot  

-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/addTemplate-with-custom-scaling-functionality-tp2990338p2990338.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to