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

Error in paper size definition #225

Closed
Sgkhour opened this issue Jul 25, 2020 · 3 comments
Closed

Error in paper size definition #225

Sgkhour opened this issue Jul 25, 2020 · 3 comments
Assignees
Labels
bug WIP Work is in progress

Comments

@Sgkhour
Copy link
Contributor

Sgkhour commented Jul 25, 2020

Hi, i was trying to debug an issue with lack of space around the footer of a page when i think i found the culprit . in PDFPageFormat+SizeConstants.swift, the page size defined is incorrect.

more specifically the height of usLetter
return CGSize(width: 612, height: 762) // 216 x 279 mm | 8.5 x 11.0 in
should be 792 (11x72) instead
return CGSize(width: 612, height: 792) // 216 x 279 mm | 8.5 x 11.0 in

and the width of usLedger
return CGSize(width: 720, height: 1224) // 279 x 432 mm | 11.0 x 17.0 in
should be 792 instead
return CGSize(width: 792, height: 1224) // 279 x 432 mm | 11.0 x 17.0 in

when i specified the document size
document.layout = PDFPageLayout(size: CGSize(width: 612, height: 792),...
the footer spacing was now properly aligned.

looks like an easy fix but i have never done pull requests before.. something new to learn
Sami

@philprime
Copy link
Member

Hi Sami, thanks for letting me know about this issue!
Your fix looks correct and a PR would be great, therefore here a little tutorial:

  1. Create your own fork of this repository by clicking on Fork in the top right corner, here on GitHub.
  2. Clone the repository to your local machine, and preferably switch to the branch develop or a new branch based on develop
  3. Apply, commit and push your changes to your repository.
  4. Create a Pull Request by clicking on New pull request
  5. As the base select techprimate/TPPDF and the branch develop. As the head select your branch on your repository.
    5.1. If your repository is not showing up, you might have to click on compare across forks
  6. Add a descriptive title, e.g. #225: Fixing incorrect US page format heights and more detail in the description. Also add Closes #225 in the text, for smart reference

Mentioning the issue number will link the issue with the pull request.

@philprime philprime added bug WIP Work is in progress labels Jul 27, 2020
@Sgkhour
Copy link
Contributor Author

Sgkhour commented Jul 28, 2020

thank you for the primer... sorry for question but is it normal that i get an error that i can't write to tech primate/TPPDF and i should create my own sgkhour/TPPDF fork ? or is this a permission that you have to set ? i was working with the develop branch which i cloned locally...

seems to have worked (or so i hope...)

Sami

@Sgkhour Sgkhour closed this as completed Jul 29, 2020
@philprime philprime reopened this Jul 29, 2020
philprime pushed a commit that referenced this issue Aug 6, 2020
Corrected the usLetter page height and usLedger page width to reflect 11inx72dpi
philprime pushed a commit that referenced this issue Sep 23, 2020
* Added macOS compatibility to tests (#224)
* Fixed missing file ref
* #225: Fixing incorrect US page size (#226)
Corrected the usLetter page height and usLedger page width to reflect 11inx72dpi
* Fixed missing file ref
* Updated changelog

Co-authored-by: Sami Khoury <50881610+Sgkhour@users.noreply.github.com>
@philprime
Copy link
Member

Fixed in 2.3.1

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

No branches or pull requests

2 participants