Properties: option to export to PDF

I found two workaround options using Dataview.

First one using DQL listing all fields as a table:

TABLE WITHOUT ID file.frontmatter AS Properties
WHERE file.name = this.file.name

Second one using JavaScript (more versatile as you can exclude certain fields that you do not want to export, but also much more involved):


// Retrieve the current file's frontmatter
let frontmatter = dv.current().file.frontmatter;

// Define fields to exclude (adapt as necessary)
let excludeFields = ['tags', 'created']

// Extract and filter the keys and values based on the exclusion list
let filtered_keys = Object.keys(frontmatter).filter(key => ! excludeFields.includes(key));
let filtered_values = filtered_keys.map(key => frontmatter[key]);

// Define an array to hold each row of the table
let rows = [];

// Populate the rows array with key-value pairs
for (let i = 0; i < filtered_keys.length; i++) {

	// Convert array values (e.g. tags) to a single string separated by commas
	let value = Array.isArray(filtered_values[i]) ? filtered_values[i].join(', ') : filtered_values [i];
	rows.push([filtered_keys[i], value])
}

// Generate a table with two columns and populate with rows

dv.table(['Properties', 'Values'], rows)
7 Likes