我正在使用PdfBox(2.0.16)(以前是在iText中)迁移我们的Pdf库。我正在尝试按照How to delete an optional content group alongwith its content from pdf using pdfbox?删除OCG 但是我做不到。
pdf文件是由iText生成的。
public static class ApiHelper
{
public static HttpClient ApiClient { get; set; }
public static void InitializeClient()
{
ApiClient = new HttpClient();
ApiClient.DefaultRequestHeaders.Accept.Clear();
ApiClient.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue("application/json"));
}
}
public class MovieGetter
{
public static async Task<Movie> LoadMovie(int movieId)
{
string url = "";
url = $"https://api.themoviedb.org/3/movie/{ movieId } api_key=da521929456d16e8 ";
using (HttpResponseMessage response = await
ApiHelper.ApiClient.GetAsync(url))
{
Movie movie = await response.Content.ReadAsAsync<Movie>();
return movie;
}
App.xaml
<Application x:Class="Api.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Api"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
打开生成的Pdf文件时出错。任何帮助都将不胜感激。