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.

iText Text farblich hinterlegen

Empfohlene Antworten

Veröffentlicht

Hi Leute,

ich generiere mit iText ein PDF dynamisch. Dabei steht steht dann auf dem pdf z.B. Nachname und darunter "Müller". Das "Müller" soll grau hinterlegt sein. Jetzt wäre die erste Frage ob sowas mit iText geht, also sowas wie fontbackgroundcolor.

Wenn das geht hab ich allerdings ein anderes Problem. Da ich die Werte dynamisch bekomme, kann es sein das ein Feld mal leer ist, also als Label steht dort "2. Vorname". Darunter steht dann dort nichts, es soll aber die mögliche Feldbreite grau hinterlegt sein, also zb 20zeichen lang. Wie könnte man das machen?

mit iText kenne ich mich leider nicht aus, aber wenn du nen leeres Feld hast kannst du das ja prüfen

z.b. mit:

if(text=="")

wenn das der Fall ist schreibst du einfach z.b. 20 Punkte in den String und verfährst wie sonst auch

gebe dir aber keine garantie da ich erst seit kurzem java programmiere :floet: hab vorher c++ programmiert und da wäre sowas auf jeden fall möglich

Strings lieber mit equals vergleichen - oder in dem Fall mit der length() Methode schauen, ob der String 0 ist .)

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.