Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

614 B
Raw Blame
/**
 * An iPhone or iPad ignores print() in an app added to the Home Screen, in the
 * page and in an iframe alike, so the trip PDF cannot be saved from there. Safari
 * can print it. This is the link that hands the export over: it opens the trip in
 * Safari with the export dialog already up.
 */

export const EXPORT_PARAM = 'export';
export const EXPORT_PDF = 'pdf';

/** The trip, opened with its export dialog showing. Absolute, since it leaves the installed app. */
export function pdfExportUrl(tripId: number): string {
  return `${window.location.origin}/trips/${tripId}?${EXPORT_PARAM}=${EXPORT_PDF}`;
}