Skip to main content

the avatar of Klaas Freitag

Kraft Dokumente mit Weasyprint gestalten

Um es deutlicher zu machen, wie mit dem neuen PDF Konverter, der in Kraft Version 0.95 eingeführt wurde, Dokumente gestaltet werden können habe ich ein neues Beispiel-Template in das Kraft Repository gestellt.

Mit diesem Template werden die Posten auf dem PDF in zwei Zeilen ausgegeben: In der ersten Zeile steht der Text, und darunter werden in einer separaten Zeile die Menge, der Einzelpreis und der Gesamtpreis des Posten gedruckt:

Firmen Logo

Außerdem hat das Dokument ein Bild als Firmen-Logo auf der ersten Seite.

Das Template besteht wie die meisten aus zwei Dateien: Das eigentliche Template File (kraft_kfg.gtmpl) und das dazugehörige stylesheet file (kraft_kfg.css).

Um sie zu verwenden, müssen beide Files heruntergeladen werden und im Kraft Einstellungsdialog bei den Dokument Typen das gtmpl File ausgewählt werden. Zu beachten ist, dass der Link zum css File in dem gtmpl File angepasst wird.

Grob gesagt: In dem template file kraft_kfg.gtmpl wird die Dokument-Struktur in html gesetzt, das heisst die Abfolge von Dokumentkopf mit Adressen, dem Einführungstext etc und dann den Posten und so weiter, festgelegt.

Das Stylesheet-File kraft_kfg.css definiert das Aussehen der einzelnen Elemente.

Eine Überschrift

Als grundsätzliches Beispiel sei hier die folgende Zeile herausgegriffen:

<h1>{{ doc.docType }} {{ doc.ident }}</h1>

Die in den geschweiften Klammern stehenden Texte bezeichnen Template-Variablen, die ersetzt werden: doc.docType ist (genau wie doc.ident) ein Wert des Dokumentes, nämlich dessen Dokument-Typ wie Angebot oder Rechnung. doc.ident ist bezeichnet die Dokumentnummer. Es gibt eine feste Anzahl von solchen Variablen, die durch den Kraft-Code festgelegt sind. Es ist hoffentlich durch ihre Verwendung im Template selbsterklärend, was sie bedeuten.

Die beiden Werte werden innerhalb des html tags h1 gedruckt. Das bezeichnet eine Überschrift ersten Grades (die „oberste“ Überschrift), die üblicherweise etwas größer und fett geschrieben wird.

Wie genau die Überschrift in diesem Fall aussehen soll, wird im Stylesheet festgelegt. Dort ist zu finden:

html h1 {
    color: #2f590a;
    font-family: Roboto;
    font-size: 14pt;
    margin: 0;
}

Das bedeutet, dass die Farbe #2f580a verwendet werden soll, und der Text ohne Rand im Font Roboto in der Größe 14 Punkt geschrieben werden soll.

CSS bietet eine große Menge von Gestaltungsmöglichkeiten. Dazu sei auf die zahlreiche Dokuementation im Internet verwiesen.

Meistens wird CSS zur Gestaltung von Webseiten verwendet. Hier wird jedoch ein Druckbild gestaltet. Das ist durch die Zeile, mit dem die Stylesheet Datei geladen wird, festgelegt. Das Attribut media legt den Stylesheet für print Medium fest.

Wie ist das Logo verwirklicht?

Im Template File ist es nur ein HTML Image Tag, das ein Bild von einer URL lädt. Da kann aber auch eine lokale Datei angegeben werden. Dem img Tag die ID „logo“ zugewiesen wird, das es für das CSS identifizierbar macht.

Das Aussehen ist wieder im CSS File festgelegt:

img#logo {
  position: absolute;
  right: 0px;
  top: -150px;
  width: 178px;
  height: 191px;
  z-index: -1;
}

Etwas besonderes ist hier, das das Bild mit einer absoluten Position gesetzt wird. Die Positionsangaben werden in Pixel angegeben. Das Bild wird direkt an den rechten Rand und 150 px von oben (ein positiver Wert würde vom unteren Papierrand aus zählen) auf die Ausgabe gesetzt.

Ich hoffe, dieses Beispiel erleichtert das Anpassen des Templates an die eigenen Bedürfnisse ein wenig. Am besten geht man dabei schrittweise vor und verändert immer nur ein Detail nach dem anderen.

the avatar of Ish Sookun

Microsoft Edge preview for Linux

Microsoft Edge preview for Linux

Last November, Microsoft announced that its Edge browser is coming to Linux in the near future. That day has arrived.

On 20 October 2020, Microsoft released Edge preview builds for Linux and with that Microsoft Edge is now available for all major desktop and mobile platforms.

Microsoft Edge preview for Linux
Microsoft Edge on all major platforms

DEB and RPM packages are available on the Microsoft Edge Insider website. These packages are updated every week.

Hence, to install Microsoft Edge on openSUSE, simply download the .rpm file and use zypper for the installation.

sudo zypper in ~/Downloads/microsoft-edge-dev-88.0.680.1-1.x86_64.rpm

That's it! You should now be able to run Edge on openSUSE. In fact, the above screenshots are from the Edge build version 88.0.680.1 running on openSUSE Tumbleweed.

Microsoft Edge preview for Linux
Microsoft Edge build version 88.0.680.1
the avatar of openSUSE Mauritius

Does Microsoft Edge run on openSUSE Linux?

The short answer is, yes!

Microsoft Edge is a web browser developed by Microsoft. It is based on the open source project Chromium and it aims to be fully cross-platform. It was released in 2015 for Windows 10 and it became available for Android and iOS in 2017. A preview for Linux became available in October 2020.

If you visit the Microsoft Edge website using a browser on a Linux machine at the moment it will display that it is not supported for Linux. In order to download the the preview for Linux, you need to visit the Microsoft Edge Insider page. The preview is available from the Edge Dev Channel which releases weekly updates.

Microsoft Edge for Linux
Microsoft Edge for Linux

You can select to download a .deb or .rpm file according to the Linux distribution you are using. In our case, for our openSUSE desktop machine, be it Leap or Tumbleweed, we are going to download the .rpm file.

The file is approximately 87 MB.

Once the download is complete we can use zypper to install.

sudo zypper in ~/Downloads/microsoft-edge-dev-88.0.680.1-1.x86_64.rpm

The application shortcuts will be created.

At first run, Microsoft Edge goes through a traditional setup of EULA acceptance, privacy notice and configuring the browser appearance.

Microsoft Edge post setup
Microsoft Edge post setup

Edge is now ready to be used on the openSUSE Tumbleweed desktop!

the avatar of Nathan Wolf

the avatar of Nathan Wolf
a silhouette of a person's head and shoulders, used as a default avatar

openSUSE Tumbleweed – Review of the week 2020/44

Dear Tumbleweed users and hackers,

Week 44 brought, among many other things, an upgrade to Kernel 5.9.1. The feedback I had seen so far was good, so people can still do their work.

In total, Tumbleweed has released 5 snapshots (1023, 1024, 1025, 1026, and 1028) during this week. The most noteworthy changes include:

  • Freetype 2.10.4
  • sssd 2.4.0
  • Ghostscript 9.59.3 (there is again a patch lever in the version number; some scripts/apps trip over this)
  • Mozilla Firefox 82.0
  • Mozilla Thunderbird 78.4.0
  • Cups 2.3.3
  • Linux kernel 5.9.1
  • GStreamer 1.18.0
  • Ruby 2.6 has been completely eliminated
  • nasm 2.15.05
  • PostgreSQL 13
  • jsoncpp 1.9.4

Looking back at the stuff being integrated, that was indeed a big part of that list. Currently, we build these major changes in our staging projects (ar are aware of the changes upcoming soon)

  • KDE Plasma 5.20.2
  • Perl 5.32.0
  • GLibc will be configured with CET enabled (Intel Control-flow Enforcement Technology)
  • LLVM 11
  • RPM 4.16
  • Ruby 3.0 (final release is scheduled for the end of December)
  • GNOME 3.38.1: awaiting sec review for malcontent (parental control feature)
  • openssl 3.0 (long-term; no progress in the last few weeks)
the avatar of YaST Team

Digest of YaST Development Sprint 111

Another development sprint ended for the YaST Team this week. This time we have fewer news than usual about new features in YaST… and the reason for that may surprise you. Turns out a significant part of the YaST Team has been studying the internals of Cockpit in an attempt to use our systems management knowledge to help to improve the Cockpit support for (open)SUSE.

But that doesn’t mean we have fully stopped the development of YaST and other parts of the installation process. Apart from working in several not yet finished improvements that will be presented in our next blog post, we have:

While doing all that and fixing several bugs, we also found time to prepare and deliver our presentation in the openSUSE + LibreOffice Virtual Conference, with the self-explanatory title of “Top 25 New Features in (Auto)YaST”. We are not fully sure whether a recording of the talk will be uploaded by the organizers at some point, but we will keep you informed if that happens.

That’s all folks! See you again in (hopefully less than) two weeks.

the avatar of openSUSE News

PostgreSQL 13, Latest Stable Kernel Update in Tumbleweed

The past week has been pretty productive for openSUSE Tumbleweed as five major version updates landed in the rolling release.

Five snapshots have so far been released since the last Tumbleweed article.

One of the two major version updates in the latest 20201026 snapshot was a Mozilla Firefox 82.0 update; the new version resolved seven Common Vulnerabilities and Exposures and improved performance with restoring sessions and page loads. Mozilla Thunderbird also had an update to version 78.4.0, which added some mail extension Application Programming Interfaces. The printing update to cups 2.3.3 added a workaround for the scheduler’s systemd support and fixed a warning options support for GNU Compiler Collection 9. A daylight saving time fix for glib2 2.66.2 changed the default format. The 5.9.1 Linux Kernel arrived in the snapshot and fixed a kernel panic bsc#1177973. MariaDB updated to version 10.5.6 from 10.4.14, which implemented new features and made all binaries previously beginning with mysql to begin with mariadb or with symlinks for the corresponding mysql command. The other major version update was to perl-URI 5.05 from version 1.76; the change was made to bump all versions to 5.05 in order to remove various version mismatches, according to the changelog. The snapshot is trending moderately at an 83 rating on the Tumbleweed snapshot reviewer.

Only two Python packages arrived in snapshot 20201025, which is trending at a 96. A major version update of python-hyperlink 20.0.1, which provide pure-Python implementations of immutable URLs, fixed several bugs related to hidden states; this made all data on a URL object (including rooted and uses_netloc) reflective by and consistent with its textual representation. The update of python-numpy 1.19.2 increased the required memory to avoid test failures and openQA found an issue (boo#1176832) and upgraded older distro versions, which did not package f2py using update-alternatives.

Two more major version updates arrived in snapshot 20201024 and postgresql 13 was one of them. Significant improvements in postgresql 13 include indexing and a lookup system that benefit large databases; this helps with space savings and performance gains for indexes as well as faster response times for queries that use aggregates or partitions. A list of improvements can be found in the project’s news release. The other major version update was to the utility manager ndctl 70.1, which added firmware activation support. A few Advanced Linux Sound Architecture packages updated to version 1.2.4, which lists some configuration changes along with a few new hotplugs for AICA (Dreamcast) Firmware and AudioScience ASIHPI Firmware. Debugging tools in the xfsprogs 5.9.0 package fixed the potential unterminated string problem for libhandle. The snapshot is trending at a 90.

The two previous snapshot, 20201023 and 20201022, both have a 99 rating.

The 20201023 snapshot updated freetype2 2.10.4 that fixed a heap buffer overflow introduced in version 2.6. Ghostscript interpreter 9.53.3 provided some fixes for a few crashes and introduced a patch that took care of an unexpected side effect, which prevented multithreaded rendering and background rendering from working correctly. The transport protocol v2 has become the default again with git 2.29.0 and system daemon sssd 2.4.0 allows session recording to exclude specific users or groups when scope is set to all.

KDE’s Plasma 5.20.1 arrived in snapshot 20201022; the release had bugfix for KWin, Bluedevil and Breeze. One of the Plasma Desktop changes fixed the sizing of the media controls. The 7.73.0 of the data transfer tool curl had a lengthy amount of updates to an addition of an add –output-dir.

the avatar of openSUSE News

openSUSE Community To Have Kickoff Session for Leap 15.3

The openSUSE community is inviting package maintainers, contributors, open source developers and Leap 15.3 stakeholders to join the openSUSE community for a kickoff of Leap 15.3.

The kickoff session starts Nov. 4 at 16:30 UTC on https://meet.opensuse.org/LeapKickoff.

The session will start with a short pre-recorded video updating attendees about the status of Jump 15.2.1, explaining what to expect from the Leap 15.3 release and presenting a roadmap forward for the release.

“Let me share with you the next steps with Closing The Leap Gap and openSUSE Leap and what I’ve agreed upon today with openSUSE Board members,” wrote release manager Lubos Kocman in an email for developers on the Factory mailing list. “ I believe we have no issues with meeting Alpha/Beta criteria for Leap 15.3, unlike criteria used for Go/noGo for 15.2.1. We should have an initial setup done by the 4th of November to meet the roadmap.

“I want to close one chapter so the openSUSE Release team can focus on the upcoming Leap release,” he wrote.

The kickoff is meant to be an informative session followed by a friendly chat/social over a virtual coffee, tea or beer (BYOCTB).

the avatar of Nathan Wolf