Skip to content

Commit 36eb8af

Browse files
author
palamar
committed
Fixed pathes for new builds
1 parent fd5ccaf commit 36eb8af

File tree

8 files changed

+111
-59
lines changed

8 files changed

+111
-59
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,4 @@ $RECYCLE.BIN/
170170
/PDFCoreSDKExamples.x64.7z
171171
/PDFCoreSDKExamples.x86.7z
172172
/cpp/MFCSample/Release.x64
173+
/PDFCoreSDKExamples.AnyCPU

CSharp/CoreAPIDemo/Content.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static public void DrawTextRenderingModesOnPage(Form1 Parent)
222222
IIXC_Inst Ixc_Inst = (IIXC_Inst)Parent.m_pxcInst.GetExtension("IXC");
223223
IAUX_Inst Aux_Inst = Parent.m_pxcInst.GetExtension("AUX");
224224
IMathHelper math = Aux_Inst.MathHelper;
225-
Pat = crtImgPat(System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, Ixc_Inst, math);
225+
Pat = crtImgPat(System.Environment.CurrentDirectory + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, Ixc_Inst, math);
226226
CC.SetPatternRGB(Pat, true, argbDarkLime);
227227
CC.SetCharSpace(2.0);
228228
CC.SetTextScale(150.0);
@@ -1091,7 +1091,7 @@ static public void DrawPatternsOnPage(Form1 Parent)
10911091
}
10921092
IAUX_Inst Aux_Inst = Parent.m_pxcInst.GetExtension("AUX");
10931093
IMathHelper math = Aux_Inst.MathHelper;
1094-
Pat = crtImgPat(System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, Ixc_Inst, math);
1094+
Pat = crtImgPat(System.Environment.CurrentDirectory + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, Ixc_Inst, math);
10951095
CC.SetPatternRGB(Pat, true, argbDarkLime);
10961096
CC.Rect(X[k], Y, X[k] + w, Y + h);
10971097
CC.FillPath(false, true, PXC_FillRule.FillRule_Winding);
@@ -1680,7 +1680,7 @@ static public void AddStrokeTypes(Form1 Parent)
16801680
CC.SetLineWidth(15);
16811681
IAUX_Inst Aux_Inst = Parent.m_pxcInst.GetExtension("AUX");
16821682
IMathHelper math = Aux_Inst.MathHelper;
1683-
IPXC_Pattern Pat = crtImgPat(System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, ixcInst, math);
1683+
IPXC_Pattern Pat = crtImgPat(System.Environment.CurrentDirectory + "\\Images\\CoreAPI_32.ico", Parent.m_CurDoc, ixcInst, math);
16841684
CC.SetPattern(Pat, false);
16851685
CC.Ellipse(rect.left, rect.bottom, rect.right, rect.top);
16861686
CC.StrokePath(true);
@@ -1720,7 +1720,7 @@ static public void PlaceImageWithDifferentTransformations(Form1 Parent)
17201720
IPXC_Page Page = Parent.m_CurDoc.Pages.InsertPage(0, ref rc, out urData);
17211721
IAUX_Inst Aux_Inst = Parent.m_pxcInst.GetExtension("AUX");
17221722
IMathHelper mathHelper = Aux_Inst.MathHelper;
1723-
IPXC_Image Img = Parent.m_CurDoc.AddImageFromFile(System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\Editor_welcome.png");
1723+
IPXC_Image Img = Parent.m_CurDoc.AddImageFromFile(System.Environment.CurrentDirectory + "\\Images\\Editor_welcome.png");
17241724
PXC_Matrix contentMatrix = new PXC_Matrix();
17251725
PXC_Matrix globalMatrix = new PXC_Matrix();
17261726

CSharp/CoreAPIDemo/CoreAPIDemo.csproj

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,28 @@
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<NuGetPackageImportStamp>
1515
</NuGetPackageImportStamp>
16+
<PublishUrl>publish\</PublishUrl>
17+
<Install>true</Install>
18+
<InstallFrom>Disk</InstallFrom>
19+
<UpdateEnabled>false</UpdateEnabled>
20+
<UpdateMode>Foreground</UpdateMode>
21+
<UpdateInterval>7</UpdateInterval>
22+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
23+
<UpdatePeriodically>false</UpdatePeriodically>
24+
<UpdateRequired>false</UpdateRequired>
25+
<MapFileExtensions>true</MapFileExtensions>
26+
<ApplicationRevision>0</ApplicationRevision>
27+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
28+
<IsWebBootstrapper>false</IsWebBootstrapper>
29+
<UseApplicationTrust>false</UseApplicationTrust>
30+
<BootstrapperEnabled>true</BootstrapperEnabled>
1631
</PropertyGroup>
1732
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1833
<PlatformTarget>AnyCPU</PlatformTarget>
1934
<DebugSymbols>true</DebugSymbols>
2035
<DebugType>full</DebugType>
2136
<Optimize>false</Optimize>
22-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
37+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
2338
<DefineConstants>DEBUG;TRACE</DefineConstants>
2439
<ErrorReport>prompt</ErrorReport>
2540
<WarningLevel>4</WarningLevel>
@@ -29,7 +44,7 @@
2944
<PlatformTarget>AnyCPU</PlatformTarget>
3045
<DebugType>pdbonly</DebugType>
3146
<Optimize>true</Optimize>
32-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
47+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
3348
<DefineConstants>TRACE</DefineConstants>
3449
<ErrorReport>prompt</ErrorReport>
3550
<WarningLevel>4</WarningLevel>
@@ -39,7 +54,7 @@
3954
</PropertyGroup>
4055
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
4156
<DebugSymbols>true</DebugSymbols>
42-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
57+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
4358
<DefineConstants>DEBUG;TRACE</DefineConstants>
4459
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4560
<DebugType>full</DebugType>
@@ -49,7 +64,7 @@
4964
<Prefer32Bit>true</Prefer32Bit>
5065
</PropertyGroup>
5166
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
52-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
67+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
5368
<DefineConstants>TRACE</DefineConstants>
5469
<Optimize>true</Optimize>
5570
<DebugType>pdbonly</DebugType>
@@ -60,7 +75,7 @@
6075
</PropertyGroup>
6176
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
6277
<DebugSymbols>true</DebugSymbols>
63-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
78+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\$(Configuration)\</OutputPath>
6479
<DefineConstants>DEBUG;TRACE</DefineConstants>
6580
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6681
<DebugType>full</DebugType>
@@ -70,7 +85,7 @@
7085
<Prefer32Bit>true</Prefer32Bit>
7186
</PropertyGroup>
7287
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
73-
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
88+
<OutputPath>$(SolutionDir)..\..\PDFCoreSDKExamples.$(Platform)\</OutputPath>
7489
<DefineConstants>TRACE</DefineConstants>
7590
<Optimize>true</Optimize>
7691
<DebugType>pdbonly</DebugType>
@@ -127,9 +142,15 @@
127142
<DependentUpon>Resources.resx</DependentUpon>
128143
</Compile>
129144
<None Include="app.manifest" />
130-
<None Include="Documents\FeatureChartEU.pdf" />
131-
<None Include="Documents\MyStamps.pdf" />
132-
<None Include="Documents\PasswordProtected.pdf" />
145+
<Content Include="Documents\FeatureChartEU.pdf">
146+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
147+
</Content>
148+
<Content Include="Documents\MyStamps.pdf">
149+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
150+
</Content>
151+
<Content Include="Documents\PasswordProtected.pdf">
152+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
153+
</Content>
133154
<None Include="packages.config" />
134155
<None Include="Properties\Settings.settings">
135156
<Generator>SettingsSingleFileGenerator</Generator>
@@ -155,18 +176,35 @@
155176
<EmbedInteropTypes>True</EmbedInteropTypes>
156177
</COMReference>
157178
</ItemGroup>
158-
<ItemGroup />
179+
<ItemGroup>
180+
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
181+
<Visible>False</Visible>
182+
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
183+
<Install>true</Install>
184+
</BootstrapperPackage>
185+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
186+
<Visible>False</Visible>
187+
<ProductName>.NET Framework 3.5 SP1</ProductName>
188+
<Install>false</Install>
189+
</BootstrapperPackage>
190+
</ItemGroup>
159191
<ItemGroup>
160192
<Content Include="Images\clearFilters_24.png" />
161193
<Content Include="Images\closeDoc_24.png" />
162194
<Content Include="Images\collapseAll_24.png" />
163-
<Content Include="Images\CoreAPI_32.ico" />
164-
<Content Include="Images\Editor_welcome.png" />
195+
<Content Include="Images\CoreAPI_32.ico">
196+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
197+
</Content>
198+
<Content Include="Images\Editor_welcome.png">
199+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
200+
</Content>
165201
<Content Include="Images\expandAll_24.png" />
166202
<Content Include="Images\folder_24.png">
167203
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
168204
</Content>
169-
<Content Include="Images\gotoSource_24.png" />
205+
<Content Include="Images\gotoSource_24.png">
206+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
207+
</Content>
170208
<Content Include="Images\next_24.png" />
171209
<Content Include="Images\openWith_24.png" />
172210
<Content Include="Images\prev_24.png" />

CSharp/CoreAPIDemo/Document.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ static public void OpenDocWithOpenDialog(Form1 Parent)
4141
[Description("2.3. Open document from string path")]
4242
static public void OpenDocFromStringPath(Form1 Parent)
4343
{
44-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Documents\\FeatureChartEU.pdf";
44+
string sPath = System.Environment.CurrentDirectory + "\\Documents\\FeatureChartEU.pdf";
4545
Parent.CloseDocument();
4646
Parent.m_CurDoc = Parent.m_pxcInst.OpenDocumentFromFile(sPath, null);
4747
}
4848

4949
[Description("2.4. Open document from IStream")]
5050
static public void OpenDocumentFromStream(Form1 Parent)
5151
{
52-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Documents\\FeatureChartEU.pdf";
52+
string sPath = System.Environment.CurrentDirectory + "\\Documents\\FeatureChartEU.pdf";
5353
Parent.CloseDocument();
5454
FileStream srcStream = new FileStream(sPath, FileMode.Open);
5555
if (srcStream != null)
@@ -71,7 +71,7 @@ public void AuthDoc(IPXC_Document pDoc, uint nFlags)
7171
[Description("2.5. Open password protected document from IAFS_Name")]
7272
static public void OpenPasswordProtectedDocument(Form1 Parent)
7373
{
74-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Documents\\PasswordProtected.pdf";
74+
string sPath = System.Environment.CurrentDirectory + "\\Documents\\PasswordProtected.pdf";
7575
IAFS_Inst fsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
7676
IAFS_Name destPath = fsInst.DefaultFileSys.StringToName(sPath); //Converting string to name
7777
Parent.CloseDocument();

CSharp/CoreAPIDemo/Form1.cs

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public partial class Form1 : Form
1717
{
1818
public IPXC_Inst m_pxcInst = null;
1919
public IPXC_Document m_CurDoc = null;
20+
#if DEBUG
21+
public static string m_sDirPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\CSharp\\CoreAPIDemo\\";
22+
#else
23+
public static string m_sDirPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).FullName + "\\CSharp\\CoreAPIDemo\\";
24+
#endif
2025

2126
public Form1()
2227
{
@@ -163,7 +168,7 @@ private MethodInfo GetCurrentMethod(TreeNode curNode)
163168

164169
private int GetMethodLine(string className, string methodName)
165170
{
166-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\" + className + ".cs";
171+
string sPath = m_sDirPath + className + ".cs";
167172
string sData = System.IO.File.ReadAllText(sPath);
168173
int nIndex = sData.IndexOf(methodName);
169174

@@ -173,48 +178,56 @@ private int GetMethodLine(string className, string methodName)
173178

174179
private string GetMethodCode(string className, string methodName)
175180
{
176-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\" + className + ".cs";
177-
string sData = System.IO.File.ReadAllText(sPath);
178-
int nIndex = sData.IndexOf(methodName);
179-
while (nIndex >= 0)
181+
try
180182
{
181-
if (sData[nIndex] == '\n')
183+
string sPath = m_sDirPath + className + ".cs";
184+
string sData = System.IO.File.ReadAllText(sPath);
185+
int nIndex = sData.IndexOf(methodName);
186+
while (nIndex >= 0)
182187
{
183-
nIndex++;
184-
break;
188+
if (sData[nIndex] == '\n')
189+
{
190+
nIndex++;
191+
break;
192+
}
193+
nIndex--;
185194
}
186-
nIndex--;
187-
}
188195

189-
if (nIndex < 0)
190-
return "";
196+
if (nIndex < 0)
197+
return "";
191198

192-
string sWS = "";
193-
for (int i = nIndex; i < sData.Length; i++)
194-
{
195-
if (!Char.IsWhiteSpace(sData[i]))
199+
string sWS = "";
200+
for (int i = nIndex; i < sData.Length; i++)
196201
{
197-
sWS = sData.Substring(nIndex, i - nIndex);
198-
break;
202+
if (!Char.IsWhiteSpace(sData[i]))
203+
{
204+
sWS = sData.Substring(nIndex, i - nIndex);
205+
break;
206+
}
207+
}
208+
int nEnd = sData.IndexOf("\n" + sWS + "}", nIndex);
209+
if (nEnd < 0)
210+
return "";
211+
nEnd += sWS.Length + 2;
212+
string sRes = sData.Substring(nIndex, nEnd - nIndex);
213+
string[] aData = sRes.Split('\n');
214+
sRes = "";
215+
for (int i = 0; i < aData.Length; i++)
216+
{
217+
string sTmp = aData[i];
218+
int nPos = sTmp.IndexOf(sWS);
219+
if (nPos < 0)
220+
sRes += sTmp;
221+
else
222+
sRes += sTmp.Substring(sWS.Length);
199223
}
224+
return sRes;
200225
}
201-
int nEnd = sData.IndexOf("\n" + sWS + "}", nIndex);
202-
if (nEnd < 0)
203-
return "";
204-
nEnd += sWS.Length + 2;
205-
string sRes = sData.Substring(nIndex, nEnd - nIndex);
206-
string[] aData = sRes.Split('\n');
207-
sRes = "";
208-
for (int i = 0; i < aData.Length; i++)
226+
catch (Exception)
209227
{
210-
string sTmp = aData[i];
211-
int nPos = sTmp.IndexOf(sWS);
212-
if (nPos < 0)
213-
sRes += sTmp;
214-
else
215-
sRes += sTmp.Substring(sWS.Length);
228+
216229
}
217-
return sRes;
230+
return "";
218231
}
219232
private void UpdateCodeSample(TreeNode curNode)
220233
{
@@ -463,8 +476,8 @@ private void toolStripButton2_Click(object sender, EventArgs e)
463476
return;
464477

465478
int fileline = GetMethodLine(theMethod.DeclaringType.Name, theMethod.Name);
466-
string filePath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\"
467-
+ theMethod.DeclaringType.Name + ".cs";
479+
480+
string filePath = m_sDirPath + theMethod.DeclaringType.Name + ".cs";
468481

469482
EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE");
470483
dte.MainWindow.Activate();

CSharp/CoreAPIDemo/FormFields.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static public void AddButtonWithIconAndURI(Form1 Parent)
3333
//Now we'll need to add the icon
3434
IPXC_Annotation annot = ff.Widget[0];
3535
IPXC_AnnotData_Widget WData = (IPXC_AnnotData_Widget)annot.Data;
36-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\gotoSource_24.png";
36+
string sPath = System.Environment.CurrentDirectory + "\\Images\\gotoSource_24.png";
3737
IPXC_Image img = Parent.m_CurDoc.AddImageFromFile(sPath);
3838

3939
float imgw = img.Width;

CSharp/CoreAPIDemo/Stamps.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static public void LoadStampsCollectionFromFile(Form1 Parent)
7676

7777
//Loading stamp collection from stamp file
7878
IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
79-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Documents\\MyStamps.pdf";
79+
string sPath = System.Environment.CurrentDirectory + "\\Documents\\MyStamps.pdf";
8080
IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
8181
int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
8282
IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);
@@ -111,7 +111,7 @@ static public void LoadStampFromTheImageFile(Form1 Parent)
111111

112112
//Loading image file
113113
IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
114-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Images\\run_24.png";
114+
string sPath = System.Environment.CurrentDirectory + "\\Images\\run_24.png";
115115
IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
116116
int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
117117
IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);

CSharp/CoreAPIDemo/StartingGuide.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static public void CreateNewDocument(Form1 Parent)
2525
[Description("1.2. Open document from string path")]
2626
static public void OpenDocumentFromStringPath(Form1 Parent)
2727
{
28-
string sPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Documents\\FeatureChartEU.pdf";
28+
string sPath = System.Environment.CurrentDirectory + "\\Documents\\FeatureChartEU.pdf";
2929
Parent.CloseDocument();
3030
Parent.m_CurDoc = Parent.m_pxcInst.OpenDocumentFromFile(sPath, null);
3131
}

0 commit comments

Comments
 (0)