withinweb

Information and support for products of withinweb.com

withinweb header image 1

Next step for PHP Tutorials eBook

April 3rd, 2014 · No Comments

The eBooks is on sale on the Amazon web site and hence is available for Kindle devices.  It is also available as a PDF download which may be purchased from my web site http://www.paulvgibbs.com.

The next step is to make the eBook more widely available through other stores and other formats and to create a forum where purchasers of the book can more easily ask questions and discuss PHP coding issues.

In the mean time you are quite welcome to ask questions via my email.

→ No CommentsTags: eBooks

New web site for eBook paulvgibbs.com

March 19th, 2014 · No Comments

The new web site http://www.paulvgibbs.com is now available and provides information of eBooks and other projects.

→ No CommentsTags: eBooks

The eBooks PHP-Tutorials has been updated

March 19th, 2014 · No Comments

The content structure has been re-arranged slightly to improve navigation and a new section has been added on an introduction to WordPress plugins.  This section goes through developing a number of admin pages that might be required for a plugin.   All the code is provided as with other code examples and I hope to add more to this section shortly.

It is now possible to purchase the eBook as a PDF version from the web site http://www.paulvgibbs.com

→ No CommentsTags: eBooks

Updates to eBook PHP Tutorials

January 8th, 2014 · No Comments

The eBook PHP Tutorials – Programming with mySQL and PHP, has been updated.

The changes cover revised section on PHP security and the reformatting of the chapters.

The latest version is available on amazon at:

http://www.amazon.com/dp/B00CBLZ1U0

→ No CommentsTags: eBooks

Updates to eBook PHP Tutorials

November 12th, 2013 · No Comments

The eBook PHP Tutorials – Programming with mySQL and PHP, has been updated to cover a number of additions.

The main change has been clarification of the use of mysqli rather than mysql for connecting to databases.  This has meant a number of code examples have been modified to cover the changes.

The latest version is available on amazon at:

http://www.amazon.com/dp/B00CBLZ1U0

→ No CommentsTags: eBooks

Formatting for Kindle eBooks – Hints, Tips and Tricks

October 28th, 2013 · No Comments

There are a number of articles on formatting an e-book for Kindle so I thought I would contribute my thoughts and ideas so far.

The most common way to create a Kindle e-book is to use Microsoft Word because it includes easy editing features, table of content generation, spell checker, control of style sheets and so on.

You then do a “save as” to HTML from Word to create an HTML document and then apply any adjustments in the HTML code itself. You can create a book from HTML but it would require much more editing. Amazon then takes the HTML document, and converts it to the required format for Kindle devices.

So the principles are:

  • Create a separate Word file for each chapter of your book.
  • Format your document using styles.
  • Create a combined master Word file of all your chapters.
  • Expand the master file into one Word document.
  • Do a Ctrl-A to select all the text and then copy all the text into a new blank Word document.
  • Do a Save As to Filtered HTML so that you end up with one large HTML file with the images in a separate folder.
  • Do some final adjustments and tweaks to the HTML by hand.
  • Preview your HTML in an Amazon previewer application.
  • Zip up the HTML plus the images and then upload to Amazon.
  • Create a cover image and submit it to Amazon.

Word Template
I have included my template for Word which has been quite successful so far. However, I still find I have to do some changes to the HTML by hand.

Click here to download my zip file which includes a Microsoft Word template system.

Word format for Kindle

Font Face
Font face can be whatever you want as Kindle will uses its own default font and the user can define their own font face.

However, you usually select Caliba 11pt

Tabs
Tabs don’t transpose all that well into HTML so it is best to remove any tabs in the Word text. This can be done by searching for ^t

Bullets
Word formatted bullets do not work correctly because they use tabs and have images which don’t seem to convert correctly into HTML I would suggest to use normal unformatted paragraphs but with the * character to represent the bullet.

Tables
Y
ou can use tables in latest Amazon Kindles and you can colour the rows. You have to be careful if the text does not wrap in which case you have to force a line to wrap.

Pictures
Images should be inserted in JPEG (or .jpeg) format with centre alignment (don’t copy and paste from another source).

Select “Insert” > “Picture” >

It is recommended that images are saved at 300 dpi at about 640 pixels wide. The image should not be greater than 127kbyte (63kbyte on older Kindles) so use 300 dpi unless the image file size is too big.

Expanding the sub documents
When you expand the Word documents into one single Word document, do a “copy all” and paste into a new word document to copy the text over. I have found this to be the best method as it removes any dependencies to other sub document files that you may have.

Save as HTML
Once you have completed the formatting in Word and have one combined word document with index pages, preface and so on, you save it as “HTML Word Filtered” and then you should test it in a Kindle viewer and with a web browser.

File -> Save as…

select the location where you want to save the file, and in the “Save as type” drop down list, select

“Web Page, Filtered (*.htm, *.html)”

This will create the HTML page and a folder with all the required images. You should then go through the HTML code and make changes manually.

Editing the HTML
I have found issues with images which I can only seem to fix manually in the HTML code by changing the images to

width=”100%”

and

align=”center”

so that the image scales to fit the width of the page. Note the align=”center” which forces the text to go to the bottom of the image instead of wrapping around it.

When you upload the document to Amazon it converts it so that every first line of each paragraph has an automatic indent.

This seems to be because an assumption by Amazon that all first lines should have an indent and all paragraphs should be justified. For some books this is fine, but personally I don’t like first line indents or justified text.

To overcome this, edit the styles for various p tags with the addition of

text-indent: 0px;

to stop tab indexing.

I have now modified all my Word styles with a first line indent of 0.01.  This is for the normal style.  This has the effect of overriding the Amazon indent style so you dont have to do anything about this.

If you want to set this up yourself, go to the “normal” style, right click on it and and select Modify. Then select Format.. button and then Paragraph… Then in the Special drop down list select First Line and in the amount, enter 0.01cm.

You may want to go into the HTML and search for justify in the HTML code and remove those entries.

Also Amazon displays text as justified so I then edit the HTML styles by hand to add in

text-align:left;

on all paragraph tags. This will cause the text not to be left formatted without justification.

Uploading to Amazon
Once you have your complete HTML document with any images, you should then upload it to Amazon. When you converted to from Word to HTML it would have created a folder of images as well as the HTML file itself. Zip all the files up including the image folder and upload the single zip file. Amazon will unzip and convert and publish the HTML document.

The book Cover image

Kindle has an article on creating a book cover image at:

https://kdp.amazon.com/self-publishing/help?topicId=A2J0TRG6OPX0VM

Essentially this says that there are two types of files for cover images:

JPEG, or .jpeg
TIFF, or .tif(f)

Do not optimise the images as the Amazon process applies its own compression to images when displaying them on its website.
Dimensions
The dimensions of the image should have an ideal height/width ratio of 1.6 so this means:

• A minimum of 625 pixels on the shortest side and 1000 pixels on the longest side
• For best quality, your image would be 1563 pixels on the shortest side and 2500 pixels on the longest side

Colour
Colour images use the standard web RGB (red, green, blue) system which is native to the web and screen displays.
You should use colour images whenever possible and relevant. The Kindle reading device has a black and white display other devices such as the PC and iPhone use colour fonts and images.

Borders for White Cover Art
Cover art with white or very light backgrounds can seem to disappear against the white background.
Adding a very narrow (3-4 pixel) border in medium gray will define the boundaries of the cover.
Some tips for marketing ebooks

The important aspect of a book is the quality. The better the quality the more it will sell. Quality can be many things such as consistency of writing style, formatting of tables, good quality images and so on.
Here are a few tips that may help to market your eBooks:
1 Design a cover that jumps out at you from the amazon store displays. It should look good at full size and as a thumbnail. Make sure that the thumbnail image is readable and recognisable. If you cannot create a good quality cover, then employ a design service to do it for you.
2. Carefully edit and proofread for spelling, grammar and style.
3. Amazon requires a description of the book so make sure that this is interesting and informative.
4. Fill in your author profile at Amazon Author Profile to give information about yourself to your potential readers. Combine this with a blog to keep readers informed about changes to your book.
5. Promote your book online using the standard social networks such as Facebook and Twitter. You can also create a web site for you book providing information and links, promote your book on other sites, message boards and other communities.
6. Create a promotional video and book trailer and upload it to your web site, blog or to your Amazon Author Profile page.
7. Create a physical version of your book using CreateSpace which is a print on demand system.
8. Join the Amazon Associates program to earn an additional 4% on each sale. You can add links to your web pages and gain an additional 4% on each sale when a customer clicks through.

→ No CommentsTags: eBooks

PHP Tutorials: Programming with PHP and mySQL – a Kindle eBook

October 27th, 2013 · No Comments

This announces the latest version of PHP Tutorials: Programming with PHP and mySQL – a Kindle eBook

The new version improves the formatting of code blocks with colour representation of code, adds some extra descriptions to the preface and adds some more code examples.

The latest version is available on amazon at:

http://www.amazon.com/dp/B00CBLZ1U0

→ No CommentsTags: eBooks

Removing depreciated messages

May 25th, 2013 · No Comments

To remove depreciated messages form displays you can use the ~E_DEPRECATED value in the error_reporting function something like the following :

error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);

→ No CommentsTags: General PHP

Warning messages for depreciated functions

April 21st, 2013 · No Comments

In version PHP 5 there is a new warning state of E_STRICT

To remove there warning messages use :

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);

Depreciated functions still exist and you get the warning. So they work as expected. However in a future version they might disappear.

→ No CommentsTags: General PHP

New PHP script to register users on your site

April 15th, 2013 · No Comments

PHP-Register is a new PHP / mySQL application that is used to easily create forms that collect data from your visitors before they are directed to a page of your choice.

The application is easy to instal on on Linux type web server or Windows web server providing it has PHP and mySQL.

In the administration pages you can create forms with each form having input boxes of text, textarea, drop down lists, checkboxes or radio buttons.  Each input may have validation allowing you to define the data that a visitor can enter.

For full details, refer to http://www.withinweb.com/phpregister/

→ No CommentsTags: General PHP · PHP-Register