Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Margins not working on the first page #31

Open
GoogleCodeExporter opened this issue Oct 22, 2015 · 8 comments
Open

Margins not working on the first page #31

GoogleCodeExporter opened this issue Oct 22, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

Confirmed, same story but with image.

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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@GhaziTriki GhaziTriki added Bug and removed Type-Defect labels Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants