mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-03 21:06:25 +01:00
move upgraded PDF from 1.8
This commit is contained in:
parent
864b69b950
commit
bb044f6f95
@ -136,9 +136,7 @@ POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
if (ENABLE_SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
endif ()
|
||||
|
||||
|
12
PDF/Makefile
12
PDF/Makefile
@ -10,17 +10,17 @@ INCLUDE += -I $(POCO_BASE)/PDF/include/Poco/PDF
|
||||
|
||||
objects = Destination Document Encoder Font Image Outline \
|
||||
LinkAnnotation Page PDFException TextAnnotation \
|
||||
hpdf_annotation hpdf_array hpdf_binary hpdf_boolean \
|
||||
hpdf_3dmeasure hpdf_annotation hpdf_array hpdf_binary hpdf_boolean \
|
||||
hpdf_catalog hpdf_destination hpdf_dict hpdf_doc hpdf_doc_png \
|
||||
hpdf_encoder hpdf_encoder_cns hpdf_encoder_cnt hpdf_encoder_jp \
|
||||
hpdf_encoder_kr hpdf_encrypt hpdf_encryptdict hpdf_error \
|
||||
hpdf_ext_gstate hpdf_font hpdf_font_cid hpdf_font_tt \
|
||||
hpdf_encoder_kr hpdf_encoder_utf hpdf_encrypt hpdf_encryptdict hpdf_error \
|
||||
hpdf_exdata hpdf_ext_gstate hpdf_font hpdf_font_cid hpdf_font_tt \
|
||||
hpdf_font_type1 hpdf_fontdef hpdf_fontdef_base14 hpdf_fontdef_cid \
|
||||
hpdf_fontdef_cns hpdf_fontdef_cnt hpdf_fontdef_jp hpdf_fontdef_kr \
|
||||
hpdf_fontdef_tt hpdf_fontdef_type1 hpdf_gstate hpdf_image \
|
||||
hpdf_image_png hpdf_info hpdf_list hpdf_mmgr hpdf_name hpdf_null \
|
||||
hpdf_fontdef_tt hpdf_fontdef_type1 hpdf_gstate hpdf_image hpdf_image_ccitt \
|
||||
hpdf_image_png hpdf_info hpdf_list hpdf_mmgr hpdf_name hpdf_namedict hpdf_null \
|
||||
hpdf_number hpdf_objects hpdf_outline hpdf_page_label hpdf_page_operator \
|
||||
hpdf_pages hpdf_real hpdf_streams hpdf_string hpdf_utils hpdf_xref \
|
||||
hpdf_pages hpdf_pdfa hpdf_real hpdf_streams hpdf_string hpdf_u3d hpdf_utils hpdf_xref \
|
||||
adler32 compress crc32 deflate gzio \
|
||||
infback inffast inflate inftrees trees zutil \
|
||||
png pngerror pnggccrd pngget pngmem pngpread \
|
||||
|
@ -1,16 +0,0 @@
|
||||
vc.project.guid = E12E5C71-79A4-495A-848F-F1710111E610
|
||||
vc.project.name = PDF
|
||||
vc.project.target = Poco${vc.project.name}
|
||||
vc.project.type = library
|
||||
vc.project.pocobase = ..
|
||||
vc.project.outdir = ${vc.project.pocobase}
|
||||
vc.project.platforms = Win32, x64
|
||||
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
|
||||
vc.project.prototype = ${vc.project.name}_vs90.vcproj
|
||||
vc.project.compiler.include = .\\include\\Poco\\PDF;..\\Foundation\\include
|
||||
vc.project.compiler.defines =
|
||||
vc.project.compiler.defines.shared = _CRT_SECURE_NO_WARNINGS;${vc.project.name}_EXPORTS
|
||||
vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared}
|
||||
vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared}
|
||||
vc.solution.create = true
|
||||
vc.solution.include = testsuite\\TestSuite
|
@ -85,7 +85,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros"/>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
|
||||
<_ProjectFileVersion>14.0.25123.0</_ProjectFileVersion>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">PocoPDFd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">PocoPDFmdd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">PocoPDFmtd</TargetName>
|
||||
@ -285,6 +285,7 @@
|
||||
<ClCompile Include="src\Encoder.cpp"/>
|
||||
<ClCompile Include="src\Font.cpp"/>
|
||||
<ClCompile Include="src\gzio.c"/>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c"/>
|
||||
<ClCompile Include="src\hpdf_annotation.c"/>
|
||||
<ClCompile Include="src\hpdf_array.c"/>
|
||||
<ClCompile Include="src\hpdf_binary.c"/>
|
||||
@ -299,9 +300,11 @@
|
||||
<ClCompile Include="src\hpdf_encoder_cnt.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_jp.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c"/>
|
||||
<ClCompile Include="src\hpdf_encrypt.c"/>
|
||||
<ClCompile Include="src\hpdf_encryptdict.c"/>
|
||||
<ClCompile Include="src\hpdf_error.c"/>
|
||||
<ClCompile Include="src\hpdf_exdata.c"/>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_font.c"/>
|
||||
<ClCompile Include="src\hpdf_fontdef.c"/>
|
||||
@ -318,11 +321,13 @@
|
||||
<ClCompile Include="src\hpdf_font_type1.c"/>
|
||||
<ClCompile Include="src\hpdf_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_image.c"/>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c"/>
|
||||
<ClCompile Include="src\hpdf_image_png.c"/>
|
||||
<ClCompile Include="src\hpdf_info.c"/>
|
||||
<ClCompile Include="src\hpdf_list.c"/>
|
||||
<ClCompile Include="src\hpdf_mmgr.c"/>
|
||||
<ClCompile Include="src\hpdf_name.c"/>
|
||||
<ClCompile Include="src\hpdf_namedict.c"/>
|
||||
<ClCompile Include="src\hpdf_null.c"/>
|
||||
<ClCompile Include="src\hpdf_number.c"/>
|
||||
<ClCompile Include="src\hpdf_objects.c"/>
|
||||
@ -330,9 +335,11 @@
|
||||
<ClCompile Include="src\hpdf_pages.c"/>
|
||||
<ClCompile Include="src\hpdf_page_label.c"/>
|
||||
<ClCompile Include="src\hpdf_page_operator.c"/>
|
||||
<ClCompile Include="src\hpdf_pdfa.c"/>
|
||||
<ClCompile Include="src\hpdf_real.c"/>
|
||||
<ClCompile Include="src\hpdf_streams.c"/>
|
||||
<ClCompile Include="src\hpdf_string.c"/>
|
||||
<ClCompile Include="src\hpdf_u3d.c"/>
|
||||
<ClCompile Include="src\hpdf_utils.c"/>
|
||||
<ClCompile Include="src\hpdf_xref.c"/>
|
||||
<ClCompile Include="src\Image.cpp"/>
|
||||
@ -374,6 +381,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\Encoder.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_catalog.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_conf.h"/>
|
||||
@ -384,6 +392,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encrypt.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encryptdict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_fontdef.h"/>
|
||||
@ -392,13 +401,17 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_info.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_list.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_outline.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_page_label.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Image.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffast.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffixed.h"/>
|
||||
|
@ -2,40 +2,40 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{552b2e5f-04fb-49a7-9baa-fc20dec46757}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a0634ffa-18a6-4b8a-8d5e-5cd8ce33b3b9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{fbdf7c26-cd16-4fb5-8263-3c8c8937cb6e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{dae3dec4-c110-4a31-abfe-7b05f6994293}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party">
|
||||
<UniqueIdentifier>{a1e7aa4e-57ce-46a0-a4ee-9347a029644e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{fc45a0d4-71df-43a3-ae23-fc8b286967d1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG">
|
||||
<UniqueIdentifier>{c8a86f54-496a-4723-9752-b3e396279c25}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a2b94263-66a3-49b7-a2fe-628dcb08086f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Header Files">
|
||||
<UniqueIdentifier>{2178eb18-6fec-48fd-be75-fb129252b779}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{1cf26a6b-6de8-4233-ba72-b8e675ef99ff}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Source Files">
|
||||
<UniqueIdentifier>{680b8a32-17ff-4995-8249-29b8ce94495c}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{9af04267-b18c-467d-94a7-62e8304a81d5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib">
|
||||
<UniqueIdentifier>{167c8e35-db84-4fa9-b4d5-c86c44e73328}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{5b4bc72c-9f7c-4eb9-bdda-158488b0cb55}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Header Files">
|
||||
<UniqueIdentifier>{9223eee0-9b19-4491-a792-8eec0aa1e3f8}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{feeea5e8-7e0c-4c7c-a79d-2cf804cc1378}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Source Files">
|
||||
<UniqueIdentifier>{25c72362-48e2-42c2-ad81-a40c21d29019}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{43e6cf89-8985-4fb4-82c7-43631868160c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU">
|
||||
<UniqueIdentifier>{18792256-b2da-4e92-af96-372efd5b5af0}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{88ecf0b8-8a16-42c6-ae45-9360156c820f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Source Files">
|
||||
<UniqueIdentifier>{df66f277-6850-453f-833a-c70d9d8163b2}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{8aa5e5a1-2d95-4cf3-af8e-05c1f7186560}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Header Files">
|
||||
<UniqueIdentifier>{834e052d-ee19-4d73-a11d-9a895a46e672}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{eb00e13a-2cc3-48f1-8c6f-9aef394cea8e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -156,6 +156,9 @@
|
||||
<ClCompile Include="src\zutil.c">
|
||||
<Filter>3rd Party\zlib\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_annotation.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -198,6 +201,9 @@
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encrypt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -207,6 +213,9 @@
|
||||
<ClCompile Include="src\hpdf_error.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_exdata.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -255,6 +264,9 @@
|
||||
<ClCompile Include="src\hpdf_image.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_png.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -270,6 +282,9 @@
|
||||
<ClCompile Include="src\hpdf_name.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_namedict.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_null.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -291,6 +306,9 @@
|
||||
<ClCompile Include="src\hpdf_pages.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_pdfa.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_real.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -300,6 +318,9 @@
|
||||
<ClCompile Include="src\hpdf_string.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_u3d.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_utils.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -383,6 +404,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -413,6 +437,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -437,6 +464,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -449,14 +479,23 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -85,7 +85,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros"/>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
|
||||
<_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">PocoPDFd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">PocoPDFmdd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">PocoPDFmtd</TargetName>
|
||||
@ -285,6 +285,7 @@
|
||||
<ClCompile Include="src\Encoder.cpp"/>
|
||||
<ClCompile Include="src\Font.cpp"/>
|
||||
<ClCompile Include="src\gzio.c"/>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c"/>
|
||||
<ClCompile Include="src\hpdf_annotation.c"/>
|
||||
<ClCompile Include="src\hpdf_array.c"/>
|
||||
<ClCompile Include="src\hpdf_binary.c"/>
|
||||
@ -299,9 +300,11 @@
|
||||
<ClCompile Include="src\hpdf_encoder_cnt.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_jp.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c"/>
|
||||
<ClCompile Include="src\hpdf_encrypt.c"/>
|
||||
<ClCompile Include="src\hpdf_encryptdict.c"/>
|
||||
<ClCompile Include="src\hpdf_error.c"/>
|
||||
<ClCompile Include="src\hpdf_exdata.c"/>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_font.c"/>
|
||||
<ClCompile Include="src\hpdf_fontdef.c"/>
|
||||
@ -318,11 +321,13 @@
|
||||
<ClCompile Include="src\hpdf_font_type1.c"/>
|
||||
<ClCompile Include="src\hpdf_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_image.c"/>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c"/>
|
||||
<ClCompile Include="src\hpdf_image_png.c"/>
|
||||
<ClCompile Include="src\hpdf_info.c"/>
|
||||
<ClCompile Include="src\hpdf_list.c"/>
|
||||
<ClCompile Include="src\hpdf_mmgr.c"/>
|
||||
<ClCompile Include="src\hpdf_name.c"/>
|
||||
<ClCompile Include="src\hpdf_namedict.c"/>
|
||||
<ClCompile Include="src\hpdf_null.c"/>
|
||||
<ClCompile Include="src\hpdf_number.c"/>
|
||||
<ClCompile Include="src\hpdf_objects.c"/>
|
||||
@ -330,9 +335,11 @@
|
||||
<ClCompile Include="src\hpdf_pages.c"/>
|
||||
<ClCompile Include="src\hpdf_page_label.c"/>
|
||||
<ClCompile Include="src\hpdf_page_operator.c"/>
|
||||
<ClCompile Include="src\hpdf_pdfa.c"/>
|
||||
<ClCompile Include="src\hpdf_real.c"/>
|
||||
<ClCompile Include="src\hpdf_streams.c"/>
|
||||
<ClCompile Include="src\hpdf_string.c"/>
|
||||
<ClCompile Include="src\hpdf_u3d.c"/>
|
||||
<ClCompile Include="src\hpdf_utils.c"/>
|
||||
<ClCompile Include="src\hpdf_xref.c"/>
|
||||
<ClCompile Include="src\Image.cpp"/>
|
||||
@ -374,6 +381,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\Encoder.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_catalog.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_conf.h"/>
|
||||
@ -384,6 +392,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encrypt.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encryptdict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_fontdef.h"/>
|
||||
@ -392,13 +401,17 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_info.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_list.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_outline.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_page_label.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Image.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffast.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffixed.h"/>
|
||||
|
@ -2,40 +2,40 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{552b2e5f-04fb-49a7-9baa-fc20dec46757}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{b68a3217-8ff9-46ca-a852-8b1e07294baa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{fbdf7c26-cd16-4fb5-8263-3c8c8937cb6e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{e6d1bded-3e36-4697-9415-08ab4087e8d1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party">
|
||||
<UniqueIdentifier>{a1e7aa4e-57ce-46a0-a4ee-9347a029644e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{7e9ec59d-5949-40da-a626-eb61afb42605}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG">
|
||||
<UniqueIdentifier>{c8a86f54-496a-4723-9752-b3e396279c25}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{c182269e-b546-45bc-b7bb-9d0b14ce8e9c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Header Files">
|
||||
<UniqueIdentifier>{2178eb18-6fec-48fd-be75-fb129252b779}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{42b61af5-6dee-4824-969f-27d4e331fe01}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Source Files">
|
||||
<UniqueIdentifier>{680b8a32-17ff-4995-8249-29b8ce94495c}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{b1d7126a-3efe-49b7-8651-b7c4d821982d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib">
|
||||
<UniqueIdentifier>{167c8e35-db84-4fa9-b4d5-c86c44e73328}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{64d9fbb5-225f-4ce4-b74e-9893ad90a3e8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Header Files">
|
||||
<UniqueIdentifier>{9223eee0-9b19-4491-a792-8eec0aa1e3f8}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{6bdc4af3-ac04-48be-8376-190eaeb3a58a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Source Files">
|
||||
<UniqueIdentifier>{25c72362-48e2-42c2-ad81-a40c21d29019}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{fa7dd6a4-5f9f-4ddf-99a7-66e71be030a3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU">
|
||||
<UniqueIdentifier>{18792256-b2da-4e92-af96-372efd5b5af0}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{83f468fb-aaff-4e4c-bbe7-29a342e3d43c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Source Files">
|
||||
<UniqueIdentifier>{df66f277-6850-453f-833a-c70d9d8163b2}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{72418292-af6e-457e-9554-e51c88511e83}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Header Files">
|
||||
<UniqueIdentifier>{834e052d-ee19-4d73-a11d-9a895a46e672}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{2d406545-c655-475f-9063-512d54f2ebf9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -156,6 +156,9 @@
|
||||
<ClCompile Include="src\zutil.c">
|
||||
<Filter>3rd Party\zlib\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_annotation.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -198,6 +201,9 @@
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encrypt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -207,6 +213,9 @@
|
||||
<ClCompile Include="src\hpdf_error.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_exdata.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -255,6 +264,9 @@
|
||||
<ClCompile Include="src\hpdf_image.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_png.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -270,6 +282,9 @@
|
||||
<ClCompile Include="src\hpdf_name.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_namedict.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_null.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -291,6 +306,9 @@
|
||||
<ClCompile Include="src\hpdf_pages.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_pdfa.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_real.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -300,6 +318,9 @@
|
||||
<ClCompile Include="src\hpdf_string.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_u3d.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_utils.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -383,6 +404,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -413,6 +437,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -437,6 +464,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -449,14 +479,23 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -85,7 +85,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros"/>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
|
||||
<_ProjectFileVersion>14.0.25123.0</_ProjectFileVersion>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">PocoPDF64d</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">PocoPDFmdd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">PocoPDFmtd</TargetName>
|
||||
@ -284,6 +284,7 @@
|
||||
<ClCompile Include="src\Encoder.cpp"/>
|
||||
<ClCompile Include="src\Font.cpp"/>
|
||||
<ClCompile Include="src\gzio.c"/>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c"/>
|
||||
<ClCompile Include="src\hpdf_annotation.c"/>
|
||||
<ClCompile Include="src\hpdf_array.c"/>
|
||||
<ClCompile Include="src\hpdf_binary.c"/>
|
||||
@ -298,9 +299,11 @@
|
||||
<ClCompile Include="src\hpdf_encoder_cnt.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_jp.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c"/>
|
||||
<ClCompile Include="src\hpdf_encrypt.c"/>
|
||||
<ClCompile Include="src\hpdf_encryptdict.c"/>
|
||||
<ClCompile Include="src\hpdf_error.c"/>
|
||||
<ClCompile Include="src\hpdf_exdata.c"/>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_font.c"/>
|
||||
<ClCompile Include="src\hpdf_fontdef.c"/>
|
||||
@ -317,11 +320,13 @@
|
||||
<ClCompile Include="src\hpdf_font_type1.c"/>
|
||||
<ClCompile Include="src\hpdf_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_image.c"/>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c"/>
|
||||
<ClCompile Include="src\hpdf_image_png.c"/>
|
||||
<ClCompile Include="src\hpdf_info.c"/>
|
||||
<ClCompile Include="src\hpdf_list.c"/>
|
||||
<ClCompile Include="src\hpdf_mmgr.c"/>
|
||||
<ClCompile Include="src\hpdf_name.c"/>
|
||||
<ClCompile Include="src\hpdf_namedict.c"/>
|
||||
<ClCompile Include="src\hpdf_null.c"/>
|
||||
<ClCompile Include="src\hpdf_number.c"/>
|
||||
<ClCompile Include="src\hpdf_objects.c"/>
|
||||
@ -329,9 +334,11 @@
|
||||
<ClCompile Include="src\hpdf_pages.c"/>
|
||||
<ClCompile Include="src\hpdf_page_label.c"/>
|
||||
<ClCompile Include="src\hpdf_page_operator.c"/>
|
||||
<ClCompile Include="src\hpdf_pdfa.c"/>
|
||||
<ClCompile Include="src\hpdf_real.c"/>
|
||||
<ClCompile Include="src\hpdf_streams.c"/>
|
||||
<ClCompile Include="src\hpdf_string.c"/>
|
||||
<ClCompile Include="src\hpdf_u3d.c"/>
|
||||
<ClCompile Include="src\hpdf_utils.c"/>
|
||||
<ClCompile Include="src\hpdf_xref.c"/>
|
||||
<ClCompile Include="src\Image.cpp"/>
|
||||
@ -373,6 +380,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\Encoder.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_catalog.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_conf.h"/>
|
||||
@ -383,6 +391,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encrypt.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encryptdict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_fontdef.h"/>
|
||||
@ -391,13 +400,17 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_info.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_list.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_outline.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_page_label.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Image.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffast.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffixed.h"/>
|
||||
|
@ -2,40 +2,40 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9b9727fd-a481-4c26-b106-71b32d6581c9}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{663ad107-137d-4e9a-93c4-ed94a22a8f17}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{8e4910d6-6b5e-467d-a958-facb4307f176}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{d4c6356e-4a4c-4c45-a6bc-7ccd406ae1ec}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party">
|
||||
<UniqueIdentifier>{773a9037-c0f0-4c82-878e-7b917ccd4702}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{e4d66d23-45e3-427d-9c70-8282ba04665b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG">
|
||||
<UniqueIdentifier>{14ba9203-6ef5-4b1e-ba46-fd3c2d0774f9}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{60a90041-e161-42f0-9a77-e9d89c12433e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Header Files">
|
||||
<UniqueIdentifier>{508fe1e7-e52c-4c17-aec8-47be2e5ee440}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{6c42c33a-60f7-4c5c-b2af-55b120a6f4b0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Source Files">
|
||||
<UniqueIdentifier>{ed67d70f-0df4-4ae3-bf37-22427e92610d}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0cfb430f-7053-4c6e-84fe-d0aed378c2c6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib">
|
||||
<UniqueIdentifier>{b3b98a78-bd86-43aa-a584-40985c225bef}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{b740ca59-9742-4a13-9f02-d4e547c2a358}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Header Files">
|
||||
<UniqueIdentifier>{3937fed9-a1bf-490f-8431-c874e977d843}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{9c88a241-c59c-4b5d-bc0a-b808fa732c60}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Source Files">
|
||||
<UniqueIdentifier>{b1a48f23-1603-4c99-8f0c-dd02ca41808c}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{419ca7b8-c305-4951-a78d-cbceed8a9d4d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU">
|
||||
<UniqueIdentifier>{da93ca46-eede-4412-94e0-55406bd16454}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{473ad912-8d9d-482d-bd17-f5323b1211b4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Source Files">
|
||||
<UniqueIdentifier>{cb425dfd-52a1-4a94-90b2-f4eb26046d27}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{d6a021c3-53f4-4e0d-a471-9724e44eacef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Header Files">
|
||||
<UniqueIdentifier>{25dc74ff-9a19-46ba-931f-8e700ef382ca}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a085d8cd-ef46-4637-9250-40524294edb9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -156,6 +156,9 @@
|
||||
<ClCompile Include="src\zutil.c">
|
||||
<Filter>3rd Party\zlib\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_annotation.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -198,6 +201,9 @@
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encrypt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -207,6 +213,9 @@
|
||||
<ClCompile Include="src\hpdf_error.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_exdata.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -255,6 +264,9 @@
|
||||
<ClCompile Include="src\hpdf_image.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_png.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -270,6 +282,9 @@
|
||||
<ClCompile Include="src\hpdf_name.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_namedict.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_null.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -291,6 +306,9 @@
|
||||
<ClCompile Include="src\hpdf_pages.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_pdfa.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_real.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -300,6 +318,9 @@
|
||||
<ClCompile Include="src\hpdf_string.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_u3d.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_utils.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -383,6 +404,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -413,6 +437,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -437,6 +464,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -449,14 +479,23 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -85,7 +85,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros"/>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
|
||||
<_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">PocoPDF64d</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">PocoPDFmdd</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">PocoPDFmtd</TargetName>
|
||||
@ -284,6 +284,7 @@
|
||||
<ClCompile Include="src\Encoder.cpp"/>
|
||||
<ClCompile Include="src\Font.cpp"/>
|
||||
<ClCompile Include="src\gzio.c"/>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c"/>
|
||||
<ClCompile Include="src\hpdf_annotation.c"/>
|
||||
<ClCompile Include="src\hpdf_array.c"/>
|
||||
<ClCompile Include="src\hpdf_binary.c"/>
|
||||
@ -298,9 +299,11 @@
|
||||
<ClCompile Include="src\hpdf_encoder_cnt.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_jp.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c"/>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c"/>
|
||||
<ClCompile Include="src\hpdf_encrypt.c"/>
|
||||
<ClCompile Include="src\hpdf_encryptdict.c"/>
|
||||
<ClCompile Include="src\hpdf_error.c"/>
|
||||
<ClCompile Include="src\hpdf_exdata.c"/>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_font.c"/>
|
||||
<ClCompile Include="src\hpdf_fontdef.c"/>
|
||||
@ -317,11 +320,13 @@
|
||||
<ClCompile Include="src\hpdf_font_type1.c"/>
|
||||
<ClCompile Include="src\hpdf_gstate.c"/>
|
||||
<ClCompile Include="src\hpdf_image.c"/>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c"/>
|
||||
<ClCompile Include="src\hpdf_image_png.c"/>
|
||||
<ClCompile Include="src\hpdf_info.c"/>
|
||||
<ClCompile Include="src\hpdf_list.c"/>
|
||||
<ClCompile Include="src\hpdf_mmgr.c"/>
|
||||
<ClCompile Include="src\hpdf_name.c"/>
|
||||
<ClCompile Include="src\hpdf_namedict.c"/>
|
||||
<ClCompile Include="src\hpdf_null.c"/>
|
||||
<ClCompile Include="src\hpdf_number.c"/>
|
||||
<ClCompile Include="src\hpdf_objects.c"/>
|
||||
@ -329,9 +334,11 @@
|
||||
<ClCompile Include="src\hpdf_pages.c"/>
|
||||
<ClCompile Include="src\hpdf_page_label.c"/>
|
||||
<ClCompile Include="src\hpdf_page_operator.c"/>
|
||||
<ClCompile Include="src\hpdf_pdfa.c"/>
|
||||
<ClCompile Include="src\hpdf_real.c"/>
|
||||
<ClCompile Include="src\hpdf_streams.c"/>
|
||||
<ClCompile Include="src\hpdf_string.c"/>
|
||||
<ClCompile Include="src\hpdf_u3d.c"/>
|
||||
<ClCompile Include="src\hpdf_utils.c"/>
|
||||
<ClCompile Include="src\hpdf_xref.c"/>
|
||||
<ClCompile Include="src\Image.cpp"/>
|
||||
@ -373,6 +380,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\Encoder.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_catalog.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_conf.h"/>
|
||||
@ -383,6 +391,7 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encrypt.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_encryptdict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_font.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_fontdef.h"/>
|
||||
@ -391,13 +400,17 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_info.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_list.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_outline.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_page_label.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\Image.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffast.h"/>
|
||||
<ClInclude Include="include\Poco\PDF\inffixed.h"/>
|
||||
|
@ -2,40 +2,40 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9b9727fd-a481-4c26-b106-71b32d6581c9}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{158681b8-3d0f-48d4-9e20-022f918cb49f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{8e4910d6-6b5e-467d-a958-facb4307f176}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{788a6650-ce51-4888-8a04-d4109b42f1ef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party">
|
||||
<UniqueIdentifier>{773a9037-c0f0-4c82-878e-7b917ccd4702}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0b0476a8-8ff4-4cba-9507-f488c8b436e0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG">
|
||||
<UniqueIdentifier>{14ba9203-6ef5-4b1e-ba46-fd3c2d0774f9}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{bab965de-6f10-457a-b9ec-1f2384a49c01}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Header Files">
|
||||
<UniqueIdentifier>{508fe1e7-e52c-4c17-aec8-47be2e5ee440}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{7507cc7b-ab50-4e91-bb88-99ae6c8cf6f9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\PNG\Source Files">
|
||||
<UniqueIdentifier>{ed67d70f-0df4-4ae3-bf37-22427e92610d}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{47d12286-96c7-4925-8629-07ba46a79210}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib">
|
||||
<UniqueIdentifier>{b3b98a78-bd86-43aa-a584-40985c225bef}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{f5f3d108-67e3-4327-b79c-3ccc2eb32c41}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Header Files">
|
||||
<UniqueIdentifier>{3937fed9-a1bf-490f-8431-c874e977d843}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{b0f93f9e-d388-4405-b70b-8ad39e0e2e53}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\zlib\Source Files">
|
||||
<UniqueIdentifier>{b1a48f23-1603-4c99-8f0c-dd02ca41808c}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{e31c78a9-a0d0-4e51-877c-851f1ecca957}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU">
|
||||
<UniqueIdentifier>{da93ca46-eede-4412-94e0-55406bd16454}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{c154e88e-4512-49c2-81e7-fc920914df61}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Source Files">
|
||||
<UniqueIdentifier>{cb425dfd-52a1-4a94-90b2-f4eb26046d27}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{8f761097-8d0a-4f44-a339-0e2db5234cbf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="3rd Party\HARU\Header Files">
|
||||
<UniqueIdentifier>{25dc74ff-9a19-46ba-931f-8e700ef382ca}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{81381f47-d176-4840-8203-a5275893306a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -156,6 +156,9 @@
|
||||
<ClCompile Include="src\zutil.c">
|
||||
<Filter>3rd Party\zlib\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_3dmeasure.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_annotation.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -198,6 +201,9 @@
|
||||
<ClCompile Include="src\hpdf_encoder_kr.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encoder_utf.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_encrypt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -207,6 +213,9 @@
|
||||
<ClCompile Include="src\hpdf_error.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_exdata.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_ext_gstate.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -255,6 +264,9 @@
|
||||
<ClCompile Include="src\hpdf_image.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_ccitt.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_image_png.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -270,6 +282,9 @@
|
||||
<ClCompile Include="src\hpdf_name.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_namedict.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_null.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -291,6 +306,9 @@
|
||||
<ClCompile Include="src\hpdf_pages.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_pdfa.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_real.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -300,6 +318,9 @@
|
||||
<ClCompile Include="src\hpdf_string.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_u3d.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\hpdf_utils.c">
|
||||
<Filter>3rd Party\HARU\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -383,6 +404,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_3dmeasure.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_annotation.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -413,6 +437,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_error.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_exdata.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_ext_gstate.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -437,6 +464,9 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_mmgr.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_namedict.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_objects.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -449,14 +479,23 @@
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pages.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_pdfa.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_streams.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_types.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_u3d.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_utils.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\PDF\hpdf_version.h">
|
||||
<Filter>3rd Party\HARU\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
39
PDF/build.gradle
Normal file
39
PDF/build.gradle
Normal file
@ -0,0 +1,39 @@
|
||||
project(":PDF") {
|
||||
model {
|
||||
components {
|
||||
PDF(NativeLibrarySpec) {
|
||||
sources {
|
||||
c {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.c'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'include', 'include/Poco/PDF'
|
||||
}
|
||||
}
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'include', 'include/Poco/PDF'
|
||||
}
|
||||
lib project: ':Util', library: 'Util'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "PDF_EXPORTS"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
/// Sets the position and zoom for destination.
|
||||
|
||||
void fit();
|
||||
/// Sets the appearance of the page to displaying entire page within the window.
|
||||
/// Sets the appearance of the page to displaying entire page within the window.
|
||||
|
||||
void fitHorizontal(float top);
|
||||
/// Defines the appearance of a page to magnifying to fit the height of the
|
||||
@ -58,7 +58,7 @@ public:
|
||||
|
||||
void fitWindow();
|
||||
/// Sets the appearance of the page to magnifying to fit the bounding box of
|
||||
/// the page within the window.
|
||||
/// the page within the window.
|
||||
|
||||
void fitWindowHorizontal(float top);
|
||||
/// Defines the appearance of a page to magnifying to fit the width of the
|
||||
|
@ -74,26 +74,26 @@ public:
|
||||
|
||||
enum PageLayout
|
||||
{
|
||||
PAGE_LAYOUT_SINGLE = HPDF_PAGE_LAYOUT_SINGLE,
|
||||
PAGE_LAYOUT_SINGLE = HPDF_PAGE_LAYOUT_SINGLE,
|
||||
/// Only one page is displayed.
|
||||
PAGE_LAYOUT_ONE_COLUMN = HPDF_PAGE_LAYOUT_ONE_COLUMN,
|
||||
/// Display the pages in one column.
|
||||
PAGE_LAYOUT_TWO_COLUMN_LEFT = HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT,
|
||||
/// Display the pages in two column. The page of the odd number is displayed left.
|
||||
/// Display the pages in two column. The page of the odd number is displayed left.
|
||||
PAGE_LAYOUT_TWO_COLUMN_RIGHT = HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT
|
||||
/// Display the pages in two column. The page of the odd number is displayed right.
|
||||
/// Display the pages in two column. The page of the odd number is displayed right.
|
||||
};
|
||||
|
||||
enum PageMode
|
||||
{
|
||||
PAGE_MODE_USE_NONE = HPDF_PAGE_MODE_USE_NONE,
|
||||
/// Display the document with neither outline nor thumbnail.
|
||||
PAGE_MODE_USE_NONE = HPDF_PAGE_MODE_USE_NONE,
|
||||
/// Display the document with neither outline nor thumbnail.
|
||||
PAGE_MODE_USE_OUTLINE = HPDF_PAGE_MODE_USE_OUTLINE,
|
||||
/// Display the document with outline pain.
|
||||
PAGE_MODE_USE_THUMBS = HPDF_PAGE_MODE_USE_THUMBS,
|
||||
///Display the document with thumbnail pain.
|
||||
PAGE_MODE_FULL_SCREEN = HPDF_PAGE_MODE_FULL_SCREEN
|
||||
/// Display the document with full screen mode.
|
||||
/// Display the document with full screen mode.
|
||||
};
|
||||
|
||||
enum Compression
|
||||
@ -101,13 +101,13 @@ public:
|
||||
COMPRESSION_NONE = HPDF_COMP_NONE,
|
||||
/// All contents are not compressed.
|
||||
COMPRESSION_TEXT = HPDF_COMP_TEXT,
|
||||
/// Compress the contents stream of the page.
|
||||
/// Compress the contents stream of the page.
|
||||
COMPRESSION_IMAGE = HPDF_COMP_IMAGE,
|
||||
/// Compress the streams of the image objects.
|
||||
/// Compress the streams of the image objects.
|
||||
COMPRESSION_METADATA = HPDF_COMP_METADATA,
|
||||
/// Other stream datas (fonts, cmaps and so on) are compressed.
|
||||
COMPRESSION_ALL = HPDF_COMP_ALL
|
||||
/// All stream datas are compressed.
|
||||
/// All stream datas are compressed.
|
||||
/// (Same as HPDF_COMP_TEXT | HPDF_COMP_IMAGE | HPDF_COMP_METADATA)
|
||||
};
|
||||
|
||||
@ -118,7 +118,7 @@ public:
|
||||
/// The length of key is automatically set to 5(40bit).
|
||||
ENCRYPT_R3 = HPDF_ENCRYPT_R3
|
||||
/// Use "Revision 3" algorithm.
|
||||
/// Between 5(40bit) and 16(128bit) can be specified for length of the key.
|
||||
/// Between 5(40bit) and 16(128bit) can be specified for length of the key.
|
||||
};
|
||||
|
||||
enum PageNumberStyle
|
||||
@ -167,11 +167,11 @@ public:
|
||||
/// the sz argument.
|
||||
|
||||
SizeType size();
|
||||
/// Resets the document stream, reads the document into the stream and
|
||||
/// Resets the document stream, reads the document into the stream and
|
||||
/// returns the document data size.
|
||||
|
||||
void setPages(std::size_t pagePerPages);
|
||||
/// Sets the number of pages per page.
|
||||
/// Sets the number of pages per page.
|
||||
/// See HARU library HPDF_SetPagesConfiguration API call
|
||||
/// documentation for detailed explanation.
|
||||
|
||||
@ -218,9 +218,9 @@ public:
|
||||
std::string loadType1Font(const std::string& afmFileName, const std::string& pfmFileName);
|
||||
/// Loads type 1 font from file. Returns font name.
|
||||
|
||||
std::string loadTTFont(const std::string& fileName, bool embedding, int index = -1);
|
||||
/// Loads type 1 font from file. Returns font name.
|
||||
/// If the embedding parameter is true, the glyph data of the font is embedded,
|
||||
std::string loadTTFont(const std::string& fileName, bool embed, int index = -1);
|
||||
/// Loads true type font from file. Returns font name.
|
||||
/// If the embed parameter is true, the glyph data of the font is embedded,
|
||||
/// otherwise only the matrix data is included in PDF file.
|
||||
|
||||
const Image& loadPNGImage(const std::string& fileName);
|
||||
@ -228,9 +228,9 @@ public:
|
||||
|
||||
const Image& loadPNGImageInfo(const std::string& fileName);
|
||||
/// Loads the specified PNG image information from the file and returns reference to it.
|
||||
/// Unlike loadPNGImage, this function does not load the whole data immediately.
|
||||
/// Only size and color properties are loaded. The image data is loaded just before the
|
||||
/// image object is written to PDF, and the loaded data is deleted immediately.
|
||||
/// Unlike loadPNGImage, this function does not load the whole data immediately.
|
||||
/// Only size and color properties are loaded. The image data is loaded just before the
|
||||
/// image object is written to PDF, and the loaded data is deleted immediately.
|
||||
|
||||
const Image& loadJPEGImage(const std::string& fileName);
|
||||
/// Loads the specified PNG image from the file and returns reference to it.
|
||||
@ -253,6 +253,9 @@ public:
|
||||
void addPageLabel(int pageNum, PageNumberStyle style, int firstPage, const std::string& prefix = "");
|
||||
/// adds page labeling range for the document.
|
||||
|
||||
void useUTF8Encoding();
|
||||
/// Enables use of UTF-8 encoding (default enabled).
|
||||
|
||||
void useJapaneseFonts();
|
||||
/// Enables use of Japanese fonts.
|
||||
|
||||
@ -281,7 +284,7 @@ public:
|
||||
/// Creates extended graphic state object.
|
||||
/// Bumps up the version of PDF to 1.4.
|
||||
/// NOTE:
|
||||
/// In Acrobat Reader 5.0, when ExtGState object is used combined with HPDF_Page_Concat(),
|
||||
/// In Acrobat Reader 5.0, when ExtGState object is used combined with HPDF_Page_Concat(),
|
||||
/// there is a case that cannot be correctly displayed.
|
||||
|
||||
const Outline& createOutline(const std::string& title, const Outline& outline, const Encoder& encoder);
|
||||
@ -289,9 +292,9 @@ public:
|
||||
|
||||
void setInfo(Info info, const std::string& value);
|
||||
/// Sets the document info.
|
||||
|
||||
|
||||
void setInfo(Info info, const LocalDateTime& dt);
|
||||
/// Sets the document creation or modification date.
|
||||
/// Sets the document creation or moidification date.
|
||||
|
||||
std::string getInfo(Info info);
|
||||
/// Returns the document info.
|
||||
@ -304,7 +307,13 @@ public:
|
||||
|
||||
std::size_t pageCount() const;
|
||||
/// Returns number of pages in the document.
|
||||
|
||||
private:
|
||||
HPDF_Doc& handle();
|
||||
|
||||
void init(Poco::UInt32 pageCount,
|
||||
Page::Size pageSize, Page::Orientation orientation);
|
||||
|
||||
void reset(bool all = false);
|
||||
/// Resets the current document. If all is true, the loaded
|
||||
/// resources (e.g. fonts, encodings ...)are unloaded. Otherwise
|
||||
@ -321,6 +330,8 @@ private:
|
||||
EncoderContainer _encoders;
|
||||
OutlineContainer _outlines;
|
||||
ImageContainer _images;
|
||||
|
||||
friend class Page;
|
||||
};
|
||||
|
||||
|
||||
@ -360,8 +371,7 @@ inline Document::PageMode Document::getPageMode() const
|
||||
/*
|
||||
inline void openAction()
|
||||
{
|
||||
HPDF_SetOpenAction(_pdf,
|
||||
HPDF_Destination open_action);
|
||||
HPDF_SetOpenAction(_pdf, HPDF_Destination open_action);
|
||||
}
|
||||
*/
|
||||
|
||||
@ -394,6 +404,12 @@ inline void Document::addPageLabel(int pageNum, PageNumberStyle style, int first
|
||||
}
|
||||
|
||||
|
||||
inline void Document::useUTF8Encoding()
|
||||
{
|
||||
HPDF_UseUTFEncodings(_pdf);
|
||||
}
|
||||
|
||||
|
||||
inline void Document::useJapaneseFonts()
|
||||
{
|
||||
HPDF_UseJPFonts(_pdf);
|
||||
@ -478,6 +494,12 @@ inline std::size_t Document::pageCount() const
|
||||
}
|
||||
|
||||
|
||||
inline HPDF_Doc& Document::handle()
|
||||
{
|
||||
return _pdf;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::PDF
|
||||
|
||||
|
||||
|
@ -73,10 +73,10 @@ public:
|
||||
/// Returns the type of an encoding object.
|
||||
|
||||
ByteType getByteType(const std::string& text, int index = 0) const;
|
||||
/// Returns the type of byte in the text at position index
|
||||
/// Returns the type of byte in the text at position index
|
||||
|
||||
WriteMode writeMode();
|
||||
/// Returns the writing mode for the encoding object.
|
||||
/// Returns the writing mode for the encoding object.
|
||||
};
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ inline Encoder::ByteType Encoder::getByteType(const std::string& text, int index
|
||||
if (index < 0)
|
||||
throw InvalidArgumentException("Negative values not allowed.");
|
||||
|
||||
return static_cast<ByteType>(HPDF_Encoder_GetByteType(handle(),
|
||||
return static_cast<ByteType>(HPDF_Encoder_GetByteType(handle(),
|
||||
text.c_str(),
|
||||
static_cast<HPDF_UINT>(index)));
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ inline int Font::upperHeight() const
|
||||
|
||||
inline TextWidth Font::textWidth(const std::string& text)
|
||||
{
|
||||
return HPDF_Font_TextWidth(handle(),
|
||||
reinterpret_cast<const HPDF_BYTE*>(text.data()),
|
||||
return HPDF_Font_TextWidth(handle(),
|
||||
reinterpret_cast<const HPDF_BYTE*>(text.data()),
|
||||
static_cast<HPDF_UINT>(text.size()));
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
// from a DLL simpler. All files within this DLL are compiled with the PDF_EXPORTS
|
||||
// symbol defined on the command line. this symbol should not be defined on any project
|
||||
// that uses this DLL. This way any other project whose source files include this file see
|
||||
// PDF_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// PDF_API functions as being imported from a DLL, wheras this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
//
|
||||
#if defined(_WIN32) && defined(POCO_DLL)
|
||||
|
@ -34,6 +34,9 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
class Document;
|
||||
|
||||
|
||||
class PDF_API Page
|
||||
/// A Page represents a PDF page object.
|
||||
{
|
||||
@ -45,7 +48,7 @@ public:
|
||||
|
||||
enum Size
|
||||
{
|
||||
PAGE_SIZE_LETTER = HPDF_PAGE_SIZE_LETTER,
|
||||
PAGE_SIZE_LETTER = HPDF_PAGE_SIZE_LETTER,
|
||||
/// 8½ x 11 (Inches), 612 x 792 px
|
||||
PAGE_SIZE_LEGAL = HPDF_PAGE_SIZE_LEGAL,
|
||||
/// 8½ x 14 (Inches), 612 x 1008 px
|
||||
@ -141,7 +144,7 @@ public:
|
||||
/// Add spaces between the words to justify both left and right side.
|
||||
};
|
||||
|
||||
Page(HPDF_Doc* pPDF,
|
||||
Page(Document* pDocument,
|
||||
const HPDF_Page& page,
|
||||
Size pageSize = PAGE_SIZE_LETTER,
|
||||
Orientation orientation = ORIENTATION_PORTRAIT);
|
||||
@ -199,6 +202,13 @@ public:
|
||||
void setFont(const Font& font, float size);
|
||||
/// Sets the font.
|
||||
|
||||
void setFont(const std::string& fontName, float size, const std::string& encoding = "");
|
||||
/// Sets the font. The name must be a valid Base14 PDF internal font.
|
||||
|
||||
void setTTFont(const std::string& name, float size, const std::string& encoding = "UTF-8", bool embed = true);
|
||||
/// Sets the external true type font. Name must be a valid path to .ttf file.
|
||||
/// If embed is tru, font will be embedded int othe document.
|
||||
|
||||
float textWidth(const std::string& text);
|
||||
/// Returns the width of the supplied text.
|
||||
|
||||
@ -222,7 +232,7 @@ public:
|
||||
/// prints the text at the current position on the page.
|
||||
|
||||
void writeNextLineEx(float wordSpace, float charSpace, const std::string& text);
|
||||
/// Moves the current text position to the start of the next line, sets the word spacing,
|
||||
/// Moves the current text position to the start of the next line, sets the word spacing,
|
||||
/// character spacing and prints the text at the current position on the page.
|
||||
|
||||
int writeOnceInRectangle(float left,
|
||||
@ -231,7 +241,7 @@ public:
|
||||
float bottom,
|
||||
const std::string& text,
|
||||
TextAlignment align = TEXT_ALIGN_LEFT);
|
||||
/// Begins, writes and ends text objectinside the specified region.
|
||||
/// Begins, writes and ends text objectinside the specified region.
|
||||
/// Returns the number of characters written.
|
||||
|
||||
int writeInRectangle(float left,
|
||||
@ -240,7 +250,7 @@ public:
|
||||
float bottom,
|
||||
const std::string& text,
|
||||
TextAlignment align);
|
||||
/// Writes the text inside the specified region.
|
||||
/// Writes the text inside the specified region.
|
||||
/// Returns the number of characters written.
|
||||
|
||||
void drawImage(Image image, float x, float y, float width, float height);
|
||||
@ -249,18 +259,18 @@ public:
|
||||
const Destination& createDestination(const std::string& name);
|
||||
/// Creates ad returns reference to destination.
|
||||
|
||||
const TextAnnotation& createTextAnnotation(const std::string& name,
|
||||
const TextAnnotation& createTextAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& text,
|
||||
const Encoder& encoder);
|
||||
/// Creates ad returns reference to text annotation.
|
||||
|
||||
const LinkAnnotation& createLinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& createLinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const Destination& dest);
|
||||
/// Creates ad returns reference to destination link annotation.
|
||||
|
||||
const LinkAnnotation& createURILinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& createURILinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& uri);
|
||||
/// Creates ad returns reference to URI annotation.
|
||||
@ -292,22 +302,22 @@ public:
|
||||
|
||||
void curveTo(const std::vector<float>& values);
|
||||
/// Appends a Bézier curve to the current path using two specified points.
|
||||
/// The point (x1, y1) and the point (x2, y2) are used as the control points
|
||||
/// The point (x1, y1) and the point (x2, y2) are used as the control points
|
||||
/// for a Bézier curve and current point is moved to the point (x3, y3)
|
||||
|
||||
void curveToRight(float x2, float y2, float x3, float y3);
|
||||
/// Appends a Bézier curve to the right of the current point using two specified points.
|
||||
/// The current point and the point (x2, y2) are used as the control points
|
||||
/// The current point and the point (x2, y2) are used as the control points
|
||||
/// for a Bézier curve and current point is moved to the point (x3, y3)
|
||||
|
||||
void curveToLeft(float x2, float y2, float x3, float y3);
|
||||
/// Appends a Bézier curve to the left of the current point using two specified points.
|
||||
/// The current point and the point (x2, y2) are used as the control points
|
||||
/// The current point and the point (x2, y2) are used as the control points
|
||||
/// for a Bézier curve and current point is moved to the point (x3, y3)
|
||||
|
||||
void closePath();
|
||||
/// Appends a straight line from the current point to the start point of sub path.
|
||||
/// The current point is moved to the start point of sub path.
|
||||
/// The current point is moved to the start point of sub path.
|
||||
|
||||
void rectangle(float x, float y, float width, float height);
|
||||
/// Draws a rectangle.
|
||||
@ -319,7 +329,7 @@ public:
|
||||
/// Draws an arc.
|
||||
|
||||
void ellipse(float x, float y, float xRadius, float yRadius);
|
||||
/// Draws an ellipse.
|
||||
/// Draws an ellips.
|
||||
|
||||
void stroke();
|
||||
/// Paints the current path.
|
||||
@ -340,7 +350,7 @@ public:
|
||||
/// Fills the current path using the even-odd rule and then paints it.
|
||||
|
||||
void closeFillAndStroke();
|
||||
/// Closes the current path, fills the current path using the nonzero winding number
|
||||
/// Closes the current path, fills the current path using the nonzero winding number
|
||||
/// rule and then paints it.
|
||||
|
||||
void closeFillAndEOStroke();
|
||||
@ -363,22 +373,22 @@ public:
|
||||
|
||||
void moveTextPos(float x, float y);
|
||||
/// Moves the current text position to the start of the next line
|
||||
/// using specified offset values. If the start position of the current
|
||||
/// using specified offset values. If the start position of the current
|
||||
/// line is (x1, y1), the start of the next line is (x1 + x, y1 + y).
|
||||
|
||||
void moveTextNextLine(float x, float y);
|
||||
/// Moves the current text position to the start of the next line
|
||||
/// using specified offset values, and sets the text leading to -y.
|
||||
/// If the start position of the current line is (x1, y1), the start
|
||||
/// of the next line is (x1 + x, y1 + y).
|
||||
/// Moves the current text position to the start of the next line
|
||||
/// using specified offset values, and sets the text leading to -y.
|
||||
/// If the start position of the current line is (x1, y1), the start
|
||||
/// of the next line is (x1 + x, y1 + y).
|
||||
|
||||
void moveTextNextLine();
|
||||
/// Moves the current text position to the start of the next line.
|
||||
/// If the start position of the current line is (x1, y1), the start of
|
||||
/// If the start position of the current line is (x1, y1), the start of
|
||||
/// the next line is (x1, y1 - text leading).
|
||||
///
|
||||
/// NOTE:
|
||||
/// Since the default value of Text Leading is 0, an application has to
|
||||
/// Since the default value of Text Leading is 0, an application has to
|
||||
/// invoke HPDF_Page_SetTextLeading() before HPDF_Page_MoveTextPos2() to set
|
||||
/// text leading.
|
||||
|
||||
@ -422,7 +432,7 @@ public:
|
||||
/// Returns current dash mode.
|
||||
|
||||
void setDashMode(const PatternVec& pattern, int paramNo, int phase) const;
|
||||
/// Sets the dash mode.
|
||||
/// Sets teh dash mode.
|
||||
|
||||
float getFlatness() const;
|
||||
/// Returns the current flatness.
|
||||
@ -511,7 +521,7 @@ public:
|
||||
private:
|
||||
Page();
|
||||
|
||||
HPDF_Doc* _pPDF;
|
||||
Document* _pDocument;
|
||||
HPDF_Page _page;
|
||||
Size _size;
|
||||
Orientation _orientation;
|
||||
@ -533,12 +543,6 @@ inline Page::operator const Page::Type& () const
|
||||
}
|
||||
|
||||
|
||||
inline bool Page::operator == (const Page& other) const
|
||||
{
|
||||
return _pPDF == other._pPDF && _page == other._page;
|
||||
}
|
||||
|
||||
|
||||
inline void Page::setWidth(float value)
|
||||
{
|
||||
HPDF_Page_SetWidth(_page, value);
|
||||
@ -635,7 +639,7 @@ inline void Page::restoreGraphics()
|
||||
|
||||
inline void Page::concatenate(const std::vector<float>& values)
|
||||
{
|
||||
if (values.size() < 6)
|
||||
if (values.size() < 6)
|
||||
throw InvalidArgumentException("Needs six values");
|
||||
|
||||
HPDF_Page_Concat(_page,
|
||||
@ -662,7 +666,7 @@ inline void Page::lineTo(float x, float y)
|
||||
|
||||
inline void Page::curveTo(const std::vector<float>& values)
|
||||
{
|
||||
if (values.size() < 6)
|
||||
if (values.size() < 6)
|
||||
throw InvalidArgumentException("Needs six values");
|
||||
|
||||
HPDF_Page_CurveTo(_page,
|
||||
@ -795,13 +799,6 @@ inline void Page::moveTextNextLine()
|
||||
}
|
||||
|
||||
|
||||
inline const Font& Page::getFont() const
|
||||
{
|
||||
delete _pCurrentFont;
|
||||
return *(_pCurrentFont = new Font(_pPDF, HPDF_Page_GetCurrentFont(_page)));
|
||||
}
|
||||
|
||||
|
||||
inline float Page::getFontSize() const
|
||||
{
|
||||
return HPDF_Page_GetCurrentFontSize(_page);
|
||||
@ -876,7 +873,7 @@ inline DashMode Page::getDashMode() const
|
||||
|
||||
inline void Page::setDashMode(const PatternVec& pattern, int paramNo, int phase) const
|
||||
{
|
||||
HPDF_Page_SetDash(_page, &pattern[0],
|
||||
HPDF_Page_SetDash(_page, &pattern[0],
|
||||
static_cast<HPDF_UINT>(paramNo),
|
||||
static_cast<HPDF_UINT>(phase));
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class Resource
|
||||
public:
|
||||
typedef R Type;
|
||||
|
||||
Resource(HPDF_Doc* pPDF, const R& resource, const std::string& name = ""):
|
||||
Resource(HPDF_Doc* pPDF, const R& resource, const std::string& name = ""):
|
||||
_pPDF(pPDF),
|
||||
_resource(resource),
|
||||
_name(name)
|
||||
@ -41,7 +41,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Resource(const Resource& other):
|
||||
Resource(const Resource& other):
|
||||
_pPDF(other._pPDF),
|
||||
_resource(other._resource),
|
||||
_name(other._name)
|
||||
|
@ -188,7 +188,7 @@ typedef struct internal_state {
|
||||
int nice_match; /* Stop searching when current match exceeds this */
|
||||
|
||||
/* used by trees.c: */
|
||||
/* Didn't use ct_data typedef below to suppress compiler warning */
|
||||
/* Didn't use ct_data typedef below to supress compiler warning */
|
||||
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
|
||||
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
|
||||
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.8 >> -- hpdf.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL http://libharu.org/
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
*
|
||||
@ -17,6 +17,11 @@
|
||||
#ifndef _HPDF_H
|
||||
#define _HPDF_H
|
||||
|
||||
#include "hpdf_config.h"
|
||||
#include "hpdf_version.h"
|
||||
|
||||
#define HPDF_UNUSED(a) ((void)(a))
|
||||
|
||||
#ifdef HPDF_DLL_MAKE
|
||||
# define HPDF_EXPORT(A) __declspec(dllexport) A __stdcall
|
||||
#else
|
||||
@ -57,10 +62,21 @@ typedef HPDF_HANDLE HPDF_Image;
|
||||
typedef HPDF_HANDLE HPDF_Font;
|
||||
typedef HPDF_HANDLE HPDF_Outline;
|
||||
typedef HPDF_HANDLE HPDF_Encoder;
|
||||
typedef HPDF_HANDLE HPDF_3DMeasure;
|
||||
typedef HPDF_HANDLE HPDF_ExData;
|
||||
typedef HPDF_HANDLE HPDF_Destination;
|
||||
typedef HPDF_HANDLE HPDF_XObject;
|
||||
typedef HPDF_HANDLE HPDF_Annotation;
|
||||
typedef HPDF_HANDLE HPDF_ExtGState;
|
||||
typedef HPDF_HANDLE HPDF_FontDef;
|
||||
typedef HPDF_HANDLE HPDF_U3D;
|
||||
typedef HPDF_HANDLE HPDF_JavaScript;
|
||||
typedef HPDF_HANDLE HPDF_Error;
|
||||
typedef HPDF_HANDLE HPDF_MMgr;
|
||||
typedef HPDF_HANDLE HPDF_Dict;
|
||||
typedef HPDF_HANDLE HPDF_EmbeddedFile;
|
||||
typedef HPDF_HANDLE HPDF_OutputIntent;
|
||||
typedef HPDF_HANDLE HPDF_Xref;
|
||||
|
||||
#else
|
||||
|
||||
@ -70,6 +86,8 @@ typedef HPDF_HANDLE HPDF_ExtGState;
|
||||
|
||||
#include "hpdf_consts.h"
|
||||
#include "hpdf_doc.h"
|
||||
#include "hpdf_error.h"
|
||||
#include "hpdf_pdfa.h"
|
||||
|
||||
#endif /* HPDF_SHARED */
|
||||
|
||||
@ -121,6 +139,10 @@ HPDF_FreeDocAll (HPDF_Doc pdf);
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_SaveToStream (HPDF_Doc pdf);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_GetContents (HPDF_Doc pdf,
|
||||
HPDF_BYTE *buf,
|
||||
HPDF_UINT32 *size);
|
||||
|
||||
HPDF_EXPORT(HPDF_UINT32)
|
||||
HPDF_GetStreamSize (HPDF_Doc pdf);
|
||||
@ -152,6 +174,10 @@ HPDF_EXPORT(void)
|
||||
HPDF_ResetError (HPDF_Doc pdf);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_CheckError (HPDF_Error error);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_SetPagesConfiguration (HPDF_Doc pdf,
|
||||
HPDF_UINT page_per_pages);
|
||||
@ -233,6 +259,10 @@ HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Page_SetRotate (HPDF_Page page,
|
||||
HPDF_UINT16 angle);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Page_SetZoom (HPDF_Page page,
|
||||
HPDF_REAL zoom);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*----- font handling -------------------------------------------------------*/
|
||||
|
||||
@ -249,6 +279,11 @@ HPDF_LoadType1FontFromFile (HPDF_Doc pdf,
|
||||
const char *data_file_name);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_FontDef)
|
||||
HPDF_GetTTFontDefFromFile (HPDF_Doc pdf,
|
||||
const char *file_name,
|
||||
HPDF_BOOL embedding);
|
||||
|
||||
HPDF_EXPORT(const char*)
|
||||
HPDF_LoadTTFontFromFile (HPDF_Doc pdf,
|
||||
const char *file_name,
|
||||
@ -411,15 +446,34 @@ HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_UseCNTEncodings (HPDF_Doc pdf);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_UseUTFEncodings (HPDF_Doc pdf);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- annotation ---------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_Create3DAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
HPDF_U3D u3d);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateTextAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateFreeTextAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateLineAnnot (HPDF_Page page,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateLinkAnnot (HPDF_Page page,
|
||||
@ -433,6 +487,67 @@ HPDF_Page_CreateURILinkAnnot (HPDF_Page page,
|
||||
const char *uri);
|
||||
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_Page_CreateTextMarkupAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder,
|
||||
HPDF_AnnotType subType);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateHighlightAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateUnderlineAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateSquigglyAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateStrikeOutAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreatePopupAnnot ( HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
HPDF_Annotation parent);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateStampAnnot ( HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
HPDF_StampAnnotName name,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateProjectionAnnot(HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateSquareAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_Annotation)
|
||||
HPDF_Page_CreateCircleAnnot (HPDF_Page page,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot,
|
||||
HPDF_AnnotHighlightMode mode);
|
||||
@ -454,11 +569,179 @@ HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_TextAnnot_SetOpened (HPDF_Annotation annot,
|
||||
HPDF_BOOL opened);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetRGBColor (HPDF_Annotation annot, HPDF_RGBColor color);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetNoColor (HPDF_Annotation annot);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetTitle (HPDF_Annotation annot, const char* name);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetSubject (HPDF_Annotation annot, const char* name);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetCreationDate (HPDF_Annotation annot, HPDF_Date value);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetTransparency (HPDF_Annotation annot, HPDF_REAL value);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetIntent (HPDF_Annotation annot, HPDF_AnnotIntent intent);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetPopup (HPDF_Annotation annot, HPDF_Annotation popup);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetRectDiff (HPDF_Annotation annot, HPDF_Rect rect); /* RD entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity); /* BE entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorRGBColor (HPDF_Annotation annot, HPDF_RGBColor color); /* IC with RGB entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color); /* IC with CMYK entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorGrayColor (HPDF_Annotation annot, HPDF_REAL color); /* IC with Gray entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorTransparent (HPDF_Annotation annot); /* IC with No Color entry */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_TextMarkupAnnot_SetQuadPoints ( HPDF_Annotation annot, HPDF_Point lb, HPDF_Point rb, HPDF_Point rt, HPDF_Point lt); /* l-left, r-right, b-bottom, t-top positions */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
|
||||
HPDF_Annotation annot,
|
||||
HPDF_Annotation annot3d,
|
||||
HPDF_Dict view);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_PopupAnnot_SetOpened (HPDF_Annotation annot,
|
||||
HPDF_BOOL opened);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_SetLineEndingStyle (HPDF_Annotation annot, HPDF_LineAnnotEndingStyle startStyle, HPDF_LineAnnotEndingStyle endStyle);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_Set3PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point kneePoint, HPDF_Point endPoint); /* Callout line will be in default user space */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_Set2PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point endPoint); /* Callout line will be in default user space */
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_SetDefaultStyle (HPDF_Annotation annot, const char* style);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
|
||||
HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
|
||||
HPDF_Point endPoint, HPDF_LineAnnotEndingStyle endStyle);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetLeader (HPDF_Annotation annot, HPDF_INT leaderLen, HPDF_INT leaderExtLen, HPDF_INT leaderOffsetLen);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetCaption (HPDF_Annotation annot, HPDF_BOOL showCaption, HPDF_LineAnnotCapPosition position, HPDF_INT horzOffset, HPDF_INT vertOffset);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
|
||||
HPDF_BSSubtype subtype,
|
||||
HPDF_REAL width,
|
||||
HPDF_UINT16 dash_on,
|
||||
HPDF_UINT16 dash_off,
|
||||
HPDF_UINT16 dash_phase);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_ProjectionAnnot_SetExData(HPDF_Annotation annot, HPDF_ExData exdata);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- 3D Measure ---------------------------------------------------------*/
|
||||
HPDF_EXPORT(HPDF_3DMeasure)
|
||||
HPDF_Page_Create3DC3DMeasure(HPDF_Page page,
|
||||
HPDF_Point3D firstanchorpoint,
|
||||
HPDF_Point3D textanchorpoint
|
||||
);
|
||||
|
||||
HPDF_EXPORT(HPDF_3DMeasure)
|
||||
HPDF_Page_CreatePD33DMeasure(HPDF_Page page,
|
||||
HPDF_Point3D annotationPlaneNormal,
|
||||
HPDF_Point3D firstAnchorPoint,
|
||||
HPDF_Point3D secondAnchorPoint,
|
||||
HPDF_Point3D leaderLinesDirection,
|
||||
HPDF_Point3D measurementValuePoint,
|
||||
HPDF_Point3D textYDirection,
|
||||
HPDF_REAL value,
|
||||
const char* unitsString
|
||||
);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
|
||||
const char* name);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
|
||||
HPDF_RGBColor color);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
|
||||
HPDF_REAL textsize);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
|
||||
HPDF_INT32 x,
|
||||
HPDF_INT32 y);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
|
||||
HPDF_Annotation projectionanotation);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- External Data ---------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_ExData)
|
||||
HPDF_Page_Create3DAnnotExData(HPDF_Page page );
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata, HPDF_3DMeasure measure);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- 3D View ---------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_Dict)
|
||||
HPDF_Page_Create3DView (HPDF_Page page,
|
||||
HPDF_U3D u3d,
|
||||
HPDF_Annotation annot3d,
|
||||
const char *name);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DView_Add3DC3DMeasure(HPDF_Dict view,
|
||||
HPDF_3DMeasure measure);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- image data ---------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadPngImageFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buffer,
|
||||
HPDF_UINT size);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadPngImageFromFile (HPDF_Doc pdf,
|
||||
const char *filename);
|
||||
@ -473,6 +756,29 @@ HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadJpegImageFromFile (HPDF_Doc pdf,
|
||||
const char *filename);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadJpegImageFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buffer,
|
||||
HPDF_UINT size);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadU3DFromFile (HPDF_Doc pdf,
|
||||
const char *filename);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadU3DFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buffer,
|
||||
HPDF_UINT size);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buf,
|
||||
HPDF_UINT width,
|
||||
HPDF_UINT height,
|
||||
HPDF_UINT line_width,
|
||||
HPDF_BOOL black_is1,
|
||||
HPDF_BOOL top_is_first);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadRawImageFromFile (HPDF_Doc pdf,
|
||||
@ -490,6 +796,9 @@ HPDF_LoadRawImageFromMem (HPDF_Doc pdf,
|
||||
HPDF_ColorSpace color_space,
|
||||
HPDF_UINT bits_per_component);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Image_AddSMask (HPDF_Image image,
|
||||
HPDF_Image smask);
|
||||
|
||||
HPDF_EXPORT(HPDF_Point)
|
||||
HPDF_Image_GetSize (HPDF_Image image);
|
||||
@ -632,6 +941,14 @@ HPDF_Font_MeasureText (HPDF_Font font,
|
||||
HPDF_REAL *real_width);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- attachements -------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_EmbeddedFile)
|
||||
HPDF_AttachFile (HPDF_Doc pdf,
|
||||
const char *file);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/*----- extended graphics state --------------------------------------------*/
|
||||
|
||||
@ -1148,6 +1465,17 @@ HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Page_ExecuteXObject (HPDF_Page page,
|
||||
HPDF_XObject obj);
|
||||
|
||||
/*--- Content streams ----------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Page_New_Content_Stream (HPDF_Page page,
|
||||
HPDF_Dict* new_stream);
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page,
|
||||
HPDF_Dict shared_stream);
|
||||
|
||||
|
||||
/*--- Marked content -----------------------------------------------------*/
|
||||
|
||||
/* BMC --not implemented yet */
|
||||
@ -1219,6 +1547,18 @@ HPDF_Page_SetSlideShow (HPDF_Page page,
|
||||
HPDF_REAL trans_time);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_OutputIntent)
|
||||
HPDF_ICC_LoadIccFromMem (HPDF_Doc pdf,
|
||||
HPDF_MMgr mmgr,
|
||||
HPDF_Stream iccdata,
|
||||
HPDF_Xref xref,
|
||||
int numcomponent);
|
||||
|
||||
HPDF_EXPORT(HPDF_OutputIntent)
|
||||
HPDF_LoadIccProfileFromFile (HPDF_Doc pdf,
|
||||
const char* icc_file_name,
|
||||
int numcomponent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
57
PDF/include/Poco/PDF/hpdf_3dmeasure.h
Normal file
57
PDF/include/Poco/PDF/hpdf_3dmeasure.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPDF_3DMEASURE_H
|
||||
#define _HPDF_3DMEASURE_H
|
||||
|
||||
#include "hpdf_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*------ HPDF_3DMeasure -----------------------------------------------------*/
|
||||
|
||||
|
||||
HPDF_3DMeasure
|
||||
HPDF_3DC3DMeasure_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Point3D firstanchorpoint,
|
||||
HPDF_Point3D textanchorpoint
|
||||
);
|
||||
|
||||
HPDF_3DMeasure
|
||||
HPDF_PD33DMeasure_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Point3D annotationPlaneNormal,
|
||||
HPDF_Point3D firstAnchorPoint,
|
||||
HPDF_Point3D secondAnchorPoint,
|
||||
HPDF_Point3D leaderLinesDirection,
|
||||
HPDF_Point3D measurementValuePoint,
|
||||
HPDF_Point3D textYDirection,
|
||||
HPDF_REAL value,
|
||||
const char* unitsString
|
||||
);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _HPDF_3DMEASURE_H */
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_annotation.h
|
||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -47,21 +50,39 @@ HPDF_URILinkAnnot_New (HPDF_MMgr mmgr,
|
||||
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_TextAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder);
|
||||
HPDF_3DAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_U3D u3d);
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder,
|
||||
HPDF_AnnotType subtype);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
|
||||
HPDF_BSSubtype subtype,
|
||||
HPDF_REAL width,
|
||||
HPDF_UINT16 dash_on,
|
||||
HPDF_UINT16 dash_off,
|
||||
HPDF_UINT16 dash_phase);
|
||||
HPDF_Annotation
|
||||
HPDF_PopupAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_Annotation parent);
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_StampAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_StampAnnotName name,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_ProjectionAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder);
|
||||
|
||||
HPDF_BOOL
|
||||
HPDF_Annotation_Validate (HPDF_Annotation annot);
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_catalog.h
|
||||
* << Haru Free PDF Library >> -- hpdf_catalog.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -28,6 +31,15 @@ HPDF_Catalog_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref);
|
||||
|
||||
|
||||
HPDF_NameDict
|
||||
HPDF_Catalog_GetNames (HPDF_Catalog catalog);
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Catalog_SetNames (HPDF_Catalog catalog,
|
||||
HPDF_NameDict dict);
|
||||
|
||||
|
||||
HPDF_Pages
|
||||
HPDF_Catalog_GetRoot (HPDF_Catalog catalog);
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.7 >> -- hpdf_conf.h
|
||||
* << Haru Free PDF Library >> -- hpdf_conf.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -19,6 +20,14 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#if defined(_MSC_VER)
|
||||
#ifndef _USE_MATH_DEFINES
|
||||
#define _USE_MATH_DEFINES 1
|
||||
#endif /* _USE_MATH_DEFINES */
|
||||
#endif
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN /* for M_PI */
|
||||
#endif /* __USE_XOPEN */
|
||||
#include <math.h>
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
75
PDF/include/Poco/PDF/hpdf_config.h
Normal file
75
PDF/include/Poco/PDF/hpdf_config.h
Normal file
@ -0,0 +1,75 @@
|
||||
/* include/hpdf_config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef LIBHPDF_HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef LIBHPDF_HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `png' library (-lpng). */
|
||||
#define LIBHPDF_HAVE_LIBPNG 1
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#define LIBHPDF_HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef LIBHPDF_HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef LIBHPDF_HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define LIBHPDF_HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define LIBHPDF_HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define LIBHPDF_HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define LIBHPDF_HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef LIBHPDF_HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define LIBHPDF_HAVE_UNISTD_H 1
|
||||
|
||||
/* define pi */
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif /* M_PI */
|
||||
|
||||
/* debug build */
|
||||
#undef LIBHPDF_DEBUG
|
||||
|
||||
/* debug trace enabled */
|
||||
#undef LIBHPDF_DEBUG_TRACE
|
||||
|
||||
/* libpng is not available */
|
||||
#undef LIBHPDF_HAVE_NOPNGLIB
|
||||
|
||||
/* zlib is not available */
|
||||
#undef LIBHPDF_HAVE_NOZLIB
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef LIBHPDF_PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef LIBHPDF_PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define LIBHPDF_PACKAGE_STRING "libhpdf 2.2.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef LIBHPDF_PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define LIBHPDF_PACKAGE_VERSION "2.2.0"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define LIBHPDF_STDC_HEADERS 1
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.8 >> -- hpdf_consts.h
|
||||
* << Haru Free PDF Library >> -- hpdf_consts.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -67,8 +68,6 @@
|
||||
#define HPDF_DEF_PAGE_WIDTH 595.276F
|
||||
#define HPDF_DEF_PAGE_HEIGHT 841.89F
|
||||
|
||||
#define HPDF_VERSION_TEXT "2.0.8"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*----- compression mode ----------------------------------------------------*/
|
||||
|
||||
@ -101,6 +100,7 @@
|
||||
#define HPDF_HIDE_WINDOW_UI 4
|
||||
#define HPDF_FIT_WINDOW 8
|
||||
#define HPDF_CENTER_WINDOW 16
|
||||
#define HPDF_PRINT_SCALING_NONE 32
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -115,7 +115,7 @@
|
||||
#define HPDF_LIMIT_MAX_STRING_LEN 65535
|
||||
#define HPDF_LIMIT_MAX_NAME_LEN 127
|
||||
|
||||
#define HPDF_LIMIT_MAX_ARRAY 8191
|
||||
#define HPDF_LIMIT_MAX_ARRAY 32767
|
||||
#define HPDF_LIMIT_MAX_DICT_ELEMENT 4095
|
||||
#define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607
|
||||
#define HPDF_LIMIT_MAX_GSTATE 28
|
||||
@ -142,7 +142,7 @@
|
||||
#define HPDF_MAX_WORDSPACE 300
|
||||
#define HPDF_MIN_CHARSPACE -30
|
||||
#define HPDF_MAX_CHARSPACE 300
|
||||
#define HPDF_MAX_FONTSIZE 300
|
||||
#define HPDF_MAX_FONTSIZE 600
|
||||
#define HPDF_MAX_ZOOMSIZE 10
|
||||
#define HPDF_MAX_LEADING 300
|
||||
#define HPDF_MAX_LINEWIDTH 100
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_destination.c
|
||||
* << Haru Free PDF Library >> -- hpdf_destination.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_doc.h
|
||||
* << Haru Free PDF Library >> -- hpdf_doc.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.2 >> -- hpdf_encoder.h
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -92,6 +93,11 @@ typedef HPDF_UNICODE
|
||||
(*HPDF_Encoder_ToUnicode_Func) (HPDF_Encoder encoder,
|
||||
HPDF_UINT16 code);
|
||||
|
||||
typedef char *
|
||||
(*HPDF_Encoder_EncodeText_Func) (HPDF_Encoder encoder,
|
||||
const char *text,
|
||||
HPDF_UINT len,
|
||||
HPDF_UINT *encoded_length);
|
||||
|
||||
typedef HPDF_STATUS
|
||||
(*HPDF_Encoder_Write_Func) (HPDF_Encoder encoder,
|
||||
@ -108,13 +114,14 @@ typedef void
|
||||
|
||||
typedef struct _HPDF_Encoder_Rec {
|
||||
HPDF_UINT32 sig_bytes;
|
||||
char name[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
||||
char name[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
||||
HPDF_MMgr mmgr;
|
||||
HPDF_Error error;
|
||||
HPDF_EncoderType type;
|
||||
|
||||
HPDF_Encoder_ByteType_Func byte_type_fn;
|
||||
HPDF_Encoder_ToUnicode_Func to_unicode_fn;
|
||||
HPDF_Encoder_EncodeText_Func encode_text_fn;
|
||||
HPDF_Encoder_Write_Func write_fn;
|
||||
HPDF_Encoder_Free_Func free_fn;
|
||||
HPDF_Encoder_Init_Func init_fn;
|
||||
@ -230,7 +237,7 @@ typedef struct _HPDF_CMapEncoderAttr_Rec {
|
||||
|
||||
HPDF_Encoder
|
||||
HPDF_CMapEncoder_New (HPDF_MMgr mmgr,
|
||||
char *name,
|
||||
char *name,
|
||||
HPDF_Encoder_Init_Func init_fn);
|
||||
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encrypt.h
|
||||
* << Haru Free PDF Library >> -- hpdf_encrypt.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encryptdict.h
|
||||
* << Haru Free PDF Library >> -- hpdf_encryptdict.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_error.h
|
||||
* << Haru Free PDF Library >> -- hpdf_error.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -141,6 +142,11 @@ extern "C" {
|
||||
#define HPDF_EXT_GSTATE_OUT_OF_RANGE 0x1080
|
||||
#define HPDF_INVALID_EXT_GSTATE 0x1081
|
||||
#define HPDF_EXT_GSTATE_READ_ONLY 0x1082
|
||||
#define HPDF_INVALID_U3D_DATA 0x1083
|
||||
#define HPDF_NAME_CANNOT_GET_NAMES 0x1084
|
||||
#define HPDF_INVALID_ICC_COMPONENT_NUM 0x1085
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*----- HPDF_Error ----------------------------------------------------------*/
|
||||
@ -184,10 +190,6 @@ HPDF_SetError (HPDF_Error error,
|
||||
HPDF_STATUS detail_no);
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_CheckError (HPDF_Error error);
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_RaiseError (HPDF_Error error,
|
||||
HPDF_STATUS error_no,
|
||||
|
41
PDF/include/Poco/PDF/hpdf_exdata.h
Normal file
41
PDF/include/Poco/PDF/hpdf_exdata.h
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPDF_EXDATA_H
|
||||
#define _HPDF_EXDATA_H
|
||||
|
||||
#include "hpdf_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*------ HPDF_ExData -----------------------------------------------------*/
|
||||
|
||||
HPDF_ExData
|
||||
HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref );
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _HPDF_EXDATA_H */
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_ext_gstate.h
|
||||
* << Haru Free PDF Library >> -- hpdf_ext_gstate.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -22,7 +25,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
HPDF_Dict
|
||||
HPDF_ExtGState_New (HPDF_MMgr mmgr,
|
||||
HPDF_ExtGState_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref);
|
||||
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_font.h
|
||||
* << Haru Free PDF Library >> -- hpdf_font.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -69,7 +72,7 @@ typedef struct _HPDF_FontAttr_Rec {
|
||||
HPDF_Encoder encoder;
|
||||
|
||||
/* if the encoding-type is HPDF_ENCODER_TYPE_SINGLE_BYTE, the width of
|
||||
* each characters are cashed in 'widths'.
|
||||
* each charactors are cashed in 'widths'.
|
||||
* when HPDF_ENCODER_TYPE_DOUBLE_BYTE the width is calculate each time.
|
||||
*/
|
||||
HPDF_INT16* widths;
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.4 >> -- hpdf_fontdef.h
|
||||
* << Haru Free PDF Library >> -- hpdf_fontdef.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -300,7 +303,8 @@ typedef struct _HPDF_TTFontDefAttr_Rec {
|
||||
HPDF_TTF_OffsetTbl offset_tbl;
|
||||
HPDF_TTF_CmapRange cmap;
|
||||
HPDF_UINT16 fs_type;
|
||||
HPDF_BYTE panose[12];
|
||||
HPDF_BYTE sfamilyclass[2];
|
||||
HPDF_BYTE panose[10];
|
||||
HPDF_UINT32 code_page_range1;
|
||||
HPDF_UINT32 code_page_range2;
|
||||
|
||||
@ -400,4 +404,3 @@ HPDF_CIDFontDef_ChangeStyle (HPDF_FontDef fontdef,
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _HPDF_FONTDEF_H */
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_gstate.h
|
||||
* << Haru Free PDF Library >> -- hpdf_gstate.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_image.h
|
||||
* << Haru Free PDF Library >> -- hpdf_image.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -21,7 +24,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef HPDF_NOPNGLIB
|
||||
HPDF_Image
|
||||
HPDF_Image_Load1BitImageFromMem (HPDF_MMgr mmgr,
|
||||
const HPDF_BYTE *buf,
|
||||
HPDF_Xref xref,
|
||||
HPDF_UINT width,
|
||||
HPDF_UINT height,
|
||||
HPDF_UINT line_width,
|
||||
HPDF_BOOL top_is_first
|
||||
);
|
||||
|
||||
|
||||
#ifndef LIBHPDF_HAVE_NOPNGLIB
|
||||
|
||||
HPDF_Image
|
||||
HPDF_Image_LoadPngImage (HPDF_MMgr mmgr,
|
||||
@ -36,6 +50,11 @@ HPDF_Image_LoadJpegImage (HPDF_MMgr mmgr,
|
||||
HPDF_Stream jpeg_data,
|
||||
HPDF_Xref xref);
|
||||
|
||||
HPDF_Image
|
||||
HPDF_Image_LoadJpegImageFromMem (HPDF_MMgr mmgr,
|
||||
const HPDF_BYTE *buf,
|
||||
HPDF_UINT size,
|
||||
HPDF_Xref xref);
|
||||
|
||||
HPDF_Image
|
||||
HPDF_Image_LoadRawImage (HPDF_MMgr mmgr,
|
||||
@ -64,6 +83,14 @@ HPDF_STATUS
|
||||
HPDF_Image_SetMask (HPDF_Image image,
|
||||
HPDF_BOOL mask);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Image_SetColorSpace (HPDF_Image image,
|
||||
HPDF_Array colorspace);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Image_SetRenderingIntent (HPDF_Image image,
|
||||
const char* intent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_info.c
|
||||
* << Haru Free PDF Library >> -- hpdf_info.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_list.h
|
||||
* << Haru Free PDF Library >> -- hpdf_list.h
|
||||
*
|
||||
* Copyright (c) 1999-2005 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_mmgr.h
|
||||
* << Haru Free PDF Library >> -- hpdf_mmgr.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
76
PDF/include/Poco/PDF/hpdf_namedict.h
Normal file
76
PDF/include/Poco/PDF/hpdf_namedict.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_namedict.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPDF_NAMEDICT_H
|
||||
#define _HPDF_NAMEDICT_H
|
||||
|
||||
#include "hpdf_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
HPDF_NameDict
|
||||
HPDF_NameDict_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref);
|
||||
|
||||
HPDF_NameTree
|
||||
HPDF_NameDict_GetNameTree (HPDF_NameDict namedict,
|
||||
HPDF_NameDictKey key);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_NameDict_SetNameTree (HPDF_NameDict namedict,
|
||||
HPDF_NameDictKey key,
|
||||
HPDF_NameTree tree);
|
||||
|
||||
HPDF_BOOL
|
||||
HPDF_NameDict_Validate (HPDF_NameDict namedict);
|
||||
|
||||
|
||||
/*------- NameTree -------*/
|
||||
|
||||
HPDF_NameTree
|
||||
HPDF_NameTree_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_NameTree_Add (HPDF_NameTree tree,
|
||||
HPDF_String name,
|
||||
void *obj);
|
||||
|
||||
HPDF_BOOL
|
||||
HPDF_NameTree_Validate (HPDF_NameTree tree);
|
||||
|
||||
|
||||
/*------- EmbeddedFile -------*/
|
||||
|
||||
HPDF_EmbeddedFile
|
||||
HPDF_EmbeddedFile_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
const char *file);
|
||||
|
||||
HPDF_BOOL
|
||||
HPDF_EmbeddedFile_Validate (HPDF_EmbeddedFile emfile);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _HPDF_NAMEDICT_H */
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.5 >> -- hpdf_objects.c
|
||||
* << Haru Free PDF Library >> -- hpdf_objects.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -56,6 +59,8 @@ extern "C" {
|
||||
#define HPDF_OSUBCLASS_ENCRYPT 0x0900
|
||||
#define HPDF_OSUBCLASS_EXT_GSTATE 0x0A00
|
||||
#define HPDF_OSUBCLASS_EXT_GSTATE_R 0x0B00 /* read only object */
|
||||
#define HPDF_OSUBCLASS_NAMEDICT 0x0C00
|
||||
#define HPDF_OSUBCLASS_NAMETREE 0x0D00
|
||||
|
||||
|
||||
|
||||
@ -268,10 +273,9 @@ HPDF_String_Write (HPDF_String obj,
|
||||
HPDF_Stream stream,
|
||||
HPDF_Encrypt e);
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_String_SetValue (HPDF_String obj,
|
||||
const char *value);
|
||||
HPDF_INT32
|
||||
HPDF_String_Cmp (HPDF_String s1,
|
||||
HPDF_String s2);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -386,6 +390,10 @@ void
|
||||
HPDF_Array_Clear (HPDF_Array array);
|
||||
|
||||
|
||||
HPDF_UINT
|
||||
HPDF_Array_Items (HPDF_Array array);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*----- HPDF_Dict -----------------------------------------------------------*/
|
||||
|
||||
@ -417,6 +425,7 @@ typedef struct _HPDF_Dict_Rec {
|
||||
HPDF_Dict_FreeFunc free_fn;
|
||||
HPDF_Stream stream;
|
||||
HPDF_UINT filter;
|
||||
HPDF_Dict filterParams;
|
||||
void *attr;
|
||||
} HPDF_Dict_Rec;
|
||||
|
||||
@ -568,16 +577,24 @@ HPDF_Xref_GetEntryByObjectId (HPDF_Xref xref,
|
||||
|
||||
|
||||
|
||||
typedef HPDF_Dict HPDF_EmbeddedFile;
|
||||
typedef HPDF_Dict HPDF_NameDict;
|
||||
typedef HPDF_Dict HPDF_NameTree;
|
||||
typedef HPDF_Dict HPDF_Pages;
|
||||
typedef HPDF_Dict HPDF_Page;
|
||||
typedef HPDF_Dict HPDF_Annotation;
|
||||
typedef HPDF_Dict HPDF_3DMeasure;
|
||||
typedef HPDF_Dict HPDF_ExData;
|
||||
typedef HPDF_Dict HPDF_XObject;
|
||||
typedef HPDF_Dict HPDF_Image;
|
||||
typedef HPDF_Dict HPDF_Outline;
|
||||
typedef HPDF_Dict HPDF_EncryptDict;
|
||||
typedef HPDF_Dict HPDF_Action;
|
||||
typedef HPDF_Dict HPDF_ExtGState;
|
||||
typedef HPDF_Array HPDF_Destination;
|
||||
typedef HPDF_Array HPDF_Destination;
|
||||
typedef HPDF_Dict HPDF_U3D;
|
||||
typedef HPDF_Dict HPDF_OutputIntent;
|
||||
typedef HPDF_Dict HPDF_JavaScript;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_outline.h
|
||||
* << Haru Free PDF Library >> -- hpdf_outline.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_page_label.h
|
||||
* << Haru Free PDF Library >> -- hpdf_page_label.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_pages.c
|
||||
* << Haru Free PDF Library >> -- hpdf_pages.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -62,7 +65,7 @@ typedef struct _HPDF_PageAttr_Rec {
|
||||
HPDF_Stream stream;
|
||||
HPDF_Xref xref;
|
||||
HPDF_UINT compression_mode;
|
||||
HPDF_PDFVer *ver;
|
||||
HPDF_PDFVer *ver;
|
||||
} HPDF_PageAttr_Rec;
|
||||
|
||||
|
||||
|
43
PDF/include/Poco/PDF/hpdf_pdfa.h
Normal file
43
PDF/include/Poco/PDF/hpdf_pdfa.h
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_pdfa.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPDF_PDFA_H
|
||||
#define _HPDF_PDFA_H
|
||||
|
||||
#include "hpdf_doc.h"
|
||||
#include "hpdf_objects.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_PDFA_AppendOutputIntents(HPDF_Doc pdf, const char *iccname, HPDF_Dict iccdict);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,
|
||||
HPDF_PDFAType pdfatype);
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_PDFA_GenerateID(HPDF_Doc);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_streams.h
|
||||
* << Haru Free PDF Library >> -- hpdf_streams.h
|
||||
*
|
||||
* Copyright (c) 1999-2004 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -31,7 +34,7 @@ typedef enum _HPDF_StreamType {
|
||||
HPDF_STREAM_UNKNOWN = 0,
|
||||
HPDF_STREAM_CALLBACK,
|
||||
HPDF_STREAM_FILE,
|
||||
HPDF_STREAM_MEMORY,
|
||||
HPDF_STREAM_MEMORY
|
||||
} HPDF_StreamType;
|
||||
|
||||
#define HPDF_STREAM_FILTER_NONE 0x0000
|
||||
@ -39,6 +42,7 @@ typedef enum _HPDF_StreamType {
|
||||
#define HPDF_STREAM_FILTER_ASCII85 0x0200
|
||||
#define HPDF_STREAM_FILTER_FLATE_DECODE 0x0400
|
||||
#define HPDF_STREAM_FILTER_DCT_DECODE 0x0800
|
||||
#define HPDF_STREAM_FILTER_CCITT_DECODE 0x1000
|
||||
|
||||
typedef enum _HPDF_WhenceMode {
|
||||
HPDF_SEEK_SET = 0,
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_types.h
|
||||
* << Haru Free PDF Library >> -- hpdf_types.h
|
||||
*
|
||||
* URL http://libharu.sourceforge.net/
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -107,6 +108,14 @@ typedef struct _HPDF_Rect {
|
||||
HPDF_REAL top;
|
||||
} HPDF_Rect;
|
||||
|
||||
/* HPDF_Point3D struct
|
||||
*/
|
||||
typedef struct _HPDF_Point3D {
|
||||
HPDF_REAL x;
|
||||
HPDF_REAL y;
|
||||
HPDF_REAL z;
|
||||
} HPDF_Point3D;
|
||||
|
||||
typedef struct _HPDF_Rect HPDF_Box;
|
||||
|
||||
/* HPDF_Date struct
|
||||
@ -136,9 +145,19 @@ typedef enum _HPDF_InfoType {
|
||||
HPDF_INFO_TITLE,
|
||||
HPDF_INFO_SUBJECT,
|
||||
HPDF_INFO_KEYWORDS,
|
||||
HPDF_INFO_TRAPPED,
|
||||
HPDF_INFO_GTS_PDFX,
|
||||
HPDF_INFO_EOF
|
||||
} HPDF_InfoType;
|
||||
|
||||
/* PDF-A Types */
|
||||
|
||||
typedef enum _HPDF_PDFA_TYPE
|
||||
{
|
||||
HPDF_PDFA_1A = 0,
|
||||
HPDF_PDFA_1B = 1
|
||||
} HPDF_PDFAType;
|
||||
|
||||
|
||||
typedef enum _HPDF_PdfVer {
|
||||
HPDF_VER_12 = 0,
|
||||
@ -146,6 +165,7 @@ typedef enum _HPDF_PdfVer {
|
||||
HPDF_VER_14,
|
||||
HPDF_VER_15,
|
||||
HPDF_VER_16,
|
||||
HPDF_VER_17,
|
||||
HPDF_VER_EOF
|
||||
} HPDF_PDFVer;
|
||||
|
||||
@ -290,6 +310,8 @@ typedef enum _HPDF_PageLayout {
|
||||
HPDF_PAGE_LAYOUT_ONE_COLUMN,
|
||||
HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT,
|
||||
HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT,
|
||||
HPDF_PAGE_LAYOUT_TWO_PAGE_LEFT,
|
||||
HPDF_PAGE_LAYOUT_TWO_PAGE_RIGHT,
|
||||
HPDF_PAGE_LAYOUT_EOF
|
||||
} HPDF_PageLayout;
|
||||
|
||||
@ -342,7 +364,11 @@ typedef enum _HPDF_AnnotType {
|
||||
HPDF_ANNOT_UNDERLINE,
|
||||
HPDF_ANNOT_INK,
|
||||
HPDF_ANNOT_FILE_ATTACHMENT,
|
||||
HPDF_ANNOT_POPUP
|
||||
HPDF_ANNOT_POPUP,
|
||||
HPDF_ANNOT_3D,
|
||||
HPDF_ANNOT_SQUIGGLY,
|
||||
HPDF_ANNOT_LINE,
|
||||
HPDF_ANNOT_PROJECTION
|
||||
} HPDF_AnnotType;
|
||||
|
||||
|
||||
@ -377,7 +403,50 @@ typedef enum _HPDF_AnnotIcon {
|
||||
HPDF_ANNOT_ICON_EOF
|
||||
} HPDF_AnnotIcon;
|
||||
|
||||
typedef enum _HPDF_AnnotIntent {
|
||||
HPDF_ANNOT_INTENT_FREETEXTCALLOUT = 0,
|
||||
HPDF_ANNOT_INTENT_FREETEXTTYPEWRITER,
|
||||
HPDF_ANNOT_INTENT_LINEARROW,
|
||||
HPDF_ANNOT_INTENT_LINEDIMENSION,
|
||||
HPDF_ANNOT_INTENT_POLYGONCLOUD,
|
||||
HPDF_ANNOT_INTENT_POLYLINEDIMENSION,
|
||||
HPDF_ANNOT_INTENT_POLYGONDIMENSION
|
||||
} HPDF_AnnotIntent;
|
||||
|
||||
typedef enum _HPDF_LineAnnotEndingStyle {
|
||||
HPDF_LINE_ANNOT_NONE = 0,
|
||||
HPDF_LINE_ANNOT_SQUARE,
|
||||
HPDF_LINE_ANNOT_CIRCLE,
|
||||
HPDF_LINE_ANNOT_DIAMOND,
|
||||
HPDF_LINE_ANNOT_OPENARROW,
|
||||
HPDF_LINE_ANNOT_CLOSEDARROW,
|
||||
HPDF_LINE_ANNOT_BUTT,
|
||||
HPDF_LINE_ANNOT_ROPENARROW,
|
||||
HPDF_LINE_ANNOT_RCLOSEDARROW,
|
||||
HPDF_LINE_ANNOT_SLASH
|
||||
} HPDF_LineAnnotEndingStyle;
|
||||
|
||||
typedef enum _HPDF_LineAnnotCapPosition{
|
||||
HPDF_LINE_ANNOT_CAP_INLINE = 0,
|
||||
HPDF_LINE_ANNOT_CAP_TOP
|
||||
} HPDF_LineAnnotCapPosition;
|
||||
|
||||
typedef enum _HPDF_StampAnnotName{
|
||||
HPDF_STAMP_ANNOT_APPROVED = 0,
|
||||
HPDF_STAMP_ANNOT_EXPERIMENTAL,
|
||||
HPDF_STAMP_ANNOT_NOTAPPROVED,
|
||||
HPDF_STAMP_ANNOT_ASIS,
|
||||
HPDF_STAMP_ANNOT_EXPIRED,
|
||||
HPDF_STAMP_ANNOT_NOTFORPUBLICRELEASE,
|
||||
HPDF_STAMP_ANNOT_CONFIDENTIAL,
|
||||
HPDF_STAMP_ANNOT_FINAL,
|
||||
HPDF_STAMP_ANNOT_SOLD,
|
||||
HPDF_STAMP_ANNOT_DEPARTMENTAL,
|
||||
HPDF_STAMP_ANNOT_FORCOMMENT,
|
||||
HPDF_STAMP_ANNOT_TOPSECRET,
|
||||
HPDF_STAMP_ANNOT_DRAFT,
|
||||
HPDF_STAMP_ANNOT_FORPUBLICRELEASE
|
||||
} HPDF_StampAnnotName;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*------ border stype --------------------------------------------------------*/
|
||||
@ -430,7 +499,7 @@ typedef enum _HPDF_TransitionStyle {
|
||||
HPDF_TS_GLITTER_TOP_LEFT_TO_BOTTOM_RIGHT,
|
||||
HPDF_TS_REPLACE,
|
||||
HPDF_TS_EOF
|
||||
} HPDF_TransitionStyle;
|
||||
} HPDF_TransitionStyle;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
@ -480,6 +549,14 @@ typedef enum _HPDF_TextAlignment {
|
||||
HPDF_TALIGN_JUSTIFY
|
||||
} HPDF_TextAlignment;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Name Dictionary values -- see PDF reference section 7.7.4 */
|
||||
typedef enum _HPDF_NameDictKey {
|
||||
HPDF_NAME_EMBEDDED_FILES = 0, /* TODO the rest */
|
||||
HPDF_NAME_EOF
|
||||
} HPDF_NameDictKey;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
53
PDF/include/Poco/PDF/hpdf_u3d.h
Normal file
53
PDF/include/Poco/PDF/hpdf_u3d.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_u3d.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPDF_U3D_H
|
||||
#define _HPDF_U3D_H
|
||||
|
||||
#include "hpdf_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *code);
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename);
|
||||
HPDF_EXPORT(HPDF_Image) HPDF_LoadU3DFromMem (HPDF_Doc pdf, const HPDF_BYTE *buffer, HPDF_UINT size);
|
||||
HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_AddOnInstanciate(HPDF_U3D u3d, HPDF_JavaScript javaScript);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, const char *name, HPDF_REAL opacity, HPDF_BOOL visible);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *scheme);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetPerspectiveProjection(HPDF_Dict view, HPDF_REAL fov);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetOrthogonalProjection(HPDF_Dict view, HPDF_REAL mag);
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, HPDF_REAL cooy, HPDF_REAL cooz, HPDF_REAL c2cx, HPDF_REAL c2cy, HPDF_REAL c2cz, HPDF_REAL roo, HPDF_REAL roll);
|
||||
|
||||
HPDF_Dict
|
||||
HPDF_3DView_New ( HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_U3D u3d,
|
||||
const char *name);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _HPDF_U3D_H */
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- fpdf_utils.h
|
||||
* << Haru Free PDF Library >> -- fpdf_utils.h
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -15,6 +18,7 @@
|
||||
#ifndef _HPDF_UTILS_H
|
||||
#define _HPDF_UTILS_H
|
||||
|
||||
#include "hpdf_config.h"
|
||||
#include "hpdf_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -114,7 +118,7 @@ HPDF_UInt16Swap (HPDF_UINT16 *value);
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define HPDF_NEEDS_ESCAPE(c) (c < 0x21 || \
|
||||
#define HPDF_NEEDS_ESCAPE(c) (c < 0x20 || \
|
||||
c > 0x7e || \
|
||||
c == '\\' || \
|
||||
c == '%' || \
|
||||
@ -139,11 +143,11 @@ HPDF_UInt16Swap (HPDF_UINT16 *value);
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*----- macros for debug -----------------------------------------------------*/
|
||||
|
||||
#ifdef HPDF_DEBUG
|
||||
#ifdef LIBHPDF_DEBUG_TRACE
|
||||
#ifndef HPDF_PTRACE_ON
|
||||
#define HPDF_PTRACE_ON
|
||||
#endif /* HPDF_PTRACE_ON */
|
||||
#endif /* HPDF_DEBUG */
|
||||
#endif /* LIBHPDF_DEBUG_TRACE */
|
||||
|
||||
#ifdef HPDF_PTRACE_ON
|
||||
#define HPDF_PTRACE(ARGS) HPDF_PRINTF ARGS
|
||||
@ -151,7 +155,7 @@ HPDF_UInt16Swap (HPDF_UINT16 *value);
|
||||
#define HPDF_PTRACE(ARGS) /* do nothing */
|
||||
#endif /* HPDF_PTRACE */
|
||||
|
||||
#ifdef HPDF_DEBUG
|
||||
#ifdef LIBHPDF_DEBUG
|
||||
#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) HPDF_PrintBinary(BUF, LEN, CAPTION)
|
||||
#else
|
||||
#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) /* do nothing */
|
||||
|
8
PDF/include/Poco/PDF/hpdf_version.h
Normal file
8
PDF/include/Poco/PDF/hpdf_version.h
Normal file
@ -0,0 +1,8 @@
|
||||
/* automatically generated by configure */
|
||||
/* edit configure.in to change version number */
|
||||
#define HPDF_MAJOR_VERSION 2
|
||||
#define HPDF_MINOR_VERSION 3
|
||||
#define HPDF_BUGFIX_VERSION 0
|
||||
#define HPDF_EXTRA_VERSION "RC2"
|
||||
#define HPDF_VERSION_TEXT "2.3.0RC2"
|
||||
#define HPDF_VERSION_ID 20300
|
@ -400,7 +400,7 @@
|
||||
#define PNG_LIBPNG_BUILD_RC 3
|
||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
||||
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
|
||||
|
||||
|
||||
/* Release-Specific Flags */
|
||||
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with
|
||||
PNG_LIBPNG_BUILD_STABLE only */
|
||||
@ -431,12 +431,12 @@
|
||||
/* Ref MSDN: Private as priority over Special
|
||||
* VS_FF_PRIVATEBUILD File *was not* built using standard release
|
||||
* procedures. If this value is given, the StringFileInfo block must
|
||||
* contain a PrivateBuild string.
|
||||
* contain a PrivateBuild string.
|
||||
*
|
||||
* VS_FF_SPECIALBUILD File *was* built by the original company using
|
||||
* standard release procedures but is a variation of the standard
|
||||
* file of the same version number. If this value is given, the
|
||||
* StringFileInfo block must contain a SpecialBuild string.
|
||||
* StringFileInfo block must contain a SpecialBuild string.
|
||||
*/
|
||||
|
||||
#if defined(PNG_USER_PRIVATEBUILD)
|
||||
@ -911,7 +911,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* The sCAL chunk describes the actual physical dimensions of the
|
||||
* subject matter of the graphic. The chunk contains a unit specification
|
||||
* a byte value, and two ASCII strings representing floating-point
|
||||
* values. The values are width and height corresponding to one pixel
|
||||
* values. The values are width and height corresponsing to one pixel
|
||||
* in the image. This external representation is converted to double
|
||||
* here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero.
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#define PNG_1_2_X
|
||||
|
||||
/*
|
||||
/*
|
||||
* PNG_USER_CONFIG has to be defined on the compiler command line. This
|
||||
* includes the resource compiler for Windows DLL configurations.
|
||||
*/
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
/*
|
||||
* Added at libpng-1.2.8
|
||||
*
|
||||
*
|
||||
* If you create a private DLL you need to define in "pngusr.h" the followings:
|
||||
* #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
|
||||
* the DLL was built>
|
||||
@ -50,8 +50,8 @@
|
||||
* number and must match your private DLL name>
|
||||
* e.g. // private DLL "libpng13gx.dll"
|
||||
* #define PNG_USER_DLLFNAME_POSTFIX "gx"
|
||||
*
|
||||
* The following macros are also at your disposal if you want to complete the
|
||||
*
|
||||
* The following macros are also at your disposal if you want to complete the
|
||||
* DLL VERSIONINFO structure.
|
||||
* - PNG_USER_VERSIONINFO_COMMENTS
|
||||
* - PNG_USER_VERSIONINFO_COMPANYNAME
|
||||
@ -147,9 +147,9 @@
|
||||
* 'Cygwin' defines/defaults:
|
||||
* PNG_BUILD_DLL -- (ignored) building the dll
|
||||
* (no define) -- (ignored) building an application, linking to the dll
|
||||
* PNG_STATIC -- (ignored) building the static lib, or building an
|
||||
* PNG_STATIC -- (ignored) building the static lib, or building an
|
||||
* application that links to the static lib.
|
||||
* ALL_STATIC -- (ignored) building various static libs, or building an
|
||||
* ALL_STATIC -- (ignored) building various static libs, or building an
|
||||
* application that links to the static libs.
|
||||
* Thus,
|
||||
* a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
|
||||
@ -162,12 +162,12 @@
|
||||
* PNG_BUILD_DLL
|
||||
* PNG_STATIC
|
||||
* (nothing) == PNG_USE_DLL
|
||||
*
|
||||
*
|
||||
* CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
|
||||
* of auto-import in binutils, we no longer need to worry about
|
||||
* of auto-import in binutils, we no longer need to worry about
|
||||
* __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
|
||||
* we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
|
||||
* to __declspec() stuff. However, we DO need to worry about
|
||||
* to __declspec() stuff. However, we DO need to worry about
|
||||
* PNG_BUILD_DLL and PNG_STATIC because those change some defaults
|
||||
* such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
|
||||
*/
|
||||
@ -211,8 +211,8 @@
|
||||
# if !defined(PNG_DLL)
|
||||
# define PNG_DLL
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -731,7 +731,7 @@
|
||||
# define PNG_EASY_ACCESS_SUPPORTED
|
||||
#endif
|
||||
|
||||
/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
|
||||
/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
|
||||
* and removed from version 1.2.20. The following will be removed
|
||||
* from libpng-1.4.0
|
||||
*/
|
||||
@ -829,7 +829,7 @@
|
||||
*/
|
||||
|
||||
/* Any chunks you are not interested in, you can undef here. The
|
||||
* ones that allocate memory may be especially important (hIST,
|
||||
* ones that allocate memory may be expecially important (hIST,
|
||||
* tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
|
||||
* a bit smaller.
|
||||
*/
|
||||
@ -1306,7 +1306,7 @@ typedef z_stream FAR * png_zstreamp;
|
||||
# define PNGAPI __cdecl
|
||||
# undef PNG_IMPEXP
|
||||
# define PNG_IMPEXP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
|
||||
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
|
||||
|
BIN
PDF/samples/Image/Image.pdf
Normal file
BIN
PDF/samples/Image/Image.pdf
Normal file
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
vc.project.guid = ${vc.project.guidFromName}
|
||||
vc.project.name = ${vc.project.baseName}
|
||||
vc.project.target = ${vc.project.name}
|
||||
vc.project.type = executable
|
||||
vc.project.pocobase = ..\\..\\..
|
||||
vc.project.platforms = Win32, x64
|
||||
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
|
||||
vc.project.prototype = ${vc.project.name}_vs90.vcproj
|
||||
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\PDF\\include
|
||||
vc.project.linker.dependencies =
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{3e187bb0-1d2b-4a01-ba2b-3675ce2c1c84}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{2e38e39e-14e5-4544-be3f-1903c2fa8fa5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{98c2cbaf-7e65-4bce-add0-cc6b755fd70e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{d4825186-6266-4146-9a77-b4fb64b2d0ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{3e187bb0-1d2b-4a01-ba2b-3675ce2c1c84}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{2e38e39e-14e5-4544-be3f-1903c2fa8fa5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{98c2cbaf-7e65-4bce-add0-cc6b755fd70e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{d4825186-6266-4146-9a77-b4fb64b2d0ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{04d30b11-8aca-41d2-92dc-bdd1e46f2d2e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{77c73edd-e907-4bfa-9faa-ea733f5f76d9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{caa26a08-07f7-41eb-b223-2d2aa5e686f8}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0531a35b-9ad3-4753-aded-84ca49e9d694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{04d30b11-8aca-41d2-92dc-bdd1e46f2d2e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{77c73edd-e907-4bfa-9faa-ea733f5f76d9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{caa26a08-07f7-41eb-b223-2d2aa5e686f8}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0531a35b-9ad3-4753-aded-84ca49e9d694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,16 +1,13 @@
|
||||
//
|
||||
// Image.cpp
|
||||
//
|
||||
// This sample demonstrates the Data library.
|
||||
// This sample demonstrates the generation and saving of a PDF
|
||||
// document that contains an mbedded image loaded from external file.
|
||||
//
|
||||
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// This is unpublished proprietary source code of Applied Informatics
|
||||
// Software Engineering GmbH.
|
||||
// The contents of this pdfFile may not be disclosed to third parties,
|
||||
// copied or duplicated in any form, in whole or in part, without
|
||||
// prior written permission from Applied Informatics.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
#include "Poco/PDF/Document.h"
|
||||
|
BIN
PDF/samples/Text/DejaVuLGCSans.ttf
Normal file
BIN
PDF/samples/Text/DejaVuLGCSans.ttf
Normal file
Binary file not shown.
BIN
PDF/samples/Text/Text.pdf
Normal file
BIN
PDF/samples/Text/Text.pdf
Normal file
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
vc.project.guid = ${vc.project.guidFromName}
|
||||
vc.project.name = ${vc.project.baseName}
|
||||
vc.project.target = ${vc.project.name}
|
||||
vc.project.type = executable
|
||||
vc.project.pocobase = ..\\..\\..
|
||||
vc.project.platforms = Win32, x64
|
||||
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
|
||||
vc.project.prototype = ${vc.project.name}_vs90.vcproj
|
||||
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\PDF\\include
|
||||
vc.project.linker.dependencies =
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{c3ea6789-01d4-4bcf-9fe7-c011c458e565}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{4c4db3d3-ea83-4452-8c9f-b73ebbafe843}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{6f12f7ad-3ab0-4ce8-b573-8c77781dff88}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{31d158d4-1a35-4d7a-a9eb-1447d82290f6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{c3ea6789-01d4-4bcf-9fe7-c011c458e565}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{4c4db3d3-ea83-4452-8c9f-b73ebbafe843}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{6f12f7ad-3ab0-4ce8-b573-8c77781dff88}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{31d158d4-1a35-4d7a-a9eb-1447d82290f6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{e9f525fd-6b5c-4c75-b127-151e5723b951}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{03d7e5f2-118d-4ff0-ae9a-8ea1c05b9580}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{a4fb5caa-2dbd-481c-bade-9b11ea193129}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{fa61639f-1a64-4692-b040-e61923e163cf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{e9f525fd-6b5c-4c75-b127-151e5723b951}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{03d7e5f2-118d-4ff0-ae9a-8ea1c05b9580}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{a4fb5caa-2dbd-481c-bade-9b11ea193129}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{fa61639f-1a64-4692-b040-e61923e163cf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,16 +1,12 @@
|
||||
//
|
||||
// Text.cpp
|
||||
//
|
||||
// This sample demonstrates the Data library.
|
||||
// This sample demonstrates the generation and saving of a text PDF
|
||||
// document, using external TTF font and UTF-8 encoding.
|
||||
//
|
||||
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// This is unpublished proprietary source code of Applied Informatics
|
||||
// Software Engineering GmbH.
|
||||
// The contents of this file may not be disclosed to third parties,
|
||||
// copied or duplicated in any form, in whole or in part, without
|
||||
// prior written permission from Applied Informatics.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
#include "Poco/PDF/Document.h"
|
||||
@ -39,13 +35,16 @@ int main(int argc, char** argv)
|
||||
|
||||
Document document(file.path());
|
||||
|
||||
Font helv = document.font("Helvetica");
|
||||
Font font = document.font(document.loadTTFont("DejaVuLGCSans.ttf", true), "UTF-8");
|
||||
Page page = document[0];
|
||||
page.setFont(helv, 24);
|
||||
page.setFont(font, 24);
|
||||
std::string hello = "Hello PDF World from C++ Portable Components";
|
||||
float tw = page.textWidth(hello);
|
||||
page.writeOnce((page.getWidth() - tw) / 2, page.getHeight() - 50, hello);
|
||||
|
||||
page.setFont(font, 14);
|
||||
hello = "~ Courtesy of G\xC3\xBCnter Obiltschnig & Aleksandar Fabijani\xC4\x87 ~";
|
||||
tw = page.textWidth(hello);
|
||||
page.writeOnce((page.getWidth() - tw) / 2, page.getHeight() - 100, hello);
|
||||
document.save();
|
||||
return 0;
|
||||
}
|
||||
|
34
PDF/samples/build.gradle
Normal file
34
PDF/samples/build.gradle
Normal file
@ -0,0 +1,34 @@
|
||||
model {
|
||||
components {
|
||||
Image(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'Image/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':PDF', library: 'PDF'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
Text(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'Image/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':PDF', library: 'PDF'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'static'
|
||||
}
|
||||
withType(NativeExecutableSpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'static'
|
||||
}
|
||||
}
|
||||
}
|
||||
task samples { dependsOn "assemble" }
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
vc.project.platforms = Win32, x64
|
||||
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
|
||||
vc.solution.create = true
|
||||
vc.solution.include = \
|
||||
Image\\Image;\
|
||||
Text\\Text;
|
@ -21,7 +21,7 @@ namespace PDF {
|
||||
|
||||
Destination::Destination(HPDF_Doc* pPDF,
|
||||
const HPDF_Destination& destination,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Destination>(pPDF, destination, name)
|
||||
{
|
||||
}
|
||||
|
@ -30,28 +30,24 @@ namespace PDF {
|
||||
Document::Document(const std::string fileName,
|
||||
Poco::UInt32 pageCount,
|
||||
Page::Size pageSize,
|
||||
Page::Orientation orientation):
|
||||
Page::Orientation orientation):
|
||||
_pdf(HPDF_New(HPDF_Error_Handler, 0)),
|
||||
_fileName(fileName),
|
||||
_pRawData(0),
|
||||
_size(0)
|
||||
{
|
||||
compression(COMPRESSION_ALL);
|
||||
for (Poco::UInt32 i = 0; i < pageCount; ++i)
|
||||
addPage(pageSize, orientation);
|
||||
init(pageCount, pageSize, orientation);
|
||||
}
|
||||
|
||||
|
||||
Document::Document(Poco::UInt32 pageCount,
|
||||
Page::Size pageSize,
|
||||
Page::Orientation orientation):
|
||||
Page::Orientation orientation):
|
||||
_pdf(HPDF_New(HPDF_Error_Handler, 0)),
|
||||
_pRawData(0),
|
||||
_size(0)
|
||||
{
|
||||
compression(COMPRESSION_ALL);
|
||||
for (Poco::UInt32 i = 0; i < pageCount; ++i)
|
||||
addPage();
|
||||
init(pageCount, pageSize, orientation);
|
||||
}
|
||||
|
||||
|
||||
@ -62,6 +58,16 @@ Document::~Document()
|
||||
}
|
||||
|
||||
|
||||
void Document::init(Poco::UInt32 pageCount,
|
||||
Page::Size pageSize, Page::Orientation orientation)
|
||||
{
|
||||
useUTF8Encoding();
|
||||
compression(COMPRESSION_ALL);
|
||||
for (Poco::UInt32 i = 0; i < pageCount; ++i)
|
||||
addPage(pageSize, orientation);
|
||||
}
|
||||
|
||||
|
||||
void Document::createNew(bool resetAll)
|
||||
{
|
||||
reset(resetAll);
|
||||
@ -99,7 +105,7 @@ Document::SizeType Document::size()
|
||||
|
||||
const Page& Document::addPage(Page::Size pageSize, Page::Orientation orientation)
|
||||
{
|
||||
Page page(&_pdf, HPDF_AddPage(_pdf), pageSize);
|
||||
Page page(this, HPDF_AddPage(_pdf), pageSize);
|
||||
page.setSizeAndOrientation(pageSize, orientation);
|
||||
_pages.push_back(page);
|
||||
return _pages.back();
|
||||
@ -114,7 +120,7 @@ const Page& Document::insertPage(int index,
|
||||
poco_assert (index < _pages.size());
|
||||
HPDF_Page target = *((HPDF_Page*) HPDF_List_ItemAt(_pdf->page_list, static_cast<HPDF_UINT>(index)));
|
||||
return *_pages.insert(_pages.begin() + index,
|
||||
Page(&_pdf,
|
||||
Page(this,
|
||||
HPDF_InsertPage(_pdf, target),
|
||||
pageSize,
|
||||
orientation));
|
||||
@ -123,7 +129,7 @@ const Page& Document::insertPage(int index,
|
||||
|
||||
const Page& Document::getCurrentPage()
|
||||
{
|
||||
Page p(&_pdf, HPDF_GetCurrentPage(_pdf));
|
||||
Page p(this, HPDF_GetCurrentPage(_pdf));
|
||||
PageContainer::iterator it = _pages.begin();
|
||||
PageContainer::iterator end = _pages.end();
|
||||
for (;it != end; ++it)
|
||||
@ -136,7 +142,7 @@ const Page& Document::getCurrentPage()
|
||||
const Font& Document::loadFont(const std::string& name, const std::string& encoding)
|
||||
{
|
||||
Font font(&_pdf, HPDF_GetFont(_pdf, name.c_str(), encoding.empty() ? 0 : encoding.c_str()));
|
||||
std::pair<FontContainer::iterator, bool> ret =
|
||||
std::pair<FontContainer::iterator, bool> ret =
|
||||
_fonts.insert(FontContainer::value_type(name, font));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@ -149,7 +155,7 @@ const Font& Document::font(const std::string& name, const std::string& encoding)
|
||||
{
|
||||
FontContainer::iterator it = _fonts.find(name);
|
||||
if (_fonts.end() != it) return it->second;
|
||||
|
||||
|
||||
return loadFont(name, encoding);
|
||||
}
|
||||
|
||||
@ -160,20 +166,20 @@ std::string Document::loadType1Font(const std::string& afmFileName, const std::s
|
||||
}
|
||||
|
||||
|
||||
std::string Document::loadTTFont(const std::string& fileName, bool embedding, int index)
|
||||
std::string Document::loadTTFont(const std::string& fileName, bool embed, int index)
|
||||
{
|
||||
if (-1 == index)
|
||||
{
|
||||
return HPDF_LoadTTFontFromFile(_pdf,
|
||||
fileName.c_str(),
|
||||
embedding ? HPDF_TRUE : HPDF_FALSE);
|
||||
embed ? HPDF_TRUE : HPDF_FALSE);
|
||||
}
|
||||
else if (index >= 0)
|
||||
{
|
||||
return HPDF_LoadTTFontFromFile2(_pdf,
|
||||
fileName.c_str(),
|
||||
static_cast<HPDF_UINT>(index),
|
||||
embedding ? HPDF_TRUE : HPDF_FALSE);
|
||||
return HPDF_LoadTTFontFromFile2(_pdf,
|
||||
fileName.c_str(),
|
||||
static_cast<HPDF_UINT>(index),
|
||||
embed ? HPDF_TRUE : HPDF_FALSE);
|
||||
}
|
||||
else
|
||||
throw InvalidArgumentException("Invalid font index.");
|
||||
@ -200,7 +206,7 @@ const Image& Document::loadPNGImageImpl(const std::string& fileName, bool doLoad
|
||||
if (it.second) return it.first->second;
|
||||
else throw IllegalStateException("Could not insert image.");
|
||||
}
|
||||
else
|
||||
else
|
||||
throw NotFoundException("File not found: " + fileName);
|
||||
}
|
||||
|
||||
@ -217,7 +223,7 @@ const Image& Document::loadJPEGImage(const std::string& fileName)
|
||||
if (it.second) return it.first->second;
|
||||
else throw IllegalStateException("Could not insert image.");
|
||||
}
|
||||
else
|
||||
else
|
||||
throw NotFoundException("File not found: " + fileName);
|
||||
}
|
||||
|
||||
@ -239,7 +245,7 @@ const Encoder& Document::loadEncoder(const std::string& name)
|
||||
if (_encoders.end() == it) return it->second;
|
||||
|
||||
Encoder enc(&_pdf, HPDF_GetEncoder(_pdf, name.c_str()), name);
|
||||
std::pair<EncoderContainer::iterator, bool> ret =
|
||||
std::pair<EncoderContainer::iterator, bool> ret =
|
||||
_encoders.insert(EncoderContainer::value_type(name, enc));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
|
@ -21,7 +21,7 @@ namespace PDF {
|
||||
|
||||
Encoder::Encoder(HPDF_Doc* pPDF,
|
||||
const HPDF_Encoder& encoder,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Encoder>(pPDF, encoder, name)
|
||||
{
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Font::Font(HPDF_Doc* pPDF, const HPDF_Font& font):
|
||||
Font::Font(HPDF_Doc* pPDF, const HPDF_Font& font):
|
||||
Resource<HPDF_Font>(pPDF, font, HPDF_Font_GetFontName(font))
|
||||
{
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Image::Image(HPDF_Doc* pPDF, const HPDF_Image& resource, const std::string& name):
|
||||
Image::Image(HPDF_Doc* pPDF, const HPDF_Image& resource, const std::string& name):
|
||||
Resource<HPDF_Image>(pPDF, resource, name)
|
||||
{
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace PDF {
|
||||
|
||||
LinkAnnotation::LinkAnnotation(HPDF_Doc* pPDF,
|
||||
const HPDF_Annotation& annotation,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Annotation>(pPDF, annotation, name)
|
||||
{
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Outline::Outline(HPDF_Doc* pPDF, const HPDF_Outline& outline, const std::string& name):
|
||||
Outline::Outline(HPDF_Doc* pPDF, const HPDF_Outline& outline, const std::string& name):
|
||||
Resource<HPDF_Outline>(pPDF, outline, name)
|
||||
{
|
||||
open();
|
||||
|
@ -26,20 +26,20 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
{
|
||||
switch (error_no)
|
||||
{
|
||||
case HPDF_ARRAY_COUNT_ERR:
|
||||
case HPDF_ARRAY_COUNT_ERR:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_ARRAY_ITEM_NOT_FOUND:
|
||||
case HPDF_ARRAY_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_ARRAY_ITEM_UNEXPECTED_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_BINARY_LENGTH_ERR:
|
||||
throw InvalidArgumentException("The length of the data exceeds HPDF_LIMIT_MAX_STRING_LEN.");
|
||||
case HPDF_CANNOT_GET_PALLET:
|
||||
throw NotFoundException("Cannot get a pallet data from PNG image.");
|
||||
throw NotFoundException("Cannot get a pallet data from PNG image.");
|
||||
case HPDF_DICT_COUNT_ERR:
|
||||
throw InvalidArgumentException("The count of elements of a dictionary exceeds HPDF_LIMIT_MAX_DICT_ELEMENT");
|
||||
case HPDF_DICT_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DICT_ITEM_UNEXPECTED_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DICT_STREAM_LENGTH_NOT_FOUND:
|
||||
@ -47,7 +47,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_DOC_ENCRYPTDICT_NOT_FOUND:
|
||||
throw NotFoundException("HPDF_SetPermission() OR HPDF_SetEncryptMode() was called before a password is set.");
|
||||
case HPDF_DOC_INVALID_OBJECT:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DUPLICATE_REGISTRATION:
|
||||
throw IllegalStateException("Tried to register a font that has been registered.");
|
||||
case HPDF_EXCEED_JWW_CODE_NUM_LIMIT:
|
||||
@ -55,7 +55,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_ENCRYPT_INVALID_PASSWORD:
|
||||
throw IllegalStateException("Tried to set the owner password to NULL.");
|
||||
case HPDF_ERR_UNKNOWN_CLASS:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_EXCEED_GSTATE_LIMIT:
|
||||
throw IllegalStateException("The depth of the stack exceeded HPDF_LIMIT_MAX_GSTATE.");
|
||||
case HPDF_FAILD_TO_ALLOC_MEM:
|
||||
@ -65,13 +65,13 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_FILE_OPEN_ERROR:
|
||||
throw IOException("Cannot open a file. (A detailed code is set.)");
|
||||
case HPDF_FONT_EXISTS:
|
||||
throw IllegalStateException("Tried to load a font that has been registered.");
|
||||
throw IllegalStateException("Tried to load a font that has been registered.");
|
||||
case HPDF_FONT_INVALID_WIDTHS_TABLE:
|
||||
throw IllegalStateException("The format of a font-file is invalid. Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("The format of a font-file is invalid. Internal error. The consistency of the data was lost.");
|
||||
case HPDF_INVALID_AFM_HEADER:
|
||||
throw IllegalStateException("Cannot recognize a header of an afm file.");
|
||||
case HPDF_INVALID_ANNOTATION:
|
||||
throw IllegalStateException("The specified annotation handle is invalid.");
|
||||
throw IllegalStateException("The specified annotation handle is invalid.");
|
||||
case HPDF_INVALID_BIT_PER_COMPONENT:
|
||||
throw IllegalStateException("Bit-per-component of a image which was set as mask-image is invalid.");
|
||||
case HPDF_INVALID_CHAR_MATRICS_DATA:
|
||||
@ -79,11 +79,11 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_COLOR_SPACE:
|
||||
switch (detail_no)
|
||||
{
|
||||
case 1:
|
||||
case 1:
|
||||
throw InvalidArgumentException("The color_space parameter of HPDF_LoadRawImage is invalid.");
|
||||
case 2:
|
||||
case 2:
|
||||
throw InvalidArgumentException("Color-space of a image which was set as mask-image is invalid.");
|
||||
case 3:
|
||||
case 3:
|
||||
throw InvalidArgumentException("The function which is invalid in the present color-space was invoked.");
|
||||
default:
|
||||
throw PDFException();
|
||||
@ -109,7 +109,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_FONTDEF_DATA:
|
||||
switch (detail_no)
|
||||
{
|
||||
case 1:
|
||||
case 1:
|
||||
throw InvalidArgumentException("An invalid font handle was set.");
|
||||
case 2:
|
||||
throw InvalidArgumentException("Unsupported font format.");
|
||||
@ -131,7 +131,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
{
|
||||
case 1:
|
||||
throw IllegalStateException("An invalid object is set.");
|
||||
case 2:
|
||||
case 2:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
default:
|
||||
throw PDFException();
|
||||
@ -167,15 +167,15 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_WX_DATA:
|
||||
throw IOException("Cannot read a width-data from an afm file.");
|
||||
case HPDF_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_LIBPNG_ERROR:
|
||||
throw IOException("An error has returned from PNGLIB while loading an image.");
|
||||
case HPDF_NAME_INVALID_VALUE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_NAME_OUT_OF_RANGE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGES_MISSING_KIDS_ENTRY:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGE_CANNOT_FIND_OBJECT:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGE_CANNOT_GET_ROOT_PAGES:
|
||||
@ -197,7 +197,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_PAGE_INVALID_ROTATE_VALUE:
|
||||
throw InvalidArgumentException("The specified value is not a multiple of 90.");
|
||||
case HPDF_PAGE_INVALID_SIZE:
|
||||
throw InvalidArgumentException("An invalid page-size was set.");
|
||||
throw InvalidArgumentException("An invalid page-size was set.");
|
||||
case HPDF_PAGE_INVALID_XOBJECT:
|
||||
throw InvalidArgumentException("An invalid image-handle was set.");
|
||||
case HPDF_PAGE_OUT_OF_RANGE:
|
||||
@ -219,7 +219,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_TTF_INVALID_FOMAT:
|
||||
throw InvalidArgumentException("Unsupported ttf format.");
|
||||
case HPDF_TTF_MISSING_TABLE:
|
||||
throw InvalidArgumentException("Unsupported ttf format. (cannot find a necessary table)");
|
||||
throw InvalidArgumentException("Unsupported ttf format. (cannot find a necessary table)");
|
||||
case HPDF_UNSUPPORTED_FONT_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_UNSUPPORTED_FUNC:
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
|
||||
#include "Poco/PDF/Page.h"
|
||||
#include "Poco/PDF/Document.h"
|
||||
#include "Poco/PDF/PDFException.h"
|
||||
#undef min
|
||||
#undef max
|
||||
@ -23,24 +24,25 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Page::Page(HPDF_Doc* pPDF,
|
||||
Page::Page(Document* pDocument,
|
||||
const HPDF_Page& page,
|
||||
Size pageSize,
|
||||
Orientation orientation):
|
||||
_pPDF(pPDF),
|
||||
_page(page),
|
||||
_size(pageSize),
|
||||
_orientation(orientation),
|
||||
_pCurrentFont(0)
|
||||
_pDocument(pDocument),
|
||||
_page(page),
|
||||
_size(pageSize),
|
||||
_orientation(orientation),
|
||||
_pCurrentFont(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Page::Page(const Page& other):
|
||||
_pPDF(other._pPDF),
|
||||
_pDocument(other._pDocument),
|
||||
_page(other._page),
|
||||
_size(other._size),
|
||||
_orientation(other._orientation)
|
||||
_orientation(other._orientation),
|
||||
_pCurrentFont(other._pCurrentFont ? new Font(*other._pCurrentFont) : (Font*)0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -58,14 +60,21 @@ Page& Page::operator = (const Page& page)
|
||||
}
|
||||
|
||||
|
||||
bool Page::operator == (const Page& other) const
|
||||
{
|
||||
return &_pDocument->handle() == &other._pDocument->handle() && _page == other._page;
|
||||
}
|
||||
|
||||
|
||||
void Page::swap(Page& other)
|
||||
{
|
||||
using std::swap;
|
||||
|
||||
swap(_pPDF, other._pPDF);
|
||||
|
||||
swap(_pDocument, other._pDocument);
|
||||
swap(_page, other._page);
|
||||
swap(_size, other._size);
|
||||
swap(_orientation, other._orientation);
|
||||
swap(_pCurrentFont, other._pCurrentFont);
|
||||
}
|
||||
|
||||
|
||||
@ -97,6 +106,25 @@ float Page::textWidth(const std::string& text)
|
||||
}
|
||||
|
||||
|
||||
void Page::setFont(const std::string& name, float size, const std::string& encoding)
|
||||
{
|
||||
setFont(_pDocument->font(name, encoding), size);
|
||||
}
|
||||
|
||||
|
||||
void Page::setTTFont(const std::string& name, float size, const std::string& encoding, bool embed)
|
||||
{
|
||||
setFont(_pDocument->font(_pDocument->loadTTFont(name, embed), encoding), size);
|
||||
}
|
||||
|
||||
|
||||
const Font& Page::getFont() const
|
||||
{
|
||||
delete _pCurrentFont;
|
||||
return *(_pCurrentFont = new Font(&_pDocument->handle(), HPDF_Page_GetCurrentFont(_page)));
|
||||
}
|
||||
|
||||
|
||||
void Page::setRotation(int angle)
|
||||
{
|
||||
if (0 != angle % 90 || angle > std::numeric_limits<HPDF_UINT16>::max())
|
||||
@ -109,11 +137,11 @@ void Page::setRotation(int angle)
|
||||
const Destination& Page::createDestination(const std::string& name)
|
||||
{
|
||||
DestinationContainer::iterator it = _destinations.find(name);
|
||||
if (_destinations.end() != it)
|
||||
if (_destinations.end() != it)
|
||||
throw InvalidArgumentException("Destination already exists.");
|
||||
|
||||
Destination dest(_pPDF, HPDF_Page_CreateDestination(_page), name);
|
||||
std::pair<DestinationContainer::iterator, bool> ret =
|
||||
Destination dest(&_pDocument->handle(), HPDF_Page_CreateDestination(_page), name);
|
||||
std::pair<DestinationContainer::iterator, bool> ret =
|
||||
_destinations.insert(DestinationContainer::value_type(name, dest));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@ -122,20 +150,20 @@ const Destination& Page::createDestination(const std::string& name)
|
||||
}
|
||||
|
||||
|
||||
const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& text,
|
||||
const Encoder& encoder)
|
||||
{
|
||||
TextAnnotationContainer::iterator it = _textAnnotations.find(name);
|
||||
if (_textAnnotations.end() != it)
|
||||
if (_textAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
TextAnnotation ann(_pPDF,
|
||||
TextAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateTextAnnot(_page, rect, text.c_str(), encoder),
|
||||
name);
|
||||
|
||||
std::pair<TextAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<TextAnnotationContainer::iterator, bool> ret =
|
||||
_textAnnotations.insert(TextAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@ -144,18 +172,18 @@ const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
}
|
||||
|
||||
|
||||
const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const Destination& dest)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() != it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(_pPDF,
|
||||
LinkAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateLinkAnnot(_page, rect, dest),
|
||||
name);
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
_linkAnnotations.insert(LinkAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@ -164,18 +192,18 @@ const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
}
|
||||
|
||||
|
||||
const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& uri)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() != it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(_pPDF,
|
||||
LinkAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateURILinkAnnot(_page, rect, uri.c_str()),
|
||||
name);
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
_linkAnnotations.insert(LinkAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
|
@ -22,7 +22,7 @@ namespace PDF {
|
||||
|
||||
TextAnnotation::TextAnnotation(HPDF_Doc* pPDF,
|
||||
const HPDF_Annotation& annotation,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Annotation>(pPDF, annotation, name)
|
||||
{
|
||||
open();
|
||||
|
@ -256,7 +256,7 @@ int ZEXPORT gzsetparams (file, level, strategy)
|
||||
/* ===========================================================================
|
||||
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
|
||||
for end of file.
|
||||
IN assertion: the stream s has been successfully opened for reading.
|
||||
IN assertion: the stream s has been sucessfully opened for reading.
|
||||
*/
|
||||
local int get_byte(s)
|
||||
gz_stream *s;
|
||||
@ -281,7 +281,7 @@ local int get_byte(s)
|
||||
mode to transparent if the gzip magic header is not present; set s->err
|
||||
to Z_DATA_ERROR if the magic header is present but the rest of the header
|
||||
is incorrect.
|
||||
IN assertion: the stream s has already been created successfully;
|
||||
IN assertion: the stream s has already been created sucessfully;
|
||||
s->stream.avail_in is zero for the first time, but may be non-zero
|
||||
for concatenated .gz files.
|
||||
*/
|
||||
|
235
PDF/src/hpdf_3dmeasure.c
Normal file
235
PDF/src/hpdf_3dmeasure.c
Normal file
@ -0,0 +1,235 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_annotation.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hpdf_conf.h"
|
||||
#include "hpdf_utils.h"
|
||||
#include "hpdf_info.h"
|
||||
#include "hpdf_3dmeasure.h"
|
||||
#include "hpdf.h"
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*------ HPDF_3DMeasure -----------------------------------------------------*/
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Dict_AddPoint3D(HPDF_Dict dict, const char* key, HPDF_Point3D point)
|
||||
{
|
||||
HPDF_Array array;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
array = HPDF_Array_New (dict->mmgr);
|
||||
if (!array)
|
||||
return HPDF_Error_GetCode ( dict->error);
|
||||
|
||||
if (HPDF_Dict_Add (dict, key, array) != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( dict->error);
|
||||
|
||||
ret += HPDF_Array_AddReal(array, point.x);
|
||||
ret += HPDF_Array_AddReal(array, point.y);
|
||||
ret += HPDF_Array_AddReal(array, point.z);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
HPDF_3DMeasure
|
||||
HPDF_3DC3DMeasure_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Point3D firstanchorpoint,
|
||||
HPDF_Point3D textanchorpoint
|
||||
)
|
||||
{
|
||||
HPDF_3DMeasure measure;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
|
||||
HPDF_PTRACE((" HPDF_3DC3DMeasure_New\n"));
|
||||
|
||||
measure = HPDF_Dict_New (mmgr);
|
||||
if (!measure)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Xref_Add (xref, measure) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "A1", firstanchorpoint);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "TP", textanchorpoint);
|
||||
|
||||
ret += HPDF_Dict_AddName (measure, "Type", "3DMeasure");
|
||||
ret += HPDF_Dict_AddName (measure, "Subtype", "3DC");
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return measure;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
|
||||
HPDF_RGBColor color)
|
||||
{
|
||||
HPDF_Array array;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
array = HPDF_Array_New (measure->mmgr);
|
||||
if (!array)
|
||||
return HPDF_Error_GetCode (measure->error);
|
||||
|
||||
ret = HPDF_Dict_Add (measure, "C", array);
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddName(array, "DeviceRGB");
|
||||
ret += HPDF_Array_AddReal(array, color.r);
|
||||
ret += HPDF_Array_AddReal(array, color.g);
|
||||
ret += HPDF_Array_AddReal(array, color.b);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
|
||||
HPDF_REAL textsize)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
ret = HPDF_Dict_AddReal(measure, "TS", textsize);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
|
||||
const char* name)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_String s;
|
||||
|
||||
s = HPDF_String_New (measure->mmgr, name, 0);
|
||||
if (!s)
|
||||
return HPDF_Error_GetCode ( s->error);
|
||||
|
||||
ret = HPDF_Dict_Add(measure, "TRL", s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
|
||||
HPDF_INT32 x,
|
||||
HPDF_INT32 y)
|
||||
{
|
||||
HPDF_Array array;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
array = HPDF_Array_New (measure->mmgr);
|
||||
if (!array)
|
||||
return HPDF_Error_GetCode (measure->error);
|
||||
|
||||
ret = HPDF_Dict_Add (measure, "TB", array);
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddNumber(array, x);
|
||||
ret += HPDF_Array_AddNumber(array, y);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_String s;
|
||||
|
||||
s = HPDF_String_New (measure->mmgr, text, encoder);
|
||||
if (!s)
|
||||
return HPDF_Error_GetCode ( s->error);
|
||||
|
||||
ret = HPDF_Dict_Add(measure, "UT", s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
|
||||
HPDF_Annotation projectionanotation)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
ret = HPDF_Dict_Add(measure, "S", projectionanotation);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
HPDF_3DMeasure
|
||||
HPDF_PD33DMeasure_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Point3D annotationPlaneNormal,
|
||||
HPDF_Point3D firstAnchorPoint,
|
||||
HPDF_Point3D secondAnchorPoint,
|
||||
HPDF_Point3D leaderLinesDirection,
|
||||
HPDF_Point3D measurementValuePoint,
|
||||
HPDF_Point3D textYDirection,
|
||||
HPDF_REAL value,
|
||||
const char* unitsString
|
||||
)
|
||||
{
|
||||
HPDF_3DMeasure measure;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_String s;
|
||||
|
||||
HPDF_PTRACE((" HPDF_3DC3DMeasure_New\n"));
|
||||
|
||||
measure = HPDF_Dict_New (mmgr);
|
||||
if (!measure)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Xref_Add (xref, measure) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "AP", annotationPlaneNormal);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "A1", firstAnchorPoint);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "A2", secondAnchorPoint);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "D1", leaderLinesDirection);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "TP", measurementValuePoint);
|
||||
ret += HPDF_Dict_AddPoint3D(measure, "TY", textYDirection);
|
||||
|
||||
ret += HPDF_Dict_AddReal(measure, "V", value);
|
||||
|
||||
s = HPDF_String_New (measure->mmgr, unitsString, 0);
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
ret = HPDF_Dict_Add(measure, "U", s);
|
||||
|
||||
ret += HPDF_Dict_AddName (measure, "Type", "3DMeasure");
|
||||
ret += HPDF_Dict_AddName (measure, "Subtype", "PD3");
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return measure;
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_annotation.c
|
||||
* << Haru Free PDF Library >> -- hpdf_annotation.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -14,10 +17,11 @@
|
||||
|
||||
#include "hpdf_conf.h"
|
||||
#include "hpdf_utils.h"
|
||||
#include "hpdf_info.h"
|
||||
#include "hpdf_annotation.h"
|
||||
#include "hpdf.h"
|
||||
|
||||
const static char *HPDF_ANNOT_TYPE_NAMES[] = {
|
||||
static const char * const HPDF_ANNOT_TYPE_NAMES[] = {
|
||||
"Text",
|
||||
"Link",
|
||||
"Sound",
|
||||
@ -30,10 +34,14 @@ const static char *HPDF_ANNOT_TYPE_NAMES[] = {
|
||||
"Underline",
|
||||
"Ink",
|
||||
"FileAttachment",
|
||||
"Popup"
|
||||
"Popup",
|
||||
"3D",
|
||||
"Squiggly",
|
||||
"Line",
|
||||
"Projection"
|
||||
};
|
||||
|
||||
const static char *HPDF_ANNOT_ICON_NAMES_NAMES[] = {
|
||||
static const char * const HPDF_ANNOT_ICON_NAMES_NAMES[] = {
|
||||
"Comment",
|
||||
"Key",
|
||||
"Note",
|
||||
@ -43,6 +51,50 @@ const static char *HPDF_ANNOT_ICON_NAMES_NAMES[] = {
|
||||
"Insert"
|
||||
};
|
||||
|
||||
static const char * const HPDF_ANNOT_INTENT_NAMES[] = {
|
||||
"FreeTextCallout",
|
||||
"FreeTextTypeWriter",
|
||||
"LineArrow",
|
||||
"LineDimension",
|
||||
"PolygonCloud",
|
||||
"PolyLineDimension",
|
||||
"PolygonDimension"
|
||||
};
|
||||
|
||||
static const char * const HPDF_LINE_ANNOT_ENDING_STYLE_NAMES[] = {
|
||||
"None",
|
||||
"Square",
|
||||
"Circle",
|
||||
"Diamond",
|
||||
"OpenArrow",
|
||||
"ClosedArrow",
|
||||
"Butt",
|
||||
"ROpenArrow",
|
||||
"RClosedArrow",
|
||||
"Slash"
|
||||
};
|
||||
|
||||
static const char * const HPDF_LINE_ANNOT_CAP_POSITION_NAMES[] = {
|
||||
"Inline",
|
||||
"Top"
|
||||
};
|
||||
|
||||
static const char * const HPDF_STAMP_ANNOT_NAME_NAMES[] = {
|
||||
"Approved",
|
||||
"Experimental",
|
||||
"NotApproved",
|
||||
"AsIs",
|
||||
"Expired",
|
||||
"NotForPublicRelease",
|
||||
"Confidential",
|
||||
"Final",
|
||||
"Sold",
|
||||
"Departmental",
|
||||
"ForComment",
|
||||
"TopSecret",
|
||||
"Draft",
|
||||
"ForPublicRelease"
|
||||
};
|
||||
|
||||
static HPDF_BOOL
|
||||
CheckSubType (HPDF_Annotation annot,
|
||||
@ -104,7 +156,7 @@ HPDF_Annotation_New (HPDF_MMgr mmgr,
|
||||
}
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
|
||||
HPDF_BSSubtype subtype,
|
||||
HPDF_REAL width,
|
||||
@ -268,12 +320,12 @@ HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot,
|
||||
|
||||
ret += HPDF_Array_AddNumber (dash, dash_on);
|
||||
ret += HPDF_Array_AddNumber (dash, dash_off);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_CheckError (annot->error);
|
||||
}
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_CheckError (annot->error);
|
||||
|
||||
return ret;
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
@ -309,19 +361,101 @@ HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_TextAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_3DAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_U3D u3d)
|
||||
{
|
||||
HPDF_Annotation annot;
|
||||
HPDF_Dict action, appearance, stream;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
HPDF_PTRACE((" HPDF_3DAnnot_New\n"));
|
||||
|
||||
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_3D, rect);
|
||||
if (!annot) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
HPDF_Dict_Add(annot, "Contents", HPDF_String_New (mmgr, "3D Model", NULL));
|
||||
|
||||
action = HPDF_Dict_New (mmgr);
|
||||
if (!action) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = HPDF_Dict_Add (annot, "3DA", action);
|
||||
if (ret != HPDF_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret += HPDF_Dict_AddName (action, "A", "PV");
|
||||
|
||||
ret += HPDF_Dict_AddBoolean(action, "TB", HPDF_FALSE);
|
||||
|
||||
if (ret != HPDF_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (HPDF_Dict_Add (annot, "3DD", u3d) != HPDF_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
appearance = HPDF_Dict_New (mmgr);
|
||||
if (!appearance) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = HPDF_Dict_Add (annot, "AP", appearance);
|
||||
if (ret != HPDF_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
stream = HPDF_Dict_New (mmgr);
|
||||
if (!stream) {
|
||||
return NULL;
|
||||
}
|
||||
ret = HPDF_Dict_Add (appearance, "N", stream);
|
||||
if (ret != HPDF_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return annot;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DAnnot_Set3DView (HPDF_Annotation annot)
|
||||
{
|
||||
HPDF_Boolean b;
|
||||
|
||||
HPDF_PTRACE((" HPDF_3DAnnot_Set3DView\n"));
|
||||
|
||||
if (!CheckSubType (annot, HPDF_ANNOT_3D))
|
||||
return HPDF_INVALID_ANNOTATION;
|
||||
|
||||
b = HPDF_Boolean_New (annot->mmgr, 0);
|
||||
if (!b)
|
||||
return HPDF_CheckError (annot->error);
|
||||
|
||||
return HPDF_Dict_Add (annot, "3DD", b);
|
||||
}
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
const char *text,
|
||||
HPDF_Encoder encoder)
|
||||
HPDF_Encoder encoder,
|
||||
HPDF_AnnotType subtype)
|
||||
{
|
||||
HPDF_Annotation annot;
|
||||
HPDF_String s;
|
||||
|
||||
HPDF_PTRACE((" HPDF_TextAnnot_New\n"));
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_New\n"));
|
||||
|
||||
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_TEXT_NOTES, rect);
|
||||
annot = HPDF_Annotation_New (mmgr, xref, subtype, rect);
|
||||
if (!annot)
|
||||
return NULL;
|
||||
|
||||
@ -335,6 +469,90 @@ HPDF_TextAnnot_New (HPDF_MMgr mmgr,
|
||||
return annot;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetRGBColor (HPDF_Annotation annot, HPDF_RGBColor color)
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_Annot_SetRGBColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New ( annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "C", cArray);
|
||||
ret += HPDF_Array_AddReal (cArray, color.r);
|
||||
ret += HPDF_Array_AddReal (cArray, color.g);
|
||||
ret += HPDF_Array_AddReal (cArray, color.b);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color)
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_Annot_SetCMYKColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New (annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "C", cArray);
|
||||
ret += HPDF_Array_AddReal (cArray, color.c);
|
||||
ret += HPDF_Array_AddReal (cArray, color.m);
|
||||
ret += HPDF_Array_AddReal (cArray, color.y);
|
||||
ret += HPDF_Array_AddReal (cArray, color.k);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color)
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_Annot_SetGrayColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New (annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "C", cArray);
|
||||
ret += HPDF_Array_AddReal ( cArray, color);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_SetNoColor (HPDF_Annotation annot)
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_Annot_SetNoColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New (annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret = HPDF_Dict_Add (annot, "C", cArray);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_TextAnnot_SetIcon (HPDF_Annotation annot,
|
||||
@ -345,7 +563,7 @@ HPDF_TextAnnot_SetIcon (HPDF_Annotation annot,
|
||||
if (!CheckSubType (annot, HPDF_ANNOT_TEXT_NOTES))
|
||||
return HPDF_INVALID_ANNOTATION;
|
||||
|
||||
if (icon < 0 || icon >= HPDF_ANNOT_ICON_EOF)
|
||||
if (icon >= HPDF_ANNOT_ICON_EOF)
|
||||
return HPDF_RaiseError (annot->error, HPDF_ANNOT_INVALID_ICON,
|
||||
(HPDF_STATUS)icon);
|
||||
|
||||
@ -375,6 +593,162 @@ HPDF_TextAnnot_SetOpened (HPDF_Annotation annot,
|
||||
return HPDF_Dict_Add (annot, "Open", b);
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_PopupAnnot_SetOpened (HPDF_Annotation annot,
|
||||
HPDF_BOOL opened)
|
||||
{
|
||||
HPDF_Boolean b;
|
||||
|
||||
HPDF_PTRACE((" HPDF_TextAnnot_SetOpend\n"));
|
||||
|
||||
if (!CheckSubType (annot, HPDF_ANNOT_POPUP))
|
||||
return HPDF_INVALID_ANNOTATION;
|
||||
|
||||
b = HPDF_Boolean_New (annot->mmgr, opened);
|
||||
if (!b)
|
||||
return HPDF_CheckError (annot->error);
|
||||
|
||||
return HPDF_Dict_Add (annot, "Open", b);
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetTitle (HPDF_Annotation annot, const char* name)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetTitle\n"));
|
||||
|
||||
return HPDF_Dict_Add( annot, "T", HPDF_String_New( annot->mmgr, name, NULL));
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetSubject (HPDF_Annotation annot, const char* name)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetSubject\n"));
|
||||
|
||||
return HPDF_Dict_Add( annot, "Subj", HPDF_String_New( annot->mmgr, name, NULL));
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetCreationDate (HPDF_Annotation annot, HPDF_Date value)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetCreationDate\n"));
|
||||
|
||||
return HPDF_Info_SetInfoDateAttr( annot, HPDF_INFO_CREATION_DATE, value);
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetTransparency (HPDF_Annotation annot, HPDF_REAL value)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetTransparency\n"));
|
||||
|
||||
return HPDF_Dict_AddReal( annot, "CA", value);
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetIntent (HPDF_Annotation annot,
|
||||
HPDF_AnnotIntent intent)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetIntent\n"));
|
||||
|
||||
if (HPDF_Dict_AddName (annot, "IT",
|
||||
HPDF_ANNOT_INTENT_NAMES[(HPDF_INT)intent]) != HPDF_OK)
|
||||
return HPDF_CheckError (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetPopup (HPDF_Annotation annot,
|
||||
HPDF_Annotation popup)
|
||||
{
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetPopup\n"));
|
||||
|
||||
return HPDF_Dict_Add( annot, "Popup", popup);
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorRGBColor (HPDF_Annotation annot, HPDF_RGBColor color)/* IC with RGB entry */
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetInteriorRGBColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New ( annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "IC", cArray);
|
||||
ret += HPDF_Array_AddReal (cArray, color.r);
|
||||
ret += HPDF_Array_AddReal (cArray, color.g);
|
||||
ret += HPDF_Array_AddReal (cArray, color.b);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color)/* IC with CMYK entry */
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetInteriorCMYKColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New ( annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "IC", cArray);
|
||||
ret += HPDF_Array_AddReal (cArray, color.c);
|
||||
ret += HPDF_Array_AddReal (cArray, color.m);
|
||||
ret += HPDF_Array_AddReal (cArray, color.y);
|
||||
ret += HPDF_Array_AddReal (cArray, color.k);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorGrayColor (HPDF_Annotation annot, HPDF_REAL color)/* IC with Gray entry */
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetInteriorGrayColor\n"));
|
||||
|
||||
cArray = HPDF_Array_New ( annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add (annot, "IC", cArray);
|
||||
ret += HPDF_Array_AddReal (cArray, color);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetInteriorTransparent (HPDF_Annotation annot) /* IC with No Color entry */
|
||||
{
|
||||
HPDF_Array cArray;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetInteriorTransparent\n"));
|
||||
|
||||
cArray = HPDF_Array_New ( annot->mmgr);
|
||||
if (!cArray)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret = HPDF_Dict_Add (annot, "IC", cArray);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_BOOL
|
||||
HPDF_Annotation_Validate (HPDF_Annotation annot)
|
||||
@ -413,3 +787,380 @@ CheckSubType (HPDF_Annotation annot,
|
||||
return HPDF_TRUE;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
|
||||
HPDF_Annotation annot,
|
||||
HPDF_Annotation annot3d,
|
||||
HPDF_Dict view3d)
|
||||
{
|
||||
HPDF_Proxy proxyView3d;
|
||||
HPDF_Dict exData = HPDF_Dict_New( mmgr);
|
||||
HPDF_STATUS retS = HPDF_OK;
|
||||
|
||||
retS += HPDF_Dict_AddName( exData, "Type", "ExData");
|
||||
retS += HPDF_Dict_AddName( exData, "Subtype", "Markup3D");
|
||||
retS += HPDF_Dict_Add( exData, "3DA", annot3d);
|
||||
|
||||
proxyView3d = HPDF_Proxy_New( mmgr, view3d);
|
||||
|
||||
retS += HPDF_Dict_Add( exData, "3DV", proxyView3d);
|
||||
retS += HPDF_Dict_Add( annot, "ExData", exData);
|
||||
return retS;
|
||||
}
|
||||
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_PopupAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_Annotation parent)
|
||||
{
|
||||
HPDF_Annotation annot;
|
||||
|
||||
HPDF_PTRACE((" HPDF_PopupAnnot_New\n"));
|
||||
|
||||
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_POPUP, rect);
|
||||
if (!annot)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Dict_Add (annot, "Parent", parent) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return annot;
|
||||
}
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_StampAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_StampAnnotName name,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder)
|
||||
{
|
||||
HPDF_Annotation annot;
|
||||
HPDF_String s;
|
||||
HPDF_PTRACE((" HPDF_StampAnnot_New\n"));
|
||||
|
||||
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_STAMP, rect);
|
||||
if (!annot)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Dict_AddName ( annot, "Name", HPDF_STAMP_ANNOT_NAME_NAMES[name]) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
s = HPDF_String_New (mmgr, text, encoder);
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Dict_Add (annot, "Contents", s) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return annot;
|
||||
}
|
||||
|
||||
HPDF_Annotation
|
||||
HPDF_ProjectionAnnot_New(HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder)
|
||||
{
|
||||
HPDF_Annotation annot;
|
||||
HPDF_String s;
|
||||
HPDF_PTRACE((" HPDF_StampAnnot_New\n"));
|
||||
|
||||
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_PROJECTION, rect);
|
||||
if (!annot)
|
||||
return NULL;
|
||||
|
||||
s = HPDF_String_New (mmgr, text, encoder);
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Dict_Add (annot, "Contents", s) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return annot;
|
||||
}
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_TextMarkupAnnot_SetQuadPoints ( HPDF_Annotation annot, HPDF_Point lb, HPDF_Point rb, HPDF_Point lt, HPDF_Point rt) /* l-left, r-right, b-bottom, t-top positions */
|
||||
{
|
||||
HPDF_Array quadPoints;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_TextMarkupAnnot_SetQuadPoints\n"));
|
||||
|
||||
quadPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !quadPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "QuadPoints", quadPoints)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddReal (quadPoints, lb.x);
|
||||
ret += HPDF_Array_AddReal (quadPoints, lb.y);
|
||||
ret += HPDF_Array_AddReal (quadPoints, rb.x);
|
||||
ret += HPDF_Array_AddReal (quadPoints, rb.y);
|
||||
ret += HPDF_Array_AddReal (quadPoints, lt.x);
|
||||
ret += HPDF_Array_AddReal (quadPoints, lt.y);
|
||||
ret += HPDF_Array_AddReal (quadPoints, rt.x);
|
||||
ret += HPDF_Array_AddReal (quadPoints, rt.y);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (quadPoints->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_SetLineEndingStyle (HPDF_Annotation annot, HPDF_LineAnnotEndingStyle startStyle, HPDF_LineAnnotEndingStyle endStyle)
|
||||
{
|
||||
HPDF_Array lineEndStyles;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_SetLineEndingStyle\n"));
|
||||
|
||||
lineEndStyles = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !lineEndStyles)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "LE", lineEndStyles)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddName (lineEndStyles, HPDF_LINE_ANNOT_ENDING_STYLE_NAMES[(HPDF_INT)startStyle]);
|
||||
ret += HPDF_Array_AddName (lineEndStyles, HPDF_LINE_ANNOT_ENDING_STYLE_NAMES[(HPDF_INT)endStyle]);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (lineEndStyles->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetRectDiff (HPDF_Annotation annot, HPDF_Rect rect) /* RD entry : this is the difference between Rect and the text annotation rectangle */
|
||||
{
|
||||
HPDF_Array array;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_REAL tmp;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetRectDiff\n"));
|
||||
|
||||
array = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !array)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "RD", array)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
if (rect.top < rect.bottom) {
|
||||
tmp = rect.top;
|
||||
rect.top = rect.bottom;
|
||||
rect.bottom = tmp;
|
||||
}
|
||||
|
||||
ret += HPDF_Array_AddReal (array, rect.left);
|
||||
ret += HPDF_Array_AddReal (array, rect.bottom);
|
||||
ret += HPDF_Array_AddReal (array, rect.right);
|
||||
ret += HPDF_Array_AddReal (array, rect.top);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (array->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_SetDefaultStyle (HPDF_Annotation annot,
|
||||
const char* style)
|
||||
{
|
||||
HPDF_String s;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_SetDefaultStyle\n"));
|
||||
|
||||
s = HPDF_String_New ( annot->mmgr, style, NULL);
|
||||
if ( !s)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret = HPDF_Dict_Add ( annot, "DS", s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_Set3PointCalloutLine ( HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point kneePoint, HPDF_Point endPoint) /* Callout line will be in default user space */
|
||||
{
|
||||
HPDF_Array clPoints;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_Set3PointCalloutLine\n"));
|
||||
|
||||
clPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !clPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "CL", clPoints)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddReal (clPoints, startPoint.x);
|
||||
ret += HPDF_Array_AddReal (clPoints, startPoint.y);
|
||||
ret += HPDF_Array_AddReal (clPoints, kneePoint.x);
|
||||
ret += HPDF_Array_AddReal (clPoints, kneePoint.y);
|
||||
ret += HPDF_Array_AddReal (clPoints, endPoint.x);
|
||||
ret += HPDF_Array_AddReal (clPoints, endPoint.y);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (clPoints->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_FreeTextAnnot_Set2PointCalloutLine ( HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point endPoint) /* Callout line will be in default user space */
|
||||
{
|
||||
HPDF_Array clPoints;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_Set3PointCalloutLine\n"));
|
||||
|
||||
clPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !clPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "CL", clPoints)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddReal (clPoints, startPoint.x);
|
||||
ret += HPDF_Array_AddReal (clPoints, startPoint.y);
|
||||
ret += HPDF_Array_AddReal (clPoints, endPoint.x);
|
||||
ret += HPDF_Array_AddReal (clPoints, endPoint.y);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (clPoints->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity) /* BE entry */
|
||||
{
|
||||
HPDF_Dict borderEffect;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetCloudEffect\n"));
|
||||
|
||||
borderEffect = HPDF_Dict_New ( annot->mmgr);
|
||||
if (!borderEffect)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret += HPDF_Dict_Add ( annot, "BE", borderEffect);
|
||||
ret += HPDF_Dict_AddName ( borderEffect, "S", "C");
|
||||
ret += HPDF_Dict_AddNumber ( borderEffect, "I", cloudIntensity);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
|
||||
HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
|
||||
HPDF_Point endPoint, HPDF_LineAnnotEndingStyle endStyle)
|
||||
{
|
||||
HPDF_Array lineEndPoints;
|
||||
HPDF_Array lineEndStyles;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_LineAnnot_SetPosition\n"));
|
||||
|
||||
lineEndPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !lineEndPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "L", lineEndPoints)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddReal (lineEndPoints, startPoint.x);
|
||||
ret += HPDF_Array_AddReal (lineEndPoints, startPoint.y);
|
||||
ret += HPDF_Array_AddReal (lineEndPoints, endPoint.x);
|
||||
ret += HPDF_Array_AddReal (lineEndPoints, endPoint.y);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( lineEndPoints->error);
|
||||
|
||||
lineEndStyles = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !lineEndStyles)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "LE", lineEndStyles)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddName (lineEndStyles, HPDF_LINE_ANNOT_ENDING_STYLE_NAMES[(HPDF_INT)startStyle]);
|
||||
ret += HPDF_Array_AddName (lineEndStyles, HPDF_LINE_ANNOT_ENDING_STYLE_NAMES[(HPDF_INT)endStyle]);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( lineEndStyles->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetLeader (HPDF_Annotation annot, HPDF_INT leaderLen, HPDF_INT leaderExtLen, HPDF_INT leaderOffsetLen)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_LineAnnot_SetLeader\n"));
|
||||
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LL", leaderLen);
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LLE", leaderExtLen);
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LLO", leaderOffsetLen);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetCaption (HPDF_Annotation annot, HPDF_BOOL showCaption, HPDF_LineAnnotCapPosition position, HPDF_INT horzOffset, HPDF_INT vertOffset)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_Array capOffset;
|
||||
HPDF_PTRACE((" HPDF_LineAnnot_SetCaption\n"));
|
||||
|
||||
ret += HPDF_Dict_AddBoolean ( annot, "Cap", showCaption);
|
||||
ret += HPDF_Dict_AddName( annot, "CP", HPDF_LINE_ANNOT_CAP_POSITION_NAMES[(HPDF_INT)position]);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
capOffset = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !capOffset)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
if ((ret = HPDF_Dict_Add ( annot, "CO", capOffset)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
ret += HPDF_Array_AddNumber (capOffset, horzOffset);
|
||||
ret += HPDF_Array_AddNumber (capOffset, vertOffset);
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (capOffset->error);
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_ProjectionAnnot_SetExData(HPDF_Annotation annot, HPDF_ExData exdata)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
ret = HPDF_Dict_Add(annot, "ExData", exdata);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_array.c
|
||||
* << Haru Free PDF Library >> -- hpdf_array.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -211,6 +214,13 @@ HPDF_Array_Add (HPDF_Array array,
|
||||
}
|
||||
|
||||
|
||||
HPDF_UINT
|
||||
HPDF_Array_Items (HPDF_Array array)
|
||||
{
|
||||
return array->list->count;
|
||||
}
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Array_Insert (HPDF_Array array,
|
||||
void *target,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_binary.c
|
||||
* << Haru Free PDF Library >> -- hpdf_binary.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_boolean.h
|
||||
* << Haru Free PDF Library >> -- hpdf_boolean.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.5 >> -- hpdf_catalog.c
|
||||
* << Haru Free PDF Library >> -- hpdf_catalog.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -10,8 +13,6 @@
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* 2006.08.07 modified.
|
||||
* 2006.09.01 added ViewerPreference functions.
|
||||
*/
|
||||
|
||||
#include "hpdf_conf.h"
|
||||
@ -19,16 +20,18 @@
|
||||
#include "hpdf_catalog.h"
|
||||
#include "hpdf_pages.h"
|
||||
|
||||
static const char *HPDF_PAGE_LAYOUT_NAMES[] = {
|
||||
static const char * const HPDF_PAGE_LAYOUT_NAMES[] = {
|
||||
"SinglePage",
|
||||
"OneColumn",
|
||||
"TwoColumnLeft",
|
||||
"TwoColumnRight",
|
||||
"TwoPageLeft",
|
||||
"TwoPageRight",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static const char *HPDF_PAGE_MODE_NAMES[] = {
|
||||
static const char * const HPDF_PAGE_MODE_NAMES[] = {
|
||||
"UseNone",
|
||||
"UseOutlines",
|
||||
"UseThumbs",
|
||||
@ -83,6 +86,23 @@ HPDF_Catalog_GetRoot (HPDF_Catalog catalog)
|
||||
}
|
||||
|
||||
|
||||
HPDF_NameDict
|
||||
HPDF_Catalog_GetNames (HPDF_Catalog catalog)
|
||||
{
|
||||
if (!catalog)
|
||||
return NULL;
|
||||
return HPDF_Dict_GetItem (catalog, "Names", HPDF_OCLASS_DICT);
|
||||
}
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Catalog_SetNames (HPDF_Catalog catalog,
|
||||
HPDF_NameDict dict)
|
||||
{
|
||||
return HPDF_Dict_Add (catalog, "Names", dict);
|
||||
}
|
||||
|
||||
|
||||
HPDF_PageLayout
|
||||
HPDF_Catalog_GetPageLayout (HPDF_Catalog catalog)
|
||||
{
|
||||
@ -296,6 +316,17 @@ HPDF_Catalog_SetViewerPreference (HPDF_Catalog catalog,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (value & HPDF_PRINT_SCALING_NONE) {
|
||||
if ((ret = HPDF_Dict_AddName (preferences, "PrintScaling",
|
||||
"None")) != HPDF_OK)
|
||||
return ret;
|
||||
} else {
|
||||
if ((ret = HPDF_Dict_RemoveElement (preferences, "PrintScaling")) !=
|
||||
HPDF_OK)
|
||||
if (ret != HPDF_DICT_ITEM_NOT_FOUND)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_destination.c
|
||||
* << Haru Free PDF Library >> -- hpdf_destination.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -16,7 +19,7 @@
|
||||
#include "hpdf_utils.h"
|
||||
#include "hpdf.h"
|
||||
|
||||
const char *HPDF_DESTINATION_TYPE_NAMES[] = {
|
||||
const char * const HPDF_DESTINATION_TYPE_NAMES[] = {
|
||||
"XYZ",
|
||||
"Fit",
|
||||
"FitH",
|
||||
@ -82,8 +85,10 @@ HPDF_Destination_Validate (HPDF_Destination dst)
|
||||
return HPDF_FALSE;
|
||||
|
||||
target = (HPDF_Page)HPDF_Array_GetItem (dst, 0, HPDF_OCLASS_DICT);
|
||||
if (!HPDF_Page_Validate (target))
|
||||
return HPDF_SetError (dst->error, HPDF_INVALID_PAGE, 0);
|
||||
if (!HPDF_Page_Validate (target)) {
|
||||
HPDF_SetError (dst->error, HPDF_INVALID_PAGE, 0);
|
||||
return HPDF_FALSE;
|
||||
}
|
||||
|
||||
return HPDF_TRUE;
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.5 >> -- HPDF_Dict.c
|
||||
* << Haru Free PDF Library >> -- hpdf_dict.c
|
||||
*
|
||||
* Copyright (c) 1999-2004 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -113,6 +116,25 @@ HPDF_Dict_Free (HPDF_Dict dict)
|
||||
HPDF_FreeMem (dict->mmgr, dict);
|
||||
}
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Dict_Add_FilterParams(HPDF_Dict dict, HPDF_Dict filterParam)
|
||||
{
|
||||
HPDF_Array paramArray;
|
||||
/* prepare params object */
|
||||
paramArray = HPDF_Dict_GetItem (dict, "DecodeParms",
|
||||
HPDF_OCLASS_ARRAY);
|
||||
if(paramArray==NULL) {
|
||||
paramArray = HPDF_Array_New (dict->mmgr);
|
||||
if (!paramArray)
|
||||
return HPDF_Error_GetCode (dict->error);
|
||||
|
||||
/* add parameters */
|
||||
HPDF_Dict_Add(dict, "DecodeParms", paramArray);
|
||||
}
|
||||
HPDF_Array_Add(paramArray, filterParam);
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_Dict_Write (HPDF_Dict dict,
|
||||
@ -155,13 +177,21 @@ HPDF_Dict_Write (HPDF_Dict dict,
|
||||
|
||||
HPDF_Array_Clear (array);
|
||||
|
||||
#ifndef HPDF_NOZLIB
|
||||
#ifndef LIBHPDF_HAVE_NOZLIB
|
||||
if (dict->filter & HPDF_STREAM_FILTER_FLATE_DECODE)
|
||||
HPDF_Array_AddName (array, "FlateDecode");
|
||||
#endif /* HPDF_NOZLIB */
|
||||
#endif /* LIBHPDF_HAVE_NOZLIB */
|
||||
|
||||
if (dict->filter & HPDF_STREAM_FILTER_DCT_DECODE)
|
||||
HPDF_Array_AddName (array, "DCTDecode");
|
||||
|
||||
if(dict->filter & HPDF_STREAM_FILTER_CCITT_DECODE)
|
||||
HPDF_Array_AddName (array, "CCITTFaxDecode");
|
||||
|
||||
if(dict->filterParams!=NULL)
|
||||
{
|
||||
HPDF_Dict_Add_FilterParams(dict, dict->filterParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +250,7 @@ HPDF_Dict_Write (HPDF_Dict dict,
|
||||
0);
|
||||
}
|
||||
|
||||
if ((ret = HPDF_Stream_WriteStr (stream, "\012stream\015\012"))
|
||||
if ((ret = HPDF_Stream_WriteStr (stream, "\012stream\015\012")) /* Acrobat 8.15 requires both \r and \n here */
|
||||
!= HPDF_OK)
|
||||
return ret;
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.5 >> -- hpdf_doc.c
|
||||
* << Haru Free PDF Library >> -- hpdf_doc.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -16,18 +19,20 @@
|
||||
#include "hpdf_conf.h"
|
||||
#include "hpdf_utils.h"
|
||||
#include "hpdf_encryptdict.h"
|
||||
#include "hpdf_namedict.h"
|
||||
#include "hpdf_destination.h"
|
||||
#include "hpdf_info.h"
|
||||
#include "hpdf_page_label.h"
|
||||
#include "hpdf.h"
|
||||
|
||||
|
||||
static const char *HPDF_VERSION_STR[5] = {
|
||||
static const char * const HPDF_VERSION_STR[6] = {
|
||||
"%PDF-1.2\012%\267\276\255\252\012",
|
||||
"%PDF-1.3\012%\267\276\255\252\012",
|
||||
"%PDF-1.4\012%\267\276\255\252\012",
|
||||
"%PDF-1.5\012%\267\276\255\252\012",
|
||||
"%PDF-1.6\012%\267\276\255\252\012"
|
||||
"%PDF-1.6\012%\267\276\255\252\012",
|
||||
"%PDF-1.7\012%\267\276\255\252\012"
|
||||
};
|
||||
|
||||
|
||||
@ -255,7 +260,7 @@ HPDF_NewDoc (HPDF_Doc pdf)
|
||||
|
||||
pdf->cur_pages = pdf->root_pages;
|
||||
|
||||
ptr = HPDF_StrCpy (ptr, "Haru Free PDF Library ", eptr);
|
||||
ptr = (char *)HPDF_StrCpy (ptr, (const char *)"Haru Free PDF Library ", eptr);
|
||||
version = HPDF_GetVersion ();
|
||||
HPDF_StrCpy (ptr, version, eptr);
|
||||
|
||||
@ -647,6 +652,39 @@ HPDF_SaveToStream (HPDF_Doc pdf)
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_GetContents (HPDF_Doc pdf,
|
||||
HPDF_BYTE *buf,
|
||||
HPDF_UINT32 *size)
|
||||
{
|
||||
HPDF_Stream stream;
|
||||
HPDF_UINT isize = *size;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_GetContents\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf)) {
|
||||
return HPDF_INVALID_DOCUMENT;
|
||||
}
|
||||
|
||||
stream = HPDF_MemStream_New (pdf->mmgr, HPDF_STREAM_BUF_SIZ);
|
||||
|
||||
if (!stream) {
|
||||
return HPDF_CheckError (&pdf->error);
|
||||
}
|
||||
|
||||
if (InternalSaveToStream (pdf, stream) != HPDF_OK) {
|
||||
HPDF_Stream_Free (stream);
|
||||
return HPDF_CheckError (&pdf->error);
|
||||
}
|
||||
|
||||
ret = HPDF_Stream_Read (stream, buf, &isize);
|
||||
|
||||
*size = isize;
|
||||
HPDF_Stream_Free (stream);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_UINT32)
|
||||
HPDF_GetStreamSize (HPDF_Doc pdf)
|
||||
@ -1186,11 +1224,12 @@ HPDF_SetCurrentEncoder (HPDF_Doc pdf,
|
||||
return HPDF_GetError (pdf);
|
||||
|
||||
encoder = HPDF_GetEncoder (pdf, encoding_name);
|
||||
pdf->cur_encoder = encoder;
|
||||
|
||||
if (!pdf)
|
||||
if (!encoder)
|
||||
return HPDF_GetError (pdf);
|
||||
|
||||
pdf->cur_encoder = encoder;
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
@ -1281,6 +1320,11 @@ HPDF_GetFont (HPDF_Doc pdf,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!encoder) {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
font = HPDF_Doc_FindFont (pdf, font_name, encoder->name);
|
||||
} else {
|
||||
font = HPDF_Doc_FindFont (pdf, font_name, encoding_name);
|
||||
@ -1412,10 +1456,33 @@ LoadType1FontFromStream (HPDF_Doc pdf,
|
||||
HPDF_FontDef_Free (def);
|
||||
return NULL;
|
||||
}
|
||||
return def->base_font;
|
||||
}
|
||||
return def->base_font;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_FontDef)
|
||||
HPDF_GetTTFontDefFromFile (HPDF_Doc pdf,
|
||||
const char *file_name,
|
||||
HPDF_BOOL embedding)
|
||||
{
|
||||
HPDF_Stream font_data;
|
||||
HPDF_FontDef def;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_GetTTFontDefFromFile\n"));
|
||||
|
||||
/* create file stream */
|
||||
font_data = HPDF_FileReader_New (pdf->mmgr, file_name);
|
||||
|
||||
if (HPDF_Stream_Validate (font_data)) {
|
||||
def = HPDF_TTFontDef_Load (pdf->mmgr, font_data, embedding);
|
||||
} else {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(const char*)
|
||||
HPDF_LoadTTFontFromFile (HPDF_Doc pdf,
|
||||
@ -1454,14 +1521,14 @@ LoadTTFontFromStream (HPDF_Doc pdf,
|
||||
HPDF_FontDef def;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_LoadTTFontFromStream\n"));
|
||||
HPDF_UNUSED (file_name);
|
||||
|
||||
def = HPDF_TTFontDef_Load (pdf->mmgr, font_data, embedding);
|
||||
if (def) {
|
||||
HPDF_FontDef tmpdef = HPDF_Doc_FindFontDef (pdf, def->base_font);
|
||||
if (tmpdef) {
|
||||
HPDF_FontDef_Free (def);
|
||||
HPDF_SetError (&pdf->error, HPDF_FONT_EXISTS, 0);
|
||||
return NULL;
|
||||
return tmpdef->base_font;
|
||||
}
|
||||
|
||||
if (HPDF_List_Add (pdf->fontdef_list, def) != HPDF_OK) {
|
||||
@ -1473,7 +1540,7 @@ LoadTTFontFromStream (HPDF_Doc pdf,
|
||||
|
||||
if (embedding) {
|
||||
if (pdf->ttfont_tag[0] == 0) {
|
||||
HPDF_MemCpy (pdf->ttfont_tag, "HPDFAA", 6);
|
||||
HPDF_MemCpy (pdf->ttfont_tag, (HPDF_BYTE *)"HPDFAA", 6);
|
||||
} else {
|
||||
HPDF_INT i;
|
||||
|
||||
@ -1486,7 +1553,7 @@ LoadTTFontFromStream (HPDF_Doc pdf,
|
||||
}
|
||||
}
|
||||
|
||||
HPDF_TTFontDef_SetTagName (def, pdf->ttfont_tag);
|
||||
HPDF_TTFontDef_SetTagName (def, (char *)pdf->ttfont_tag);
|
||||
}
|
||||
|
||||
return def->base_font;
|
||||
@ -1532,14 +1599,14 @@ LoadTTFontFromStream2 (HPDF_Doc pdf,
|
||||
HPDF_FontDef def;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_LoadTTFontFromStream2\n"));
|
||||
HPDF_UNUSED (file_name);
|
||||
|
||||
def = HPDF_TTFontDef_Load2 (pdf->mmgr, font_data, index, embedding);
|
||||
if (def) {
|
||||
HPDF_FontDef tmpdef = HPDF_Doc_FindFontDef (pdf, def->base_font);
|
||||
if (tmpdef) {
|
||||
HPDF_FontDef_Free (def);
|
||||
HPDF_SetError (&pdf->error, HPDF_FONT_EXISTS, 0);
|
||||
return NULL;
|
||||
return tmpdef->base_font;
|
||||
}
|
||||
|
||||
if (HPDF_List_Add (pdf->fontdef_list, def) != HPDF_OK) {
|
||||
@ -1551,7 +1618,7 @@ LoadTTFontFromStream2 (HPDF_Doc pdf,
|
||||
|
||||
if (embedding) {
|
||||
if (pdf->ttfont_tag[0] == 0) {
|
||||
HPDF_MemCpy (pdf->ttfont_tag, "HPDFAA", 6);
|
||||
HPDF_MemCpy (pdf->ttfont_tag, (HPDF_BYTE *)"HPDFAA", 6);
|
||||
} else {
|
||||
HPDF_INT i;
|
||||
|
||||
@ -1564,7 +1631,7 @@ LoadTTFontFromStream2 (HPDF_Doc pdf,
|
||||
}
|
||||
}
|
||||
|
||||
HPDF_TTFontDef_SetTagName (def, pdf->ttfont_tag);
|
||||
HPDF_TTFontDef_SetTagName (def, (char *)pdf->ttfont_tag);
|
||||
}
|
||||
|
||||
return def->base_font;
|
||||
@ -1601,7 +1668,7 @@ HPDF_LoadRawImageFromFile (HPDF_Doc pdf,
|
||||
if (!image)
|
||||
HPDF_CheckError (&pdf->error);
|
||||
|
||||
if (pdf->compression_mode & HPDF_COMP_IMAGE)
|
||||
if (image && pdf->compression_mode & HPDF_COMP_IMAGE)
|
||||
image->filter = HPDF_STREAM_FILTER_FLATE_DECODE;
|
||||
|
||||
return image;
|
||||
@ -1623,14 +1690,19 @@ HPDF_LoadRawImageFromMem (HPDF_Doc pdf,
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return NULL;
|
||||
|
||||
image = HPDF_Image_LoadRawImageFromMem (pdf->mmgr, buf, pdf->xref, width,
|
||||
height, color_space, bits_per_component);
|
||||
/* Use directly HPDF_Image_LoadRaw1BitImageFromMem to save B/W images */
|
||||
if(color_space == HPDF_CS_DEVICE_GRAY && bits_per_component == 1) {
|
||||
return HPDF_Image_LoadRaw1BitImageFromMem (pdf, buf, width, height, (width+7)/8, HPDF_TRUE, HPDF_TRUE);
|
||||
}
|
||||
|
||||
image = HPDF_Image_LoadRawImageFromMem (pdf->mmgr, buf, pdf->xref, width, height, color_space, bits_per_component);
|
||||
|
||||
if (!image)
|
||||
HPDF_CheckError (&pdf->error);
|
||||
|
||||
if (pdf->compression_mode & HPDF_COMP_IMAGE)
|
||||
if (image && pdf->compression_mode & HPDF_COMP_IMAGE) {
|
||||
image->filter = HPDF_STREAM_FILTER_FLATE_DECODE;
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
@ -1665,6 +1737,27 @@ HPDF_LoadJpegImageFromFile (HPDF_Doc pdf,
|
||||
return image;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadJpegImageFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buffer,
|
||||
HPDF_UINT size)
|
||||
{
|
||||
HPDF_Image image;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_LoadJpegImageFromMem\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
image = HPDF_Image_LoadJpegImageFromMem (pdf->mmgr, buffer, size , pdf->xref);
|
||||
|
||||
if (!image) {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
/*----- Catalog ------------------------------------------------------------*/
|
||||
|
||||
@ -1695,6 +1788,9 @@ HPDF_SetPageLayout (HPDF_Doc pdf,
|
||||
return HPDF_RaiseError (&pdf->error, HPDF_PAGE_LAYOUT_OUT_OF_RANGE,
|
||||
(HPDF_STATUS)layout);
|
||||
|
||||
if ((layout == HPDF_PAGE_LAYOUT_TWO_PAGE_LEFT || layout == HPDF_PAGE_LAYOUT_TWO_PAGE_RIGHT) && pdf->pdf_version < HPDF_VER_15)
|
||||
pdf->pdf_version = HPDF_VER_15 ;
|
||||
|
||||
ret = HPDF_Catalog_SetPageLayout (pdf->catalog, layout);
|
||||
if (ret != HPDF_OK)
|
||||
HPDF_CheckError (&pdf->error);
|
||||
@ -1786,6 +1882,8 @@ HPDF_SetViewerPreference (HPDF_Doc pdf,
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_CheckError (&pdf->error);
|
||||
|
||||
pdf->pdf_version = HPDF_VER_16;
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
@ -1822,6 +1920,58 @@ HPDF_AddPageLabel (HPDF_Doc pdf,
|
||||
}
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_EmbeddedFile)
|
||||
HPDF_AttachFile (HPDF_Doc pdf,
|
||||
const char *file)
|
||||
{
|
||||
HPDF_NameDict names;
|
||||
HPDF_NameTree ntree;
|
||||
HPDF_EmbeddedFile efile;
|
||||
HPDF_String name;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_AttachFile\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return NULL;
|
||||
|
||||
names = HPDF_Catalog_GetNames (pdf->catalog);
|
||||
if (!names) {
|
||||
names = HPDF_NameDict_New (pdf->mmgr, pdf->xref);
|
||||
if (!names)
|
||||
return NULL;
|
||||
|
||||
ret = HPDF_Catalog_SetNames (pdf->catalog, names);
|
||||
if (ret != HPDF_OK)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ntree = HPDF_NameDict_GetNameTree (names, HPDF_NAME_EMBEDDED_FILES);
|
||||
if (!ntree) {
|
||||
ntree = HPDF_NameTree_New (pdf->mmgr, pdf->xref);
|
||||
if (!ntree)
|
||||
return NULL;
|
||||
|
||||
ret = HPDF_NameDict_SetNameTree (names, HPDF_NAME_EMBEDDED_FILES, ntree);
|
||||
if (ret != HPDF_OK)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
efile = HPDF_EmbeddedFile_New (pdf->mmgr, pdf->xref, file);
|
||||
if (!efile)
|
||||
return NULL;
|
||||
|
||||
name = HPDF_String_New (pdf->mmgr, file, NULL);
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
ret += HPDF_NameTree_Add (ntree, name, efile);
|
||||
if (ret != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
return efile;
|
||||
}
|
||||
|
||||
/*----- Info ---------------------------------------------------------------*/
|
||||
|
||||
static HPDF_Dict
|
||||
@ -1976,16 +2126,16 @@ HPDF_SetCompressionMode (HPDF_Doc pdf,
|
||||
if (mode != (mode & HPDF_COMP_MASK))
|
||||
return HPDF_RaiseError (&pdf->error, HPDF_INVALID_COMPRESSION_MODE, 0);
|
||||
|
||||
#ifndef HPDF_NOZLIB
|
||||
#ifndef LIBHPDF_HAVE_NOZLIB
|
||||
pdf->compression_mode = mode;
|
||||
|
||||
return HPDF_OK;
|
||||
|
||||
#else /* HPDF_NOZLIB */
|
||||
#else /* LIBHPDF_HAVE_NOZLIB */
|
||||
|
||||
return HPDF_INVALID_COMPRESSION_MODE;
|
||||
|
||||
#endif /* HPDF_NOZLIB */
|
||||
#endif /* LIBHPDF_HAVE_NOZLIB */
|
||||
}
|
||||
|
||||
|
||||
@ -2018,3 +2168,201 @@ HPDF_ResetError (HPDF_Doc pdf)
|
||||
HPDF_Error_Reset (&pdf->error);
|
||||
}
|
||||
|
||||
/*
|
||||
* create an intententry
|
||||
*/
|
||||
HPDF_EXPORT(HPDF_OutputIntent)
|
||||
HPDF_OutputIntent_New (HPDF_Doc pdf,
|
||||
const char* identifier,
|
||||
const char* condition,
|
||||
const char* registry,
|
||||
const char* info,
|
||||
HPDF_Array outputprofile)
|
||||
{
|
||||
HPDF_OutputIntent intent;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_OutputIntent_New\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return NULL;
|
||||
|
||||
intent = HPDF_Dict_New (pdf->mmgr);
|
||||
if (!intent)
|
||||
return NULL;
|
||||
|
||||
if (HPDF_Xref_Add (pdf->xref, intent) != HPDF_OK) {
|
||||
HPDF_Dict_Free(intent);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret += HPDF_Dict_AddName (intent, "Type", "OutputIntent");
|
||||
ret += HPDF_Dict_AddName (intent, "S", "GTS_PDFX");
|
||||
ret += HPDF_Dict_Add (intent, "OutputConditionIdentifier", HPDF_String_New (pdf->mmgr, identifier, NULL));
|
||||
ret += HPDF_Dict_Add (intent, "OutputCondition", HPDF_String_New (pdf->mmgr, condition,NULL));
|
||||
ret += HPDF_Dict_Add (intent, "RegistryName", HPDF_String_New (pdf->mmgr, registry, NULL));
|
||||
|
||||
if (info != NULL) {
|
||||
ret += HPDF_Dict_Add (intent, "Info", HPDF_String_New (pdf->mmgr, info, NULL));
|
||||
}
|
||||
|
||||
/* add ICC base stream */
|
||||
if (outputprofile != NULL) {
|
||||
ret += HPDF_Dict_Add (intent, "DestOutputProfile ", outputprofile);
|
||||
}
|
||||
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Dict_Free(intent);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return intent;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_AddIntent(HPDF_Doc pdf,
|
||||
HPDF_OutputIntent intent)
|
||||
{
|
||||
HPDF_Array intents;
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return HPDF_INVALID_DOCUMENT;
|
||||
|
||||
intents = HPDF_Dict_GetItem (pdf->catalog, "OutputIntents", HPDF_OCLASS_ARRAY);
|
||||
if (intents == NULL) {
|
||||
intents = HPDF_Array_New (pdf->mmgr);
|
||||
if (intents) {
|
||||
HPDF_STATUS ret = HPDF_Dict_Add (pdf->catalog, "OutputIntents", intents);
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
return HPDF_Error_GetDetailCode (&pdf->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
HPDF_Array_Add(intents,intent);
|
||||
return HPDF_Error_GetDetailCode (&pdf->error);
|
||||
}
|
||||
|
||||
/* "Perceptual", "RelativeColorimetric", "Saturation", "AbsoluteColorimetric" */
|
||||
HPDF_EXPORT(HPDF_OutputIntent)
|
||||
HPDF_ICC_LoadIccFromMem (HPDF_Doc pdf,
|
||||
HPDF_MMgr mmgr,
|
||||
HPDF_Stream iccdata,
|
||||
HPDF_Xref xref,
|
||||
int numcomponent)
|
||||
{
|
||||
HPDF_OutputIntent icc;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_ICC_LoadIccFromMem\n"));
|
||||
|
||||
icc = HPDF_DictStream_New (mmgr, xref);
|
||||
if (!icc)
|
||||
return NULL;
|
||||
|
||||
HPDF_Dict_AddNumber (icc, "N", numcomponent);
|
||||
switch (numcomponent) {
|
||||
case 1 :
|
||||
HPDF_Dict_AddName (icc, "Alternate", "DeviceGray");
|
||||
break;
|
||||
case 3 :
|
||||
HPDF_Dict_AddName (icc, "Alternate", "DeviceRGB");
|
||||
break;
|
||||
case 4 :
|
||||
HPDF_Dict_AddName (icc, "Alternate", "DeviceCMYK");
|
||||
break;
|
||||
default : /* unsupported */
|
||||
HPDF_RaiseError (&pdf->error, HPDF_INVALID_ICC_COMPONENT_NUM, 0);
|
||||
HPDF_Dict_Free(icc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
HPDF_BYTE buf[HPDF_STREAM_BUF_SIZ];
|
||||
HPDF_UINT len = HPDF_STREAM_BUF_SIZ;
|
||||
ret = HPDF_Stream_Read (iccdata, buf, &len);
|
||||
|
||||
if (ret != HPDF_OK) {
|
||||
if (ret == HPDF_STREAM_EOF) {
|
||||
if (len > 0) {
|
||||
ret = HPDF_Stream_Write (icc->stream, buf, len);
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Dict_Free(icc);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
HPDF_Dict_Free(icc);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (HPDF_Stream_Write (icc->stream, buf, len) != HPDF_OK) {
|
||||
HPDF_Dict_Free(icc);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return icc;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_Array)
|
||||
HPDF_AddColorspaceFromProfile (HPDF_Doc pdf,
|
||||
HPDF_Dict icc)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_Array iccentry;
|
||||
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return NULL;
|
||||
|
||||
iccentry = HPDF_Array_New(pdf->mmgr);
|
||||
if (!iccentry)
|
||||
return NULL;
|
||||
|
||||
ret = HPDF_Array_AddName (iccentry, "ICCBased" );
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Array_Free(iccentry);
|
||||
HPDF_CheckError (&pdf->error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = HPDF_Array_Add (iccentry, icc );
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Array_Free(iccentry);
|
||||
return NULL;
|
||||
}
|
||||
return iccentry;
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_OutputIntent)
|
||||
HPDF_LoadIccProfileFromFile (HPDF_Doc pdf,
|
||||
const char* icc_file_name,
|
||||
int numcomponent)
|
||||
{
|
||||
HPDF_Stream iccdata;
|
||||
HPDF_OutputIntent iccentry;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_LoadIccProfileFromFile\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return NULL;
|
||||
|
||||
/* create file stream */
|
||||
iccdata = HPDF_FileReader_New (pdf->mmgr, icc_file_name);
|
||||
|
||||
if (HPDF_Stream_Validate (iccdata)) {
|
||||
iccentry = HPDF_ICC_LoadIccFromMem(pdf, pdf->mmgr, iccdata, pdf->xref, numcomponent);
|
||||
} else
|
||||
iccentry = NULL;
|
||||
|
||||
/* destroy file stream */
|
||||
if (iccdata)
|
||||
HPDF_Stream_Free (iccdata);
|
||||
|
||||
if (!iccentry)
|
||||
HPDF_CheckError (&pdf->error);
|
||||
|
||||
return iccentry;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.3 >> -- hpdf_doc_png.c
|
||||
* << Haru Free PDF Library >> -- hpdf_doc_png.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -24,6 +27,46 @@ LoadPngImageFromStream (HPDF_Doc pdf,
|
||||
HPDF_Stream imagedata,
|
||||
HPDF_BOOL delayed_loading);
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadPngImageFromMem (HPDF_Doc pdf,
|
||||
const HPDF_BYTE *buffer,
|
||||
HPDF_UINT size)
|
||||
{
|
||||
HPDF_Stream imagedata;
|
||||
HPDF_Image image;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_LoadPngImageFromFile\n"));
|
||||
|
||||
if (!HPDF_HasDoc (pdf)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* create file stream */
|
||||
imagedata = HPDF_MemStream_New (pdf->mmgr, size);
|
||||
|
||||
if (!HPDF_Stream_Validate (imagedata)) {
|
||||
HPDF_RaiseError (&pdf->error, HPDF_INVALID_STREAM, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (HPDF_Stream_Write (imagedata, buffer, size) != HPDF_OK) {
|
||||
HPDF_Stream_Free (imagedata);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
image = LoadPngImageFromStream (pdf, imagedata, HPDF_FALSE);
|
||||
|
||||
/* destroy file stream */
|
||||
HPDF_Stream_Free (imagedata);
|
||||
|
||||
if (!image) {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
}
|
||||
|
||||
return image;
|
||||
|
||||
}
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_Image)
|
||||
HPDF_LoadPngImageFromFile (HPDF_Doc pdf,
|
||||
@ -81,8 +124,10 @@ HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf,
|
||||
if (imagedata)
|
||||
HPDF_Stream_Free (imagedata);
|
||||
|
||||
if (!image)
|
||||
if (!image) {
|
||||
HPDF_CheckError (&pdf->error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* add file-name to image dictionary as a hidden entry.
|
||||
* it is used when the image data is needed.
|
||||
@ -103,7 +148,7 @@ HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf,
|
||||
return image;
|
||||
}
|
||||
|
||||
#ifndef HPDF_NOPNGLIB
|
||||
#ifndef LIBHPDF_HAVE_NOPNGLIB
|
||||
static HPDF_Image
|
||||
LoadPngImageFromStream (HPDF_Doc pdf,
|
||||
HPDF_Stream imagedata,
|
||||
@ -129,9 +174,11 @@ LoadPngImageFromStream (HPDF_Doc pdf,
|
||||
HPDF_BOOL delayed_loading)
|
||||
{
|
||||
HPDF_SetError (&pdf->error, HPDF_UNSUPPORTED_FUNC, 0);
|
||||
HPDF_UNUSED (delayed_loading);
|
||||
HPDF_UNUSED (imagedata);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* HPDF_NOPNGLIB */
|
||||
#endif /* LIBHPDF_HAVE_NOPNGLIB */
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encoder.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder.c
|
||||
*
|
||||
* Copyright (c) 1999-2004 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -1094,7 +1097,7 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_STANDARD[] = {
|
||||
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
|
||||
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x00D1, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
@ -1129,9 +1132,9 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_WIN_ANSI[] = {
|
||||
0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
|
||||
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
||||
0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178,
|
||||
0x0000, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
|
||||
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x0000, 0x00AE, 0x00AF,
|
||||
0x02DA, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
|
||||
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
|
||||
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
|
||||
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
|
||||
0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
|
||||
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
|
||||
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
|
||||
@ -1156,21 +1159,21 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_MAC_ROMAN[] = {
|
||||
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
|
||||
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x0000,
|
||||
0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x0000, 0x00D6, 0x00DC, 0x00E1,
|
||||
0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1,
|
||||
0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
|
||||
0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3,
|
||||
0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC,
|
||||
0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF,
|
||||
0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x0000, 0x00C6, 0x00D8,
|
||||
0x0000, 0x00B1, 0x0000, 0x0000, 0x00A5, 0x00B5, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x00AA, 0x00BA, 0x0000, 0x00E6, 0x00F8,
|
||||
0x00BF, 0x00A1, 0x00AC, 0x0000, 0x0192, 0x0000, 0x0000, 0x00AB,
|
||||
0x00BB, 0x2026, 0x0020, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153,
|
||||
0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x0000,
|
||||
0x00FF, 0x0178, 0x2044, 0x00A4, 0x2039, 0x203A, 0xFB01, 0xFB02,
|
||||
0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8,
|
||||
0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211,
|
||||
0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8,
|
||||
0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB,
|
||||
0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153,
|
||||
0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA,
|
||||
0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02,
|
||||
0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1,
|
||||
0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4,
|
||||
0x0000, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC,
|
||||
0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC,
|
||||
0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7
|
||||
};
|
||||
|
||||
@ -2232,6 +2235,7 @@ HPDF_BasicEncoder_New (HPDF_MMgr mmgr,
|
||||
encoder->error = mmgr->error;
|
||||
encoder->type = HPDF_ENCODER_TYPE_SINGLE_BYTE;
|
||||
encoder->to_unicode_fn = HPDF_BasicEncoder_ToUnicode;
|
||||
encoder->encode_text_fn = NULL;
|
||||
encoder->write_fn = HPDF_BasicEncoder_Write;
|
||||
encoder->free_fn = HPDF_BasicEncoder_Free;
|
||||
|
||||
@ -2478,11 +2482,11 @@ HPDF_BasicEncoder_Write (HPDF_Encoder encoder,
|
||||
const char* char_name =
|
||||
HPDF_UnicodeToGryphName (attr->unicode_map[i]);
|
||||
|
||||
ptmp = HPDF_IToA (ptmp, i, tmp + HPDF_TMP_BUF_SIZ - 1);
|
||||
ptmp = HPDF_IToA (ptmp, i, tmp + HPDF_TEXT_DEFAULT_LEN - 1);
|
||||
*ptmp++ = ' ';
|
||||
*ptmp++ = '/';
|
||||
ptmp = HPDF_StrCpy (ptmp, char_name, tmp +
|
||||
HPDF_TMP_BUF_SIZ - 1);
|
||||
ptmp = (char *)HPDF_StrCpy (ptmp, char_name, tmp +
|
||||
HPDF_TEXT_DEFAULT_LEN - 1);
|
||||
*ptmp++ = ' ';
|
||||
*ptmp = 0;
|
||||
|
||||
@ -2517,7 +2521,7 @@ HPDF_Encoder_Validate (HPDF_Encoder encoder)
|
||||
|
||||
HPDF_Encoder
|
||||
HPDF_CMapEncoder_New (HPDF_MMgr mmgr,
|
||||
char *name,
|
||||
char *name,
|
||||
HPDF_Encoder_Init_Func init_fn)
|
||||
{
|
||||
HPDF_Encoder encoder;
|
||||
@ -2573,7 +2577,7 @@ HPDF_CMapEncoder_InitAttr (HPDF_Encoder encoder)
|
||||
|
||||
for (i = 0; i <= 255; i++) {
|
||||
for (j = 0; j <= 255; j++) {
|
||||
/* undefined characters are replaced to square */
|
||||
/* undefined charactors are replaced to square */
|
||||
encoder_attr->unicode_map[i][j] = 0x25A1;
|
||||
}
|
||||
}
|
||||
@ -2602,8 +2606,8 @@ HPDF_UNICODE
|
||||
HPDF_CMapEncoder_ToUnicode (HPDF_Encoder encoder,
|
||||
HPDF_UINT16 code)
|
||||
{
|
||||
HPDF_BYTE l = code;
|
||||
HPDF_BYTE h = code >> 8;
|
||||
HPDF_BYTE l = (HPDF_BYTE)code;
|
||||
HPDF_BYTE h = (HPDF_BYTE)(code >> 8);
|
||||
HPDF_CMapEncoderAttr attr = (HPDF_CMapEncoderAttr)encoder->attr;
|
||||
|
||||
return attr->unicode_map[l][h];
|
||||
@ -2614,15 +2618,14 @@ HPDF_UINT16
|
||||
HPDF_CMapEncoder_ToCID (HPDF_Encoder encoder,
|
||||
HPDF_UINT16 code)
|
||||
{
|
||||
HPDF_BYTE l = code;
|
||||
HPDF_BYTE h = code >> 8;
|
||||
HPDF_BYTE l = (HPDF_BYTE)code;
|
||||
HPDF_BYTE h = (HPDF_BYTE)(code >> 8);
|
||||
|
||||
HPDF_CMapEncoderAttr attr = (HPDF_CMapEncoderAttr)encoder->attr;
|
||||
|
||||
return attr->cid_map[l][h];
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HPDF_CMapEncoder_Free (HPDF_Encoder encoder)
|
||||
{
|
||||
@ -2674,6 +2677,8 @@ HPDF_CMapEncoder_Write (HPDF_Encoder encoder,
|
||||
HPDF_Stream out)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_UNUSED (out);
|
||||
HPDF_UNUSED (encoder);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -2686,6 +2691,7 @@ HPDF_Encoder_SetParseText (HPDF_Encoder encoder,
|
||||
HPDF_UINT len)
|
||||
{
|
||||
HPDF_PTRACE ((" HPDF_CMapEncoder_SetParseText\n"));
|
||||
HPDF_UNUSED (encoder);
|
||||
|
||||
state->text = text;
|
||||
state->index = 0;
|
||||
@ -2745,20 +2751,26 @@ HPDF_CMapEncoder_AddCMap (HPDF_Encoder encoder,
|
||||
HPDF_PTRACE ((" HPDF_CMapEncoder_AddCMap\n"));
|
||||
|
||||
/* Copy specified pdf_cid_range array to fRangeArray. */
|
||||
while (range->from != 0xffff && range->to != 0xffff) {
|
||||
HPDF_UINT16 code = range->from;
|
||||
HPDF_UINT16 cid = range->cid;
|
||||
HPDF_CidRange_Rec *prange;
|
||||
HPDF_STATUS ret;
|
||||
while (range->from != 0xffff || range->to != 0xffff) {
|
||||
HPDF_CidRange_Rec *prange;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
while (code <= range->to) {
|
||||
HPDF_BYTE l = code;
|
||||
HPDF_BYTE h = code >> 8;
|
||||
/*
|
||||
* Only if we have the default to_unicode_fn
|
||||
*/
|
||||
if (encoder->to_unicode_fn == HPDF_CMapEncoder_ToUnicode) {
|
||||
HPDF_UINT16 code = range->from;
|
||||
HPDF_UINT16 cid = range->cid;
|
||||
|
||||
attr->cid_map[l][h] = cid;
|
||||
code++;
|
||||
cid++;
|
||||
}
|
||||
while (code <= range->to) {
|
||||
HPDF_BYTE l = code;
|
||||
HPDF_BYTE h = code >> 8;
|
||||
|
||||
attr->cid_map[l][h] = cid;
|
||||
code++;
|
||||
cid++;
|
||||
}
|
||||
}
|
||||
|
||||
prange = HPDF_GetMem (encoder->mmgr, sizeof(HPDF_CidRange_Rec));
|
||||
if (!prange)
|
||||
@ -2840,8 +2852,8 @@ HPDF_CMapEncoder_SetUnicodeArray (HPDF_Encoder encoder,
|
||||
|
||||
if (array != NULL)
|
||||
while (array->unicode != 0xffff) {
|
||||
HPDF_BYTE l = array->code;
|
||||
HPDF_BYTE h = array->code >> 8;
|
||||
HPDF_BYTE l = (HPDF_BYTE)array->code;
|
||||
HPDF_BYTE h = (HPDF_BYTE)(array->code >> 8);
|
||||
attr->unicode_map[l][h] = array->unicode;
|
||||
array++;
|
||||
}
|
||||
@ -2943,7 +2955,7 @@ HPDF_Encoder_GetByteType (HPDF_Encoder encoder,
|
||||
if (encoder->type != HPDF_ENCODER_TYPE_DOUBLE_BYTE)
|
||||
return HPDF_BYTE_TYPE_SINGLE;
|
||||
|
||||
HPDF_Encoder_SetParseText (encoder, &parse_state, text, index + 1);
|
||||
HPDF_Encoder_SetParseText (encoder, &parse_state, (HPDF_BYTE *)text, index + 1);
|
||||
|
||||
for (;;) {
|
||||
btype = HPDF_CMapEncoder_ByteType (encoder, &parse_state);
|
||||
@ -2988,4 +3000,3 @@ HPDF_Encoder_GetWritingMode (HPDF_Encoder encoder)
|
||||
|
||||
return HPDF_WMODE_HORIZONTAL;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encoder_cns.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder_cns.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -36074,6 +36077,7 @@ static HPDF_BOOL
|
||||
GBK_EUC_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return ((b >= 0x81 && b <= 0xfe));
|
||||
}
|
||||
|
||||
@ -36082,6 +36086,7 @@ static HPDF_BOOL
|
||||
GBK_EUC_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0x40 && b <= 0xfe);
|
||||
}
|
||||
|
||||
@ -36197,6 +36202,7 @@ static HPDF_BOOL
|
||||
GB_EUC_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0xa1 && b <= 0xfe);
|
||||
}
|
||||
|
||||
@ -36205,6 +36211,7 @@ static HPDF_BOOL
|
||||
GB_EUC_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0xa1 && b <= 0xfe);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encoder_cnt.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder_cnt.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -15155,6 +15158,7 @@ static HPDF_BOOL
|
||||
ETen_B5_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return ((b >= 0x81 && b <= 0xfe));
|
||||
}
|
||||
|
||||
@ -15163,6 +15167,7 @@ static HPDF_BOOL
|
||||
ETen_B5_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0x40 && b <= 0xfe);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encoder_jp.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder_jp.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -15769,6 +15772,7 @@ static HPDF_BOOL
|
||||
RKSJ_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return ((b >= 0x81 && b <= 0x9f) || (b >= 0xe0 && b <= 0xfc));
|
||||
}
|
||||
|
||||
@ -15777,6 +15781,7 @@ static HPDF_BOOL
|
||||
RKSJ_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0x40 && b <= 0xfc && b != 0x7f);
|
||||
}
|
||||
|
||||
@ -15950,6 +15955,7 @@ static HPDF_BOOL
|
||||
EUC_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return ((b >= 0xa1 && b <= 0xfe) || b == 0x8e);
|
||||
}
|
||||
|
||||
@ -15958,6 +15964,7 @@ static HPDF_BOOL
|
||||
EUC_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0xa0 && b <= 0xfe);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encoder_kr.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder_kr.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -27639,6 +27642,7 @@ static HPDF_BOOL
|
||||
KSCms_UHC_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0x81 && b <= 0xFE);
|
||||
}
|
||||
|
||||
@ -27647,6 +27651,7 @@ static HPDF_BOOL
|
||||
KSCms_UHC_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0x41 && b <= 0xfe);
|
||||
}
|
||||
|
||||
@ -27804,6 +27809,7 @@ static HPDF_BOOL
|
||||
KSC_EUC_IsLeadByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0xa1 && b <= 0xfe);
|
||||
}
|
||||
|
||||
@ -27812,6 +27818,7 @@ static HPDF_BOOL
|
||||
KSC_EUC_IsTrialByte (HPDF_Encoder encoder,
|
||||
HPDF_BYTE b)
|
||||
{
|
||||
HPDF_UNUSED (encoder);
|
||||
return (b >= 0xa0 && b <= 0xfe);
|
||||
}
|
||||
|
||||
|
276
PDF/src/hpdf_encoder_utf.c
Normal file
276
PDF/src/hpdf_encoder_utf.c
Normal file
@ -0,0 +1,276 @@
|
||||
/*
|
||||
* << Haru Free PDF Library >> -- hpdf_encoder_utf.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2008 Antony Dovgal <tony@daylessday.org>
|
||||
* Copyright (c) 2010 Sergey Konovalov <webmaster@crynet.ru>
|
||||
* Copyright (c) 2011 Koen Deforche <koen@emweb.be>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hpdf_conf.h"
|
||||
#include "hpdf_utils.h"
|
||||
#include "hpdf_encoder.h"
|
||||
#include "hpdf.h"
|
||||
|
||||
typedef struct _UTF8_EncoderAttr_Rec *UTF8_EncoderAttr;
|
||||
typedef struct _UTF8_EncoderAttr_Rec {
|
||||
HPDF_BYTE current_byte;
|
||||
HPDF_BYTE end_byte;
|
||||
HPDF_BYTE utf8_bytes[8];
|
||||
} UTF8_EncoderAttr_Rec;
|
||||
|
||||
static const HPDF_CidRange_Rec UTF8_NOTDEF_RANGE = {0x0000, 0x001F, 1};
|
||||
static const HPDF_CidRange_Rec UTF8_SPACE_RANGE = {0x0000, 0xFFFF, 0};
|
||||
static const HPDF_CidRange_Rec UTF8_CID_RANGE[] = {
|
||||
{ 0x0000, 0xFFFF, 0x0 },
|
||||
{ 0xFFFF, 0xFFFF, 0x0 }
|
||||
};
|
||||
|
||||
static HPDF_ByteType
|
||||
UTF8_Encoder_ByteType_Func (HPDF_Encoder encoder,
|
||||
HPDF_ParseText_Rec *state);
|
||||
|
||||
static HPDF_UNICODE
|
||||
UTF8_Encoder_ToUnicode_Func (HPDF_Encoder encoder,
|
||||
HPDF_UINT16 code);
|
||||
|
||||
static char *
|
||||
UTF8_Encoder_EncodeText_Func (HPDF_Encoder encoder,
|
||||
const char *text,
|
||||
HPDF_UINT len,
|
||||
HPDF_UINT *length);
|
||||
|
||||
static HPDF_STATUS
|
||||
UTF8_Init (HPDF_Encoder encoder);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*
|
||||
* This function is taken from hpdf_encoder_utf8.c, originally submitted
|
||||
* to libharu by 'Mirco'
|
||||
*/
|
||||
static HPDF_ByteType
|
||||
UTF8_Encoder_ByteType_Func (HPDF_Encoder encoder,
|
||||
HPDF_ParseText_Rec *state)
|
||||
{
|
||||
// This function is supposed to increment state->index
|
||||
// Not logical ! (look at function HPDF_String_Write in hpdf_string.c)
|
||||
|
||||
// When HPDF_BYTE_TYPE_SINGLE is returned, the current byte is the
|
||||
// CODE argument in call ToUnicode_Func
|
||||
// When HPDF_BYTE_TYPE_LEAD is returned, the current byte (msb) and the
|
||||
// next byte (lsb) is the CODE arguement in call ToUnicodeFunc
|
||||
// When HPDF_BYTE_TYPE_TRIAL is returned, the current byte is ignored
|
||||
|
||||
HPDF_CMapEncoderAttr encoder_attr;
|
||||
HPDF_BYTE byte;
|
||||
UTF8_EncoderAttr utf8_attr;
|
||||
|
||||
encoder_attr = (HPDF_CMapEncoderAttr) encoder->attr;
|
||||
utf8_attr = (UTF8_EncoderAttr) ((void *)encoder_attr->cid_map[0]);
|
||||
|
||||
if (state->index == 0) {
|
||||
//First byte, initialize.
|
||||
HPDF_PTRACE ((" UTF8_Encoder_ByteType_Func - Initialize: (%u) %s\n",
|
||||
state->len, state->text));
|
||||
|
||||
utf8_attr->current_byte = 0;
|
||||
}
|
||||
|
||||
byte = state->text[state->index];
|
||||
state->index++;
|
||||
|
||||
HPDF_PTRACE ((" UTF8_Encoder_ByteType_Func - Byte: %hx\n", byte));
|
||||
|
||||
if (utf8_attr->current_byte == 0) {
|
||||
utf8_attr->utf8_bytes[0] = byte;
|
||||
utf8_attr->current_byte = 1;
|
||||
|
||||
if (!(byte & 0x80)) {
|
||||
utf8_attr->current_byte = 0;
|
||||
utf8_attr->end_byte = 0;
|
||||
return HPDF_BYTE_TYPE_SINGLE;
|
||||
}
|
||||
|
||||
if ((byte & 0xf8) == 0xf0)
|
||||
utf8_attr->end_byte = 3;
|
||||
else if ((byte & 0xf0) == 0xe0)
|
||||
utf8_attr->end_byte = 2;
|
||||
else if ((byte & 0xe0) == 0xc0)
|
||||
utf8_attr->end_byte = 1;
|
||||
else
|
||||
utf8_attr->current_byte = 0; //ERROR, skip this byte
|
||||
} else {
|
||||
utf8_attr->utf8_bytes[utf8_attr->current_byte] = byte;
|
||||
if (utf8_attr->current_byte == utf8_attr->end_byte) {
|
||||
utf8_attr->current_byte = 0;
|
||||
return HPDF_BYTE_TYPE_SINGLE;
|
||||
}
|
||||
|
||||
utf8_attr->current_byte++;
|
||||
}
|
||||
|
||||
return HPDF_BYTE_TYPE_TRIAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is taken from hpdf_encoder_utf8.c, originally submitted
|
||||
* to libharu by 'Mirco'
|
||||
*/
|
||||
static HPDF_UNICODE
|
||||
UTF8_Encoder_ToUnicode_Func (HPDF_Encoder encoder,
|
||||
HPDF_UINT16 code)
|
||||
{
|
||||
// Supposed to convert CODE to unicode.
|
||||
// This function is allways called after ByteType_Func.
|
||||
// ByteType_Func recognizes the utf-8 bytes belonging to one character.
|
||||
|
||||
HPDF_CMapEncoderAttr encoder_attr;
|
||||
UTF8_EncoderAttr utf8_attr;
|
||||
unsigned int val;
|
||||
|
||||
encoder_attr = (HPDF_CMapEncoderAttr) encoder->attr;
|
||||
utf8_attr = (UTF8_EncoderAttr) ((void *)encoder_attr->cid_map[0]);
|
||||
|
||||
switch (utf8_attr->end_byte) {
|
||||
case 3:
|
||||
val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0x7) << 18) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[1]) << 12) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[2] & 0x3f) << 6) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[3] & 0x3f));
|
||||
break;
|
||||
case 2:
|
||||
val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0xf) << 12) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[1] & 0x3f) << 6) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[2] & 0x3f));
|
||||
break;
|
||||
case 1:
|
||||
val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0x1f) << 6) +
|
||||
(unsigned int) ((utf8_attr->utf8_bytes[1] & 0x3f));
|
||||
break;
|
||||
case 0:
|
||||
val = (unsigned int) utf8_attr->utf8_bytes[0];
|
||||
break;
|
||||
default:
|
||||
val = 32; // Unknown character
|
||||
}
|
||||
|
||||
if (val > 65535) //Convert everything outside UCS-2 to space
|
||||
val = 32;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static char *
|
||||
UTF8_Encoder_EncodeText_Func (HPDF_Encoder encoder,
|
||||
const char *text,
|
||||
HPDF_UINT len,
|
||||
HPDF_UINT *length)
|
||||
{
|
||||
char *result = malloc(len * 2);
|
||||
char *c = result;
|
||||
HPDF_ParseText_Rec parse_state;
|
||||
HPDF_UINT i;
|
||||
|
||||
HPDF_Encoder_SetParseText (encoder, &parse_state,
|
||||
(const HPDF_BYTE *)text, len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
HPDF_UNICODE tmp_unicode;
|
||||
HPDF_ByteType btype = HPDF_Encoder_ByteType (encoder, &parse_state);
|
||||
|
||||
if (btype != HPDF_BYTE_TYPE_TRIAL) {
|
||||
tmp_unicode = HPDF_Encoder_ToUnicode (encoder, 0);
|
||||
|
||||
HPDF_UInt16Swap (&tmp_unicode);
|
||||
HPDF_MemCpy ((HPDF_BYTE *)c, (const HPDF_BYTE*)&tmp_unicode, 2);
|
||||
c += 2;
|
||||
}
|
||||
}
|
||||
|
||||
*length = c - result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static HPDF_STATUS
|
||||
UTF8_Init (HPDF_Encoder encoder)
|
||||
{
|
||||
HPDF_CMapEncoderAttr attr;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
if ((ret = HPDF_CMapEncoder_InitAttr (encoder)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* We override these two
|
||||
*/
|
||||
encoder->byte_type_fn = UTF8_Encoder_ByteType_Func;
|
||||
encoder->to_unicode_fn = UTF8_Encoder_ToUnicode_Func;
|
||||
encoder->encode_text_fn = UTF8_Encoder_EncodeText_Func;
|
||||
|
||||
attr = (HPDF_CMapEncoderAttr)encoder->attr;
|
||||
|
||||
if (HPDF_CMapEncoder_AddCMap (encoder, UTF8_CID_RANGE) != HPDF_OK)
|
||||
return encoder->error->error_no;
|
||||
|
||||
if (HPDF_CMapEncoder_AddCodeSpaceRange (encoder, UTF8_SPACE_RANGE)
|
||||
!= HPDF_OK)
|
||||
return encoder->error->error_no;
|
||||
|
||||
if (HPDF_CMapEncoder_AddNotDefRange (encoder, UTF8_NOTDEF_RANGE)
|
||||
!= HPDF_OK)
|
||||
return encoder->error->error_no;
|
||||
|
||||
attr->is_lead_byte_fn = NULL;
|
||||
attr->is_trial_byte_fn = NULL;
|
||||
|
||||
HPDF_StrCpy (attr->registry, "Adobe", attr->registry +
|
||||
HPDF_LIMIT_MAX_NAME_LEN);
|
||||
HPDF_StrCpy (attr->ordering, "Identity-H", attr->ordering +
|
||||
HPDF_LIMIT_MAX_NAME_LEN);
|
||||
attr->suppliment = 0;
|
||||
attr->writing_mode = HPDF_WMODE_HORIZONTAL;
|
||||
|
||||
/* Not sure about this
|
||||
attr->uid_offset = 0;
|
||||
attr->xuid[0] = 0;
|
||||
attr->xuid[1] = 0;
|
||||
attr->xuid[2] = 0;
|
||||
*/
|
||||
|
||||
encoder->type = HPDF_ENCODER_TYPE_DOUBLE_BYTE;
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_UseUTFEncodings (HPDF_Doc pdf)
|
||||
{
|
||||
HPDF_Encoder encoder;
|
||||
HPDF_STATUS ret;
|
||||
|
||||
if (!HPDF_HasDoc (pdf))
|
||||
return HPDF_INVALID_DOCUMENT;
|
||||
|
||||
encoder = HPDF_CMapEncoder_New (pdf->mmgr, "UTF-8",
|
||||
UTF8_Init);
|
||||
|
||||
if ((ret = HPDF_Doc_RegisterEncoder (pdf, encoder)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
/*
|
||||
* << Haru Free PDF Library 2.0.0 >> -- hpdf_encryor.c
|
||||
* << Haru Free PDF Library >> -- hpdf_encryor.c
|
||||
*
|
||||
* URL: http://libharu.org
|
||||
*
|
||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
@ -314,13 +317,13 @@ HPDF_PadOrTrancatePasswd (const char *pwd,
|
||||
|
||||
HPDF_MemSet (new_pwd, 0x00, HPDF_PASSWD_LEN);
|
||||
|
||||
if (len >= HPDF_PASSWD_LEN)
|
||||
HPDF_MemCpy (new_pwd, pwd, HPDF_PASSWD_LEN);
|
||||
else {
|
||||
if (len > 0)
|
||||
HPDF_MemCpy (new_pwd, pwd, len);
|
||||
HPDF_MemCpy (new_pwd + len, HPDF_PADDING_STRING,
|
||||
HPDF_PASSWD_LEN - len);
|
||||
if (len >= HPDF_PASSWD_LEN) {
|
||||
HPDF_MemCpy (new_pwd, (HPDF_BYTE *)pwd, HPDF_PASSWD_LEN);
|
||||
} else {
|
||||
if (len > 0) {
|
||||
HPDF_MemCpy (new_pwd, (HPDF_BYTE *)pwd, len);
|
||||
}
|
||||
HPDF_MemCpy (new_pwd + len, HPDF_PADDING_STRING, HPDF_PASSWD_LEN - len);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +368,7 @@ HPDF_Encrypt_CreateOwnerKey (HPDF_Encrypt attr)
|
||||
for (i = 0; i < 50; i++) {
|
||||
HPDF_MD5Init(&md5_ctx);
|
||||
|
||||
//HPDF_MD5Update (&md5_ctx, digest, HPDF_MD5_KEY_LEN);
|
||||
/* HPDF_MD5Update (&md5_ctx, digest, HPDF_MD5_KEY_LEN); */
|
||||
HPDF_MD5Update (&md5_ctx, digest, attr->key_len);
|
||||
HPDF_MD5Final(digest, &md5_ctx);
|
||||
|
||||
@ -395,7 +398,7 @@ HPDF_Encrypt_CreateOwnerKey (HPDF_Encrypt attr)
|
||||
HPDF_BYTE new_key[HPDF_MD5_KEY_LEN];
|
||||
|
||||
for (j = 0; j < attr->key_len; j++)
|
||||
new_key[j] = digest[j] ^ i;
|
||||
new_key[j] = (HPDF_BYTE)(digest[j] ^ i);
|
||||
|
||||
HPDF_PTRACE(("@ Algorithm 3.3 step 7 loop %u\n", i));
|
||||
|
||||
@ -429,10 +432,10 @@ HPDF_Encrypt_CreateEncryptionKey (HPDF_Encrypt attr)
|
||||
|
||||
/* Algorithm3.2 step4 */
|
||||
HPDF_PTRACE(("@@@ permission =%d\n", attr->permission));
|
||||
tmp_flg[0] = attr->permission;
|
||||
tmp_flg[1] = (attr->permission >> 8);
|
||||
tmp_flg[2] = (attr->permission >> 16);
|
||||
tmp_flg[3] = (attr->permission >> 24);
|
||||
tmp_flg[0] = (HPDF_BYTE)(attr->permission);
|
||||
tmp_flg[1] = (HPDF_BYTE)(attr->permission >> 8);
|
||||
tmp_flg[2] = (HPDF_BYTE)(attr->permission >> 16);
|
||||
tmp_flg[3] = (HPDF_BYTE)(attr->permission >> 24);
|
||||
|
||||
HPDF_MD5Update(&md5_ctx, tmp_flg, 4);
|
||||
|
||||
@ -499,7 +502,7 @@ HPDF_Encrypt_CreateUserKey (HPDF_Encrypt attr)
|
||||
HPDF_PTRACE(("@ Algorithm 3.5 step 5 loop %u\n", i));
|
||||
|
||||
for (j = 0; j < attr->key_len; j++)
|
||||
new_key[j] = attr->encryption_key[j] ^ i;
|
||||
new_key[j] = (HPDF_BYTE)(attr->encryption_key[j] ^ i);
|
||||
|
||||
HPDF_MemCpy (digest, digest2, HPDF_MD5_KEY_LEN);
|
||||
|
||||
@ -526,7 +529,7 @@ ARC4Init (HPDF_ARC4_Ctx_Rec *ctx,
|
||||
HPDF_PTRACE((" ARC4Init\n"));
|
||||
|
||||
for (i = 0; i < HPDF_ARC4_BUF_SIZE; i++)
|
||||
ctx->state[i] = i;
|
||||
ctx->state[i] = (HPDF_BYTE)i;
|
||||
|
||||
for (i = 0; i < HPDF_ARC4_BUF_SIZE; i++)
|
||||
tmp_array[i] = key[i % key_len];
|
||||
@ -561,8 +564,8 @@ ARC4CryptBuf (HPDF_ARC4_Ctx_Rec *ctx,
|
||||
for (i = 0; i < len; i++) {
|
||||
HPDF_BYTE tmp;
|
||||
|
||||
ctx->idx1 = (ctx->idx1 + 1) % 256;
|
||||
ctx->idx2 = (ctx->idx2 + ctx->state[ctx->idx1]) % 256;
|
||||
ctx->idx1 = (HPDF_BYTE)((ctx->idx1 + 1) % 256);
|
||||
ctx->idx2 = (HPDF_BYTE)((ctx->idx2 + ctx->state[ctx->idx1]) % 256);
|
||||
|
||||
tmp = ctx->state[ctx->idx1];
|
||||
ctx->state[ctx->idx1] = ctx->state[ctx->idx2];
|
||||
@ -571,7 +574,7 @@ ARC4CryptBuf (HPDF_ARC4_Ctx_Rec *ctx,
|
||||
t = (ctx->state[ctx->idx1] + ctx->state[ctx->idx2]) % 256;
|
||||
K = ctx->state[t];
|
||||
|
||||
out[i] = in[i] ^ K;
|
||||
out[i] = (HPDF_BYTE)(in[i] ^ K);
|
||||
}
|
||||
}
|
||||
|
||||
@ -586,11 +589,11 @@ HPDF_Encrypt_InitKey (HPDF_Encrypt attr,
|
||||
|
||||
HPDF_PTRACE((" HPDF_Encrypt_Init\n"));
|
||||
|
||||
attr->encryption_key[attr->key_len] = object_id;
|
||||
attr->encryption_key[attr->key_len + 1] = (object_id >> 8);
|
||||
attr->encryption_key[attr->key_len + 2] = (object_id >> 16);
|
||||
attr->encryption_key[attr->key_len + 3] = gen_no;
|
||||
attr->encryption_key[attr->key_len + 4] = (gen_no >> 8);
|
||||
attr->encryption_key[attr->key_len] = (HPDF_BYTE)object_id;
|
||||
attr->encryption_key[attr->key_len + 1] = (HPDF_BYTE)(object_id >> 8);
|
||||
attr->encryption_key[attr->key_len + 2] = (HPDF_BYTE)(object_id >> 16);
|
||||
attr->encryption_key[attr->key_len + 3] = (HPDF_BYTE)gen_no;
|
||||
attr->encryption_key[attr->key_len + 4] = (HPDF_BYTE)(gen_no >> 8);
|
||||
|
||||
HPDF_PTRACE(("@@@ OID=%u, gen_no=%u\n", (HPDF_INT)object_id, gen_no));
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user