# Properties: option to export to PDF

**URL:** <https://forum.obsidian.md/t/properties-option-to-export-to-pdf/63899>\
**Category:** Feature requests\
**Tags:** pdf-viewer, properties, valuable\
**Created:** [July 27, 2023, 7:58pm UTC](https://forum.obsidian.md/t/properties-option-to-export-to-pdf/63899 "2023-07-27T19:58:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Lu\_do](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@Lu\_do](https://forum.obsidian.md/u/Lu_do)\
**Post date:** [April 9, 2024, 6:55am UTC](https://forum.obsidian.md/t/properties-option-to-export-to-pdf/63899/5 "2024-04-09T06:55:10Z")

</div>

I found two workaround options using Dataview.

First one using DQL listing all fields as a table:

```dataview
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):

```dataviewjs

// 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)

```

---

_[View the full topic](https://forum.obsidian.md/t/properties-option-to-export-to-pdf/63899)._
