Utilizing hiqpdf for embedding unique fonts into documents

I am currently attempting to create a PDF from HTML using Hiqpdf. Their website states that this dll supports font embedding, but I am encountering difficulties when trying to use fonts stored on my computer.

@font-face {
font-style:normal;
font-weight:normal;
font-family:f2generic;
src:url('C:/Users/myuser/AppData/Local/Temp/f2generic.otf')  format("opentype");}

It seems like the issue might be with the path or the format of the font. In HTML, the fonts display correctly, but for some reason it's not working with the PDF conversion.

I have confirmed that the htmlToPdfConverter.Document.FontEmbedding property is set to true, so I am unsure why it is not functioning properly.

Any help or insight would be greatly appreciated.

Answer №1

It is advisable to utilize fully qualified URLs when referencing resources, such as

file:///C:/Users/myuser/AppData/Local/Temp/f2generic.otf

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

CSS formatting may not be maintained when additional content is inserted after the initial text

Just a heads up, I'm relatively new to coding! I have a header and text that I want to overlay on a background image using CSS, so getting the positioning right is crucial. Everything was working fine until I added more HTML content below the text. ...

Does scaling images for responsive web design help conserve bandwidth?

As I dive into the realm of creating responsive websites, I have encountered discussions about the challenges that arise when handling images. It seems that using images can consume a significant amount of bandwidth, especially when scaling down a larger i ...

The value coming from the Datalist is indeterminable, as Datalist is dynamically created through AJAX requests

In my HTML code, I have a Select element and a Datalist element. The Select displays options for different states like NY or NJ, while the Datalist contains a list of school names that are generated dynamically using Ajax with PHP because the schools depen ...

Tips for stopping a drop-down box from changing its size

Currently working with C# and jquery. I've implemented a dropdown box containing 20 elements, each sized according to the largest element's text length. In addition, there is a checkbox that, when clicked by the user, removes all selections from ...

Tips for adjusting the progress bar to 100% and back to 0%

My goal is to increase the progress bar percentage with each click. Currently, it only goes up to 75%. When saving, it should show 100%, but it's not displaying that properly. On clicking the back button, it should reset to 0% on the third click. HTM ...

What's the best way to place my image inside a Bootstrap Accordion so that it is housed within the accordion-item?

I've been facing an issue with a Bootstrap Accordion. Everything works fine, except when I try to insert an image <img src="https://placehold.co/600x400" class="img-fluid" /> into an accordion-item <div class="accord ...

Bootstrap: Right aligning text labels

I need help with aligning a text label to the right using Bootstrap 5. Currently, when I use the following code: <div class="form-floating text-dark text-end float-right"> <input type="password" class="form-control text- ...

What could be causing my bootstrap cards to have varying lengths?

I'm currently working on a project that requires me to apply a specific responsive design using HTML Bootstrap classes. I've managed to format it the way I want, but I'm puzzled as to why the width of my cards within rows is inconsistent in ...

What is the best way to convert a string from a csv file into an integer using Python?

I'm currently working on a code that involves processing data obtained from this source () and organizing it into a CSV file. My goal is to create a program that calculates the BMI of each player, then identifies them as obese if their BMI exceeds 30 ...

jQuery Files in Conflict

The issue I am facing involves the code below. The first function requires linked js and css, while the second one needs a jQuery and javascript file inherited from base.html. However, there seems to be a conflict in loading these files (possibly because o ...

How can I extract the text within a Span tag using Selenium WebDriver?

Is there a way to retrieve the text from a span tag and print it using Selenium Webdriver? I am looking to extract the text UPS Overnight - Free The HTML code is as follows: div id="customSelect_3" class="select_wrapper">> <div class="select ...

Easily update form elements with dynamic MySQL integration

I am currently working on creating a page that allows users to add and delete "soldiers" dynamically. Here is the structure I am aiming for: [Text-box][Delete] [Text-box][Delete] [Add-Soldier] It is important to me that this functionality supports MySQL ...

Organizing stepper elements within a wrapper with bootstrap for a seamless layout

I am struggling with making a list of header icons in a Stepper container responsive to page size changes. I have attempted to adjust the placement of the container within different div elements, but it has not yielded the desired results. My current setu ...

Efficient HTML5 Section Loading with Images using Lazy Loading

I have a portfolio section on my single page website, divided into sections using HTML5 section Tags. <section id="portfolio" class="light-bg"> The portfolio section contains various images (totaling 16 MB). <!-- Portfolio item --> < ...

Choose a personalized option from a dropdown menu using Selenium and Python

I am currently attempting to programmatically choose an option from a dropdown menu using Python and Selenium. The dropdown contains various values ranging from 1 to 11. Users are expected to interact with the dropdown, select a value between 1 and 11, and ...

Question regarding CSS positioning: How do you place an asterisk inside a display block element?

The platform I'm working with is generating code like the one below for forms: <div class="sf-fieldWrp"> <label for="Textbox-3">Contact Name</label> <input type="text" value="" requi ...

SwiperJS continuously applies additional right margin to every slide

My Swiper carousel seems to be adding an unnecessary 5px margin-right to each slide, resulting in the cards not fitting into one frame. https://i.sstatic.net/fwn5G.png I attempted to fix this by setting the margin-right to 0px for the .swiper-slide class ...

Attempt to apply border-bottom style results in negligible changes

I have a snippet of HTML that showcases a grid-like structure. It's mostly how I want it to be, but I would like the last three rows to have a dotted underline. I attempted to achieve this using the following styling: style="border-bottom:dotted; bor ...

What is the best way to create vertical separators between CSS grid elements?

I currently have a grid with 3 columns and would like to add two vertical lines to separate the elements. To achieve this, I have placed two span elements between the grid elements using css styling. .vertical_line { position: absolute; height: 100%; ...

Error Encountered: DOM Exception 1 - INDEX_SIZE_ERR while trying to retrieve imageData

When trying to convert my image into grayscale using the code below, I encounter a Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 when deploying it on the server. I suspect this issue may be related to different domains, as the problem only occurs in Chro ...