SOLVED: How to change the border style in the invoice?

How to change the border style in file invoice(*.pdf) from “solid” to “dotted”?
I just want to change the border style: so that the outer and inside border’s is “dotted”, not “solid”…

Bordersonpdf.png

Thank you in advance!

Yours faithfully,
Vadim

P.S. I apologize for your english
:wink:

Hello, I have looked into \core\lib\pdf.lib.php and can’t seem to find how the lines are drawn. Sorry I couldn’t help further

Hello,

Yes, I have already watched this file.
Even tried to insert the code:



input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
font-size: <? php print $ fontsize?> px;
font-family: <? php print $ fontlist?>;
background: #FFF;
color: # 000; / * # 111; * /
border: 1px dotted # C0C0C0;
margin: 0px 0px 0px 0px;
}


but nothing has changed …

Hi,

This is not simple.
The PDF library that generat the PDF is TCPDF.
You have a dotted rectangle exemple there : https://tcpdf.org/examples/example_012/

Need a strong PHP level to integrate

1 Like

Hello everybody!

I found and began to change the file: pdf_crabe.modules.php, which is in the directory: htdocs/core/modules/facture/doc and I managed to change, but only the internal border … Pffff

I found the following code:



// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array(‘dash’=>‘1,1’,‘color’=>array(40,40,40)));
//$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
$pdf->SetLineStyle(array(‘dash’=>0));
}
$nexY+=2; // Passe espace entre les lignes


I’ll try to figure it out …

ksar, thank’s for your link, but perhaps this is not exactly what will help…
But thanks anyway!

I found file: tcpdf_config.
In this file, you can change the font, size, color, etc, but why cann’t change the border-style?

Does anyone have any idea?

Hello everybody!

Can anybody help to change “solid” borders to “dotted” borders in the dolibarr invoice (*.pdf)?
I installed iDolibarr on my Synology (NAS), but the way I did before (changed in the default module “crabe”), does not work anymore …

Best regards,
Vadim

Pfffff…
Having carefully studied the structure of the TCPDF, I found a solution:

  1. Open the file pdf_crabe.modules.php ( located /htdocs/core/modules/facture/doc)
  2. And then we use line style. Array with keys among the following:
    * width i[/i]: Width of the line in user units.
    * cap i[/i]: Type of cap to put on the line. Possible values are: butt, round, square. The difference between “square” and “butt” is that “square” projects a flat end past the end of the line.
    * join i[/i]: Type of join. Possible values are: miter, round, bevel.
    * dash i[/i]: Dash pattern. Is 0 (without dash) or string with series of length values, which are the lengths of the on and off dashes. For example: “2” represents 2 on, 2 off, 2 on, 2 off, …; “2,1” is 2 on, 1 off, 2 on, 1 off, …
    * phase i[/i]: Modifier on the dash pattern which is used to shift the point at which the pattern starts.
    * color i[/i]: Draw color. Format: array( GREY ) or array ( R,G,B ) or array( C,M,Y,K ).

And Voila!

P.S. Thanks to ksar! Gave the right direction !!!

Hey that’s fantastic!

What are the setting you have used for the no border and dotted lines? If you could kindly specifiy which settings produce which line (based on your picture) then I can move this post to the Tips and Tricks category to benefit other users.

aljawaid,

Dash (mixed) pattern.
0” - without any borders;
1” - with border (string with series of length values…)

And color (array).
Format:
- array( GREY ) or array ( R,G,B ) or array( C,M,Y,K ) | array( GREY ) or array ( 128,128,128 ) or array( 0,0,0,62 )

Best regards,
Vadim
:wink: