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

Is it possible to remove default print page margins? #7

Closed
Purushoth-ltr opened this issue Feb 1, 2017 · 8 comments
Closed

Is it possible to remove default print page margins? #7

Purushoth-ltr opened this issue Feb 1, 2017 · 8 comments

Comments

@Purushoth-ltr
Copy link

I need to remove a4 page default margins so that i can generate a pdf of full page. How can i remove the margins when converting the html to pdf?

@cesarvr
Copy link
Owner

cesarvr commented Feb 1, 2017

If you mean the default margin (≈25mm) , sorry you can't you are constrained to the Webview way of doing the printing from HTML to PDF.

@Purushoth-ltr
Copy link
Author

Purushoth-ltr commented Feb 2, 2017

Thanks for the reply. Actually i removed the margins, but i don't know whether its the correct way. In the following function i removed the default margins and it worked.

- (id)initWithPageSize:(BNPageSize)pageSize isLandscape:(BOOL)landscape {
	if (self = [super init]) {
		self.pageSize = pageSize;
		self.landscape = landscape;

		// Default 1/4" margins
		self.topAndBottomMarginSize = 0.0f * 0.0f;
		self.leftAndRightMarginSize = 0.0f * 0.0f;
	}
	return self;
}

@cesarvr
Copy link
Owner

cesarvr commented Feb 2, 2017

Interesting... can you please share a screenshot with the results you wanted achieved?, some trivial example if you can

@Purushoth-ltr
Copy link
Author

I intended to print a report in IOS. Initially i got the pdf like this screenshot 1 with page margins.
screen shot 2017-02-02 at 6 17 31 am

Screenshot 2 without margins.
screen shot 2017-02-02 at 6 02 45 am

Sorry for the poor images.

@cesarvr
Copy link
Owner

cesarvr commented Feb 2, 2017

Ahh I get the idea, thats very nice use case I will try to add that as an option for IOS. Thanks!.

@Purushoth-ltr
Copy link
Author

Thank you too @cesarvr

@parasyris
Copy link

Hi @cesarvr , did you add this as an option for iOS? Thanks!

@jazzbpn
Copy link

jazzbpn commented Sep 5, 2019

Problem remains unsolved at iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants