GSoC 2017 Diaries with Sugar Labs - 5

Hello everyone... Over last two weeks I spent time on generating PDF of the Music Blocks User Guide. I tried two different approaches for this purpose.
  • Using a JavaScript PDF generator to generate PDF from the client side.
  • Using a PDF generator to generate PDF from the server side. - In my case PHP supporting PDF generator
You can find my source code from here. In my approach, I looked into,
  • Removing the navigation and blocks menus on the left side.

1.PNG
2.PNG
  • Removing audio and video components.

  • Adjusting texts and images fit the PDF pages.  

Anyways, I decided to do PDF generation via a PHP library as it would give more control over the process. I played with several open source PDF generators over last two weeks. Majorly with FPDF library and TCPDF library.


FPDF Library
TCPDF Library


I decided to work with TCPDF generator for my GSoC project because of its supporting functionalities specially because of converting HTML page directly into PDF preserving most of the CSS styles.


Web page
PDF page
5.PNG
There are a couple of issues exist to resolve with the PDF generation process such as,

  • The content of the PDF file pages is not aligned properly because of the CSS styles of margins and paddings of the web pages; some functions need to be implemented to remove those unnecessary CSS stylings for PDF pages.
  • There are many GIFs in web pages so it takes a considerable amount of time when generating the PDF; I thought of creating new web pages removing GIFs and replace them with an image of the final output shown in the GIF and include those pages for the PDF generation.

Comments

Popular posts from this blog

UML - Use Case Diagrams

How I faced to OCJP exam...

My Experience at Women Techmakers Leads Mini-summit APAC at Google Singapore