Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Take pages screenshots for a Baker book
The easiest way to create screenshots for your book when you have the
-baker-rendering flag set to
screenshots is to let Baker Framework and iOS Simulator do the dirty work for you.
Here's how the trick is done:
- Download the latest version of Baker Framework and put all your book files in the book folder
- Start Xcode and run your application with iOS Simulator
- As soon as the first page is loaded check the debug area for the log Screenshot succesfully saved to file /Users/username/Library/Application Support/iPhone Simulator/simulator version/Applications/application identifier/Library/Private Documents/baker-screenshots/screenshot-portrait-1.jpg and note down the path to the application Documents folder (it will be different in your case)
- Navigate through ALL the pages in ALL the orientations supported by your book to let Baker take all the screenshots needed
- Open Finder --> Go --> Go to Folder... (cmd+shift+g) and type in the path to your application Documents folder (see 3)
- Copy the folder baker-screenshots and paste it inside your book folder and, if you want, rename it as you see fit
- Set the property
-baker-page-screenshotsin your book.json to the name of your screenshot folder (see the page on Baker extension parameters for more info)
That's it, now you have all the screenshots you need.
Delete your app from the simulator and run it again in Xcode. You should see that screenshots aren't taken at runtime anymore: the ones in the folder you specified are being used instead.
Note: If you specify a folder for pre-generated screenshots (using
-baker-page-screenshots), Baker will use the screenshots, but it will not generate any new one. So make sure the folder contains ALL the screenshots you need in your book, otherwise some will be missing.