Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] ZugferdDocumentPdfBuilder brakes Hyperlink #139

Closed
michaelbenker opened this issue Oct 15, 2024 · 3 comments · Fixed by #140
Closed

[QUESTION] ZugferdDocumentPdfBuilder brakes Hyperlink #139

michaelbenker opened this issue Oct 15, 2024 · 3 comments · Fixed by #140
Assignees
Labels
question Further information is requested

Comments

@michaelbenker
Copy link

Describe the bug
I create a PDF Bill with TCPDF and FPDI for displaying my bill which woks fine. Inside this PDF there is Link for further Informations
then i create the XML like described and merge the two data
Everything worked, except the link for the Infos

To Reproduce

<?php
require_once('tcpdf_include.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->AddPage();
$pdf->Cell(80,5,"Invoice Nr...",0,1);
// ....more billing data
$html = '<a href="..." style="">More Infos</a>';
$pdf->writeHTMLCell(
    $w = 170,         // Zellenbreite
    $h = 20,         // Zellenhöhe
    $x = '',         // X-Position (automatisch)
    $y = $this->GetY()+1,         // Y-Position (automatisch)
    $html,           // HTML-Inhalt
    $border = 0,     // Rahmen
    $ln = 1,         // Neue Zeile nach Zelle
    $fill = false,    // Füllung (Hintergrund)
    $reseth = true,  // Höhe zurücksetzen
    $align = 'L',    // Textausrichtung: Zentriert
    $autopadding = true // Automatisches Padding
);

$filename = 'invoice.pdf';
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="' . $filename . '"');

$pdfOutputPath = __DIR__.'/../tmp/printlayout.pdf';  // Speichere das erzeugte PDF
$this->Output($pdfOutputPath, 'F');

$document = $this->generateEInvoice();
$pdfBuilder = new ZugferdDocumentPdfBuilder($document, $pdfOutputPath); 
echo $pdfBuilder->generateDocument()->downloadString($filename);

I see the Label of the Link, but the hyperlink is broken
invoice.pdf

@michaelbenker michaelbenker added the bug Something isn't working label Oct 15, 2024
@horstoeko
Copy link
Owner

Hi,

I don't think this is a bug in my library... I use a third-party library - namely setasign\Fpdi. Please describe the problem there. Unfortunately there is nothing I can do.

@horstoeko horstoeko added question Further information is requested and removed bug Something isn't working labels Oct 15, 2024
@horstoeko horstoeko changed the title [BUG] ZugferdDocumentPdfBuilder brakes Hyperlink [QUESTION] ZugferdDocumentPdfBuilder brakes Hyperlink Oct 15, 2024
@horstoeko
Copy link
Owner

Hi @michaelbenker,

A small update on my part. I have identified the problem. It was a missing parameter in a function of “setasign\Fpdi”. I have included this. My manual tests went very well. I'm doing a release today and ask you to test it accordingly and give me feedback.

Best regards

horstoeko added a commit that referenced this issue Oct 16, 2024
#139 Fixed ZugferdDocumentPdfBuilder brakes Hyperlink
@michaelbenker
Copy link
Author

thank you very much :-)

Repository owner locked and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants