Archive

Archives pour 10/2009

How to solve the link issue with FPDF/phpToPDF

To create PDF documents with PHP, FPDF is a very useful library. And to create PDF documents with FPDF even easier there is phpToPDF.

However, by using this last one in order to create a summary automatically inserted into the document, I encountered an issue which make that each link inserted after the summary was shifted of one page : the link was correctly added and click-able but the zone was located one page before.

After many searching, I succeed to solve this issue by updating the phpToPDF code as this :

In the insertTOC() function, update with:

//grab it and move to selected location
$n=$this->page;
$n_toc = $n – $tocstart + 1;
$last = array();
$last_links = array();

//store toc pages
for($i = $tocstart;$i <= $n;$i++)
{
$last[]=$this->pages[$i];
$last_links[] = $this->PageLinks[$i];
}

//move pages
for($i=$tocstart – 1;$i>=$location-1;$i–)
{
$this->pages[$i+$n_toc]=$this->pages[$i];
$this->PageLinks[$i + $n_toc] = $this->PageLinks[$i];
}

//Put toc pages at insert point
for($i = 0;$i < $n_toc;$i++)
{
$this->pages[$location + $i]=$last[$i];
$this->PageLinks[$location + $i] = $last_links[$i];
}

Categories: PHP Tags: ,

How to comment and uncomment with the flick of a hand

Something absolutely useless but which could be however sometimes useful…

How comment/uncomment two bit of code in one time, in order to make tests, with // and /* */ comments.

first-codeAnd to switch:

second-codeReally impresive, isn’t it?

Categories: Hints & Tips Tags:

CyBWarrior jumps to WordPress

logoIt did not escape to the attention : CyBWarrior has changed again. This time, we hope this will the last move :-)

We actually moved to the very efficient software WordPress. Why? Simply to enjoy a stable and powerful framework in order to spend more time to write content and less time to build the CMS. [special sentence for English users]It will allow us to write and translate more content to English language! You would be happy, isnt’it?[/special sentence for English users]

We made our best to move the content from the former system to the new one : there was hundreds of posts and comments, thousands of messages on the board, dozens of files to download! We hope everything will be available as previously. However, it may be some things are not perfect… Don’t hesitate to share your remarks if you find something which doesn’t work as expected! [special sentence]And if you find mistake in some English texts, don’t hesitate too! This is written by a French speaker who just try to make his best to be understandable[/special sentence]

Especially, because passwords are encrypted into the database, we were unable retrieve them in clear text in order to convert them for the new system − we trully use a high-secure system, what did you expect :) . People who would like to log in again will have to request a new password. We seriously hope they will be thousands ;)

Categories: News Tags:

The Google barcode

Don’t know if this a hot news, but I notice it only today…

When you try to look for an URL in Google, the logo of the well-known search engine changes for a barcode! Interesting, isn’t it?

le-code-a-barres-de-google

What is coding the barcode? Probably something relative to the San Fransisco tycoon… But we’ve to make sure!