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

Pdf not fit properly in Print preview, make blank space either right and bottom. #208

Open
anupsamanta opened this issue Jun 5, 2023 · 6 comments

Comments

@anupsamanta
Copy link

anupsamanta commented Jun 5, 2023

Selected an image from device and convert it into a pdf file . After that I used to print that particular pdf file. But pdf is not fit properly in print preview, making blank space in right or bottom.

@MaruanBO
Copy link

Hello @anupsamanta,

Could you please provide more information about your printing scenario? Are you printing an HTML image by converting it to a base64 image and then to a PDF? Or are you printing HTML to PDF? It would be helpful to know the specific use case and the steps you are taking. Additionally, have you tried applying styles to the generated HTML or image? Lastly, could you please clarify if this problem is specific to iOS or Android?

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 13, 2024
@anupsamanta
Copy link
Author

anupsamanta commented Oct 8, 2024

@MaruanBO . This is only Android specific issue. Scenario is like that, I am selecting a an image from gallery and saved it locally , then I wants to print it from that filepath.

Could you please provide more information about your printing scenario? Are you printing an HTML image by converting it to a base64 image and then to a PDF? Or are you printing HTML to PDF? It would be helpful to know the specific use case and the steps you are taking. Additionally, have you tried applying styles to the generated HTML or image? Lastly, could you please clarify if this problem is specific to iOS or Android?

@stale stale bot removed the stale label Oct 8, 2024
@MaruanBO
Copy link

MaruanBO commented Oct 8, 2024

Dear @anupsamanta thank you for your response,

As you correctly pointed out, usually the extra white space it has much more to do with the device you use and the printing format. For example some format such as a4 may leave the white space in android and on IOS will work fine. You can use a library to print that allow you to preselect the format to print while launching the printing settings, so the default format is the correct one. To do so, please use the https://docs.expo.dev/versions/latest/sdk/print/ to set the format use https://docs.expo.dev/versions/latest/sdk/print/#types

Regards.

@anupsamanta
Copy link
Author

@MaruanBO , Thanks for quick response.

As you mentioned to use the library https://docs.expo.dev/versions/latest/sdk/print/ to select print out format and https://docs.expo.dev/versions/latest/sdk/print/#types to set the format, I have checked those, but those are in expo. But I am using react-native-cli. Could you please guide me for react-native-cli.

@MaruanBO
Copy link

MaruanBO commented Oct 8, 2024

Dear @anupsamanta,

Those tools are only available on expo, if you are not using it, to keep the KISS principle, is better that you stay with it, in case that is possible migrate to expo (not only to solve this issue since you can solve it without it), is quite easy and it will simplify a lot the whole process of testing the application, deployment and libraries (you will relay in authorized and secure options).

Your first option:

#issue 47.

There is many people with your issue.

Your second option:

https://docs.expo.dev/bare/using-expo-cli/.

Regards.

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