Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(FPDF) $this->Image Positionierung anhand cell

Empfohlene Antworten

Veröffentlicht

Schönen guten morgen,

habe mich letzte Woche an FPDF gewagt und schon ein nettes Template hinbekommen. Probleme habe ich mit der Positionierung des Bildes in meiner Artikelübersicht.

Die unschöne erste Lösung war:


// ausgabe der spalten

$this->Cell(20,25,$id,0,0,'C',1);

$this->Cell(65,25,$this->Image('medien/artikel/'.$row['bild'].'.jpg',$this->GetX(),$this->GetY(),0,20),1,0,'C',0);

$this->Cell(35,25,$titel,1,0,'C',1);

$this->Cell(25,25,$preis.' '.EURO,1,0,'R',1);

Hier habe ich das Problem, dass ich beim einfärben der Zelle (wegen der abwechselnden Zeilenfarbe innerhalb der Tabelle) das Bild mitabdecke. Durch google habe ich gelesen, dass folg. Lösung besser wäre (die aber bei mir garkein Bild anzeigt):

// ausgabe der spalten

$this->Cell(20,25,$id,0,0,'C',1);

$this->Cell(20,25,'',0,0,'C',1);    // leere Celle als Platzhalter

     $this->Image('medien/artikel/'.$row['bild'].'.jpg',$this->GetX(),$this->GetY(),0,20); // bild an die aktuelle position über der zelle

$this->Cell(35,25,$titel,1,0,'C',1);

$this->Cell(25,25,$preis.' '.EURO,1,0,'R',1);

Kennt einer eine funktionierende Lösung?

Vorab schon einmal vielen Dank..

Konnte das Problem weggecheaten, indem ich ein Rechteck in den Hintergrund (vor die Zelle) gesetzt habe:

$this->Rect($this->GetX(), $this->GetY(), 65, 25, 'F');

Elegantere Lösungen erwünscht! (:

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.