mesaglam / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Margins not working on the first page #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Set margins to 10,10,10,10
2. Set current position to 0,0
3. Add a multicell with many lines of text

On the first page, the text will start at 0,0 completely ignoring margins. 
When it flows onto the next page, it will auto-paginate, and then the 
margins are adhered to.

Bottom margin works however on the first page, top, left & does not.

Original issue reported on code.google.com by phidi...@gmail.com on 30 Jan 2008 at 11:48

GoogleCodeExporter commented 9 years ago
Confirmed, same story but with image.

Original comment by lytvyn...@gmail.com on 29 Sep 2008 at 7:54

GoogleCodeExporter commented 9 years ago
Actually margins don't work at all:

var myPDF:PDF = new PDF(  Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
myPDF.setDisplayMode ( Display.DEFAULT);
myPDF.setTitle("Report");

myPDF.addPage();
myPDF.setMargins(10,10,10,10);
myPDF.addPage();
myPDF.setMargins(10,10,10,10);
myPDF.addImage(objectReference, 0,0,0,0, ImageFormat.JPG, 100,
1,ResizeMode.FIT_TO_PAGE,"Normal",false);

Original comment by lytvyn...@gmail.com on 29 Sep 2008 at 8:15

GoogleCodeExporter commented 9 years ago
I am having a similar issue with the margins not working correctly.

I am trying to add the a canvas into the PDF using the following method:

var myPDF:PDF = new PDF( Orientation.PORTRAIT, Unit.MM, Size.A4 );
                myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );

                myPDF.addPage();

                var c:Canvas = SecondAlarm(parent.parent).mapPanel.drawing_area;

                myPDF.addImage(c,0,0,0,0, ImageFormat.PNG);

                var f:FileStream = new FileStream();
                file = File.desktopDirectory.resolvePath("pdf/generate.pdf");
                f.open( file, FileMode.WRITE);
                var bytes:ByteArray = myPDF.save(Method.LOCAL);
                f.writeBytes(bytes);
                f.close();

The resulting PDF has the right hand side of the canvas cropped.

I have also attempted to adjust the margins with no affect. I have attached a 
copy of
the resulting PDF. The canvas has a 1px black border which makes it easy to see 
the
problem.

Original comment by codet...@gmail.com on 16 Feb 2009 at 10:17

Attachments:

GoogleCodeExporter commented 9 years ago
Just downloaded the library and seem to have the same problem with setting 
margins.
Has this been fixed?
I hope I'm just doing something wrong. :)

My pdf is just straight text:

pdf = new PDF();
pdf.setDisplayMode (Display.FULL_PAGE, Layout.SINGLE_PAGE);
pdf.addPage();
pdf.setMargins(10,10,10,10);
pdf.setFont(FontFamily.ARIAL);
pdf.addText("Sample No.",1,10);

Original comment by jersi...@gmail.com on 25 Jun 2009 at 6:15

GoogleCodeExporter commented 9 years ago
I am facing the same issue while plotting images.
I tried out with both the options, setleftMargin n all and setMargin.
The only workaround i see is we can achieve a left margin by positioning our 'x'
value with 10 or something while plotting the image.

Original comment by koolest...@gmail.com on 10 Nov 2009 at 6:26

GoogleCodeExporter commented 9 years ago
I had the same problem with addCell methods, I had text inside the cell, but 
the text
was ignoring the margins and was getting out from there.

I started using addMultiCell method and I realized that addMulticell method is
wrapping the text into the cell.

Original comment by fisherne...@googlemail.com on 10 Mar 2010 at 4:48

GoogleCodeExporter commented 9 years ago
Seems like it is still not fixed, I have same problem with image

Original comment by korma...@gmail.com on 25 Nov 2013 at 6:51

GoogleCodeExporter commented 9 years ago
Hi there, I'm actually experiencing this problem too. Is there a workaround 
regarding this? Thank you

Original comment by franco.m...@finpacific.com on 13 Jan 2015 at 4:13