If output_file is not provided, the base64 string will be printed to console.
input_path (str): Path to the input PDF file. output_path (str, optional): Path to save the Base64 string. If None, prints to stdout.