Skip to content

Commit

Permalink
For better user convenience, use bundled k2pdfopt
Browse files Browse the repository at this point in the history
  • Loading branch information
aonez committed Nov 27, 2016
1 parent a874465 commit 1de0a39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
13 changes: 13 additions & 0 deletions MacReFlower.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
F4D7C9C91770CBE600C57EC1 /* MRFAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F4D7C9C81770CBE600C57EC1 /* MRFAppDelegate.m */; };
F4D7C9CC1770CBE600C57EC1 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4D7C9CA1770CBE600C57EC1 /* MainMenu.xib */; };
F4D7C9D41770CF2500C57EC1 /* MRFOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F4D7C9D31770CF2500C57EC1 /* MRFOperation.m */; };
F7E62A2C1DEB889E009EB116 /* k2pdfopt in Resources */ = {isa = PBXBuildFile; fileRef = F7E62A2B1DEB889E009EB116 /* k2pdfopt */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -34,6 +35,7 @@
F4D7C9CB1770CBE600C57EC1 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
F4D7C9D21770CF2500C57EC1 /* MRFOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRFOperation.h; sourceTree = "<group>"; };
F4D7C9D31770CF2500C57EC1 /* MRFOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRFOperation.m; sourceTree = "<group>"; };
F7E62A2B1DEB889E009EB116 /* k2pdfopt */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = k2pdfopt; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -88,6 +90,7 @@
F4D7C9BB1770CBE600C57EC1 /* MacReFlower */ = {
isa = PBXGroup;
children = (
F7E62A2B1DEB889E009EB116 /* k2pdfopt */,
F4D7C9C71770CBE600C57EC1 /* MRFAppDelegate.h */,
F4D7C9C81770CBE600C57EC1 /* MRFAppDelegate.m */,
F4D7C9CA1770CBE600C57EC1 /* MainMenu.xib */,
Expand Down Expand Up @@ -139,6 +142,11 @@
CLASSPREFIX = MRF;
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = "Fiore Basile";
TargetAttributes = {
F4D7C9B11770CBE600C57EC1 = {
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = F4D7C9AD1770CBE600C57EC1 /* Build configuration list for PBXProject "MacReFlower" */;
compatibilityVersion = "Xcode 3.2";
Expand All @@ -165,6 +173,7 @@
F4D7C9C01770CBE600C57EC1 /* InfoPlist.strings in Resources */,
F4D7C9C61770CBE600C57EC1 /* Credits.rtf in Resources */,
F4D7C9CC1770CBE600C57EC1 /* MainMenu.xib in Resources */,
F7E62A2C1DEB889E009EB116 /* k2pdfopt in Resources */,
F48BF926177A0A9600F0BDE6 /* icon.iconset in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -274,7 +283,9 @@
F4D7C9D01770CBE600C57EC1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MacReFlower/MacReFlower-Prefix.pch";
INFOPLIST_FILE = "MacReFlower/MacReFlower-Info.plist";
Expand All @@ -286,7 +297,9 @@
F4D7C9D11770CBE600C57EC1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MacReFlower/MacReFlower-Prefix.pch";
INFOPLIST_FILE = "MacReFlower/MacReFlower-Info.plist";
Expand Down
6 changes: 3 additions & 3 deletions MacReFlower/MRFOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ +(NSString*) findScript:(NSString*)scriptName
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/bin/which"];
NSString* path = [[[NSProcessInfo processInfo]environment]objectForKey:@"PATH"];
path = [path stringByAppendingFormat:@":/usr/local/bin"];
[task setEnvironment:[NSDictionary dictionaryWithObject:path forKey:@"PATH"]];

[task setEnvironment:[NSDictionary dictionaryWithObject:[[NSBundle mainBundle] resourcePath] forKey:@"PATH"]];
[task setArguments:[NSArray arrayWithObjects: scriptName, nil]];

NSPipe *pipe, *errorPipe;
pipe = [NSPipe pipe];
errorPipe = [NSPipe pipe];
Expand Down
Binary file added MacReFlower/k2pdfopt
Binary file not shown.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ MacReFlower
This is a little utility app that allows to drop PDF files and get them optimized for viewing on the Kindle Paperwhite, but
might work for other e-Ink devices..

The program uses the [k2pdfopt](http://www.willus.com/k2pdfopt) utility, which you should download and put in your PATH,
i.e. in /usr/local/bin folder.

**Please also make sure that k2pdfopt is executable (i.e. chmod +x k2pdfopt)**

The program uses the [k2pdfopt](http://www.willus.com/k2pdfopt) utility.

Screenshots
===========
Expand Down

0 comments on commit 1de0a39

Please sign in to comment.