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

printing pdf #32

Closed
biancashouse opened this issue Feb 6, 2019 · 5 comments
Closed

printing pdf #32

biancashouse opened this issue Feb 6, 2019 · 5 comments

Comments

@biancashouse
Copy link

Dave, your sample works.
My pdf generates into a file ok, but when I try the print option, the preview is blank and I get these error messages: (only tried on the iphone X simulator)

flutter: Print ...
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x604000290db0 UIView:0x7ff052f6dbe0.width == UILabel:0x7ff052f735a0'Page 1'.width + 28 (active)>",
"<NSLayoutConstraint:0x604000291ad0 H:[UIImageView:0x7ff052f73880]-(3)-UILabel:0x7ff052f735a0'Page 1' (active)>",
"<NSLayoutConstraint:0x604000288980 UIImageView:0x7ff052f73880.width == 22 (active)>",
"<NSLayoutConstraint:0x60400028b720 H:|-(0)-UIImageView:0x7ff052f73880 (active, names: '|':UIView:0x7ff052f6dbe0 )>",
"<NSLayoutConstraint:0x604000285140 UILabel:0x7ff052f735a0'Page 1'.right == UIView:0x7ff052f6dbe0.right (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x604000291ad0 H:[UIImageView:0x7ff052f73880]-(3)-UILabel:0x7ff052f735a0'Page 1' (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

@DavBfr
Copy link
Owner

DavBfr commented Feb 6, 2019

That should be fixed with version 1.3.2

@DavBfr DavBfr closed this as completed Feb 6, 2019
@biancashouse
Copy link
Author

biancashouse commented Feb 6, 2019 via email

@biancashouse
Copy link
Author

biancashouse commented Feb 6, 2019 via email

@DavBfr
Copy link
Owner

DavBfr commented Feb 6, 2019

The onLayout function gives you a page format and margins related to what the selected printer can do. So it's your app to adapt and create a pdf document with the right size and margins.
The widget system helps a lot di achieve that. It is ready now in version 1.3.x.

@biancashouse
Copy link
Author

biancashouse commented Feb 7, 2019 via email

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

2 participants