1
0
Fork 0
Everything2Everything/src/EverythingToJpeg.Core/ConvertOptions.cs
Yun Chan 5750aed16f Phase 3: HTML(WebView2) + HWP/HWPX(LibreOffice) 실구현
HTML / HTM
- HtmlProvider: STA 스레드 + WPF Dispatcher에서 WebView2 헤드리스 컨트롤러(HWND_MESSAGE) 생성
- CDP Page.captureScreenshot(captureBeyondViewport=true)으로 풀페이지 PNG 획득
- Magick.NET으로 JPEG 인코드, 알파/리사이즈/품질 옵션 일관 적용
- ConvertOptions: HtmlViewportWidth/Height, HtmlWaitMilliseconds, HtmlFullPage

HWP / HWPX
- HwpxProvider: LibreOffice headless --convert-to pdf + H2Orestart 확장 자동 감지
- DocxProvider 패턴 재사용 (소스→PDF→PdfProvider 위임)
- ExternalToolDetector.IsH2OrestartInstalled — uno_packages/extensions 검색

기타
- Core csproj: UseWPF=true (WebView2가 WPF 의존), Microsoft.Web.WebView2 1.0.3912.50 추가
- AppX 매니페스트에 .html/.htm/.hwp/.hwpx ItemType 추가
- 파일 다이얼로그 필터 확장
- 두 ComingSoon 상태였던 Provider가 이제 Available/RequiresExternal로 노출됨

검증
- 솔루션 Release 빌드 통과
- MSIX 38개 페이로드 패키징 성공 (WebView2 SDK 포함)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 13:23:47 +09:00

48 lines
1.1 KiB
C#

namespace EverythingToJpeg.Core;
public enum OutputLocation
{
SubfolderBesideSource,
SameFolderAsSource,
Custom
}
public enum NameCollision
{
AppendNumber,
Overwrite,
Skip
}
public sealed class ConvertOptions
{
public int Quality { get; set; } = 92;
public OutputLocation OutputLocation { get; set; } = OutputLocation.SubfolderBesideSource;
public string SubfolderSuffix { get; set; } = "_jpeg";
public string? CustomOutputDirectory { get; set; }
public NameCollision OnCollision { get; set; } = NameCollision.AppendNumber;
public int? MaxLongEdgePixels { get; set; }
public int PdfDpi { get; set; } = 200;
public bool KeepExifWhenPossible { get; set; } = true;
public bool FlattenTransparency { get; set; } = true;
public string TransparencyBackground { get; set; } = "#FFFFFF";
public int HtmlViewportWidth { get; set; } = 1280;
public int? HtmlViewportHeight { get; set; }
public int HtmlWaitMilliseconds { get; set; } = 2000;
public bool HtmlFullPage { get; set; } = true;
public static ConvertOptions Quick() => new();
}