Skip to content

add --PDF-NO-BITMAPMISSINGFONTS param #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/MainUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ TDocumentConverter = class
FIncludeDocProps: boolean;
FKeepIRM: boolean;
FDocStructureTags: boolean;
FBitmapMissingFonts: boolean;


procedure SetCompatibilityMode(const Value: Integer);
Expand All @@ -90,6 +91,7 @@ TDocumentConverter = class
procedure SetIncludeDocProps(const Value: boolean);
procedure SetKeepIRM(const Value: boolean);
procedure SetDocStructureTags(const Value: boolean);
procedure SetBitmapMissingFonts(const Value: boolean);


protected
Expand Down Expand Up @@ -185,6 +187,8 @@ TDocumentConverter = class
property IncludeDocProps : boolean read FIncludeDocProps write SetIncludeDocProps;
property KeepIRM : boolean read FKeepIRM write SetKeepIRM; // XPS-no-IRM
property DocStructureTags : boolean read FDocStructureTags write SetDocStructureTags;
property BitmapMissingFonts : boolean read FBitmapMissingFonts write SetBitmapMissingFonts;


property WordConstants : TResourceStrings read getWordConstants;
property OfficeAppName : String read FOfficeAppName write FOfficeAppName;
Expand Down Expand Up @@ -509,6 +513,7 @@ constructor TDocumentConverter.Create;
FIncludeDocProps := true;
FKeepIRM := true;
FDocStructureTags := true;
FBitmapMissingFonts := true;
FInputFiles := TStringList.Create;
end;

Expand Down Expand Up @@ -1241,6 +1246,11 @@ procedure TDocumentConverter.LoadConfig(Params: TStrings);
FKeepIRM := false;
dec(iParam);
end
else if (id = '--PDF-NO-BITMAPMISSINGFONTS') then
begin
FBitmapMissingFonts := false;
dec(iParam);
end
else if (id = '-W') or
(id = '--WEBHOOK') then
begin
Expand Down Expand Up @@ -1557,6 +1567,11 @@ procedure TDocumentConverter.WriteOfficeAppVersion(Version: String);
LogDebug('Writing Version to File:' + ConfigFileName,VERBOSE);
end;

procedure TDocumentConverter.SetBitmapMissingFonts(const Value: boolean);
begin
FBitmapMissingFonts := Value;
end;

procedure TDocumentConverter.SetCompatibilityMode(const Value: Integer);
begin
FCompatibilityMode := Value;
Expand Down
2 changes: 1 addition & 1 deletion src/WordUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function TWordDocConverter.ExecuteConversion(fileToConvert: String; OutputFilena
KeepIRM,// KeepIRM:=True, _
BookmarkSource,// CreateBookmarks
DocStructureTags,// DocStructureTags:=True, _
true,// BitmapMissingFonts:=True,
BitmapMissingFonts,// BitmapMissingFonts:=True,
useISO190051 // UseISO19005_1:=False
);
end else
Expand Down
7 changes: 5 additions & 2 deletions src/res/HelpLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ Long Parameters:
--XPS-no-IRM
Do not copy IRM permissions to exported XPS document.
--PDF-No-DocStructureTags
Do not include DocStructureTags to help screen readers.
--use-ISO190051 Create PDF to the ISO 19005-1 standard.
Do not include DocStructureTags to help screen readers.
--PDF-no-BitmapMissingFonts
Do not bitmap missing fonts, fonts will be substituted.
--use-ISO190051
Create PDF to the ISO 19005-1 standard.



Expand Down
4 changes: 4 additions & 0 deletions test/test_missingfont.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REM Try optimize options on large file.
"../exe/docto.exe" -f ".\Inputfiles\GEOCADx (1).docx" -o ".\GeneratedFiles\GEOCADx_nobitmaps.pdf" -T wdFormatPDF --PDF-no-BitmapMissingFonts -l 10