move upgraded PDF from 1.8

This commit is contained in:
Alex Fabijanic 2017-12-19 12:13:03 +01:00
parent 864b69b950
commit bb044f6f95
165 changed files with 8195 additions and 1287 deletions

View File

@ -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 ()

View File

@ -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 \

View File

@ -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

View File

@ -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"/>

View File

@ -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>

View File

@ -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"/>

View File

@ -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>

View File

@ -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"/>

View File

@ -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>

View File

@ -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"/>

View File

@ -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
View 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" }

View File

@ -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);
@ -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.
@ -291,7 +294,7 @@ public:
/// 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

View File

@ -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)

View File

@ -34,6 +34,9 @@ namespace Poco {
namespace PDF {
class Document;
class PDF_API Page
/// A Page represents a PDF page object.
{
@ -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.
@ -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.
@ -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);
@ -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);

View File

@ -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 */

View File

@ -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 */

View 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 */

View File

@ -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);

View File

@ -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);

View File

@ -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>
/*----------------------------------------------------------------------------*/

View 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

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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,

View 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 */

View File

@ -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,

View File

@ -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;

View File

@ -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 */

View File

@ -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,

View File

@ -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 */

View File

@ -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,

View File

@ -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,

View File

@ -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,

View 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 */

View File

@ -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
}

View File

@ -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,

View File

@ -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,

View File

@ -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,

View 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

View File

@ -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,

View File

@ -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 --------------------------------------------------------*/
@ -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 */

View 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 */

View File

@ -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 */

View 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

View File

@ -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.
*/

View File

@ -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.
*/

BIN
PDF/samples/Image/Image.pdf Normal file

Binary file not shown.

View File

@ -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 =

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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"

Binary file not shown.

BIN
PDF/samples/Text/Text.pdf Normal file

Binary file not shown.

View File

@ -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 =

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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
View 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" }

View File

@ -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;

View File

@ -36,9 +36,7 @@ Document::Document(const std::string fileName,
_pRawData(0),
_size(0)
{
compression(COMPRESSION_ALL);
for (Poco::UInt32 i = 0; i < pageCount; ++i)
addPage(pageSize, orientation);
init(pageCount, pageSize, orientation);
}
@ -49,9 +47,7 @@ Document::Document(Poco::UInt32 pageCount,
_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)
@ -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);
embed ? HPDF_TRUE : HPDF_FALSE);
}
else
throw InvalidArgumentException("Invalid font index.");

View File

@ -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())
@ -112,7 +140,7 @@ const Destination& Page::createDestination(const std::string& name)
if (_destinations.end() != it)
throw InvalidArgumentException("Destination already exists.");
Destination dest(_pPDF, HPDF_Page_CreateDestination(_page), name);
Destination dest(&_pDocument->handle(), HPDF_Page_CreateDestination(_page), name);
std::pair<DestinationContainer::iterator, bool> ret =
_destinations.insert(DestinationContainer::value_type(name, dest));
@ -131,7 +159,7 @@ const TextAnnotation& Page::createTextAnnotation(const std::string& name,
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);
@ -152,7 +180,7 @@ const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
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 =
@ -172,7 +200,7 @@ const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
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 =

View File

@ -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
View 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;
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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 */

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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
View 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;
}

View File

@ -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));

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.5 >> -- hpdf_encryptdict.c
* << Haru Free PDF Library >> -- hpdf_encryptdict.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,7 @@
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
* 2006.09.04 modified.
*---------------------------------------------------------------------------*/
*/
#include <time.h>
#include "hpdf_conf.h"
@ -19,10 +21,9 @@
#include "hpdf_objects.h"
#include "hpdf_encryptdict.h"
#include "hpdf_info.h"
/*---------------------------------------------------------------------------*/
/*------ HPDF_EncryptDict ---------------------------------------------------*/
#ifndef HPDF_UNUSED
#define HPDF_UNUSED(a) ((void)(a))
#endif
HPDF_EncryptDict
HPDF_EncryptDict_New (HPDF_MMgr mmgr,
@ -67,13 +68,15 @@ HPDF_EncryptDict_CreateID (HPDF_EncryptDict dict,
/* use the result of 'time' function to get random value.
* when debugging, 'time' value is ignored.
*/
#ifndef HPDF_DEBUG
#ifndef LIBHPDF_DEBUG
time_t t = HPDF_TIME (NULL);
#endif /* HPDF_DEBUG */
#endif /* LIBHPDF_DEBUG */
HPDF_MD5Init (&ctx);
HPDF_UNUSED (xref);
HPDF_UNUSED (info);
#ifndef HPDF_DEBUG
#ifndef LIBHPDF_DEBUG
HPDF_MD5Update(&ctx, (HPDF_BYTE *)&t, sizeof(t));
/* create File Identifier from elements of Into dictionary. */

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_error.c
* << Haru Free PDF Library >> -- hpdf_error.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,6 +19,7 @@
#include "hpdf_utils.h"
#include "hpdf_error.h"
#include "hpdf_consts.h"
#include "hpdf.h"
#ifndef HPDF_STDCALL
#ifdef HPDF_DLL_MAKE
@ -80,7 +84,7 @@ HPDF_SetError (HPDF_Error error,
}
HPDF_STATUS
HPDF_EXPORT(HPDF_STATUS)
HPDF_CheckError (HPDF_Error error)
{
HPDF_PTRACE((" HPDF_CheckError: error_no=0x%04X detail_no=0x%04X\n",

69
PDF/src/hpdf_exdata.c Normal file
View File

@ -0,0 +1,69 @@
/*
* << 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_exdata.h"
#include "hpdf.h"
/*----------------------------------------------------------------------------*/
/*------ HPDF_ExData -----------------------------------------------------*/
HPDF_ExData
HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
HPDF_Xref xref)
{
HPDF_ExData exdata;
HPDF_STATUS ret = HPDF_OK;
HPDF_PTRACE((" HPDF_ExData_New\n"));
exdata = HPDF_Dict_New (mmgr);
if (!exdata)
return NULL;
if (HPDF_Xref_Add (xref, exdata) != HPDF_OK)
return NULL;
ret += HPDF_Dict_AddName (exdata, "Type", "ExData");
ret += HPDF_Dict_AddName (exdata, "Subtype", "3DM");
if (ret != HPDF_OK)
return NULL;
return exdata;
}
HPDF_EXPORT(HPDF_STATUS)
HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata,
HPDF_3DMeasure measure)
{
HPDF_STATUS ret = HPDF_OK;
ret = HPDF_Dict_Add (exdata, "M3DREF", measure);
if (ret != HPDF_OK)
return ret;
return ret;
}

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_ext_gstate.c
* << Haru Free PDF Library >> -- hpdf_ext_gstate.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,
@ -17,7 +20,7 @@
#include "hpdf_ext_gstate.h"
#include "hpdf.h"
const static char *HPDF_BM_NAMES[] = {
static const char * const HPDF_BM_NAMES[] = {
"Normal",
"Multiply",
"Screen",

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.3 >> -- hpdf_font.c
* << Haru Free PDF Library >> -- hpdf_font.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,7 +13,6 @@
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
* 2006.07.25 modified.
*/
#include "hpdf_conf.h"

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.3 >> -- hpdf_font_cid.c
* << Haru Free PDF Library >> -- hpdf_font_cid.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,7 +13,6 @@
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
* 2006.08.04 modified MeasureText().
*/
#include "hpdf_conf.h"
@ -46,10 +48,16 @@ MeasureText (HPDF_Font font,
static char*
UINT16ToHex (char *s,
HPDF_UINT16 val,
char *eptr);
UINT16ToHex (char *s,
HPDF_UINT16 val,
char *eptr,
HPDF_BYTE width);
static char *
CidRangeToHex (char *s,
HPDF_UINT16 from,
HPDF_UINT16 to,
char *eptr);
static HPDF_Dict
CreateCMap (HPDF_Encoder encoder,
@ -130,12 +138,31 @@ HPDF_Type0Font_New (HPDF_MMgr mmgr,
if (fontdef->type == HPDF_FONTDEF_TYPE_CID) {
ret += HPDF_Dict_AddName (font, "Encoding", encoder->name);
} else {
attr->cmap_stream = CreateCMap (encoder, xref);
/*
* Handle the Unicode encoding, see hpdf_encoding_utf.c For some
* reason, xpdf-based readers cannot deal with our cmap but work
* fine when using the predefined "Identity-H"
* encoding. However, text selection does not work, unless we
* add a ToUnicode cmap. This CMap should also be "Identity",
* but that does not work -- specifying our cmap as a stream however
* does work. Who can understand that ?
*/
if (HPDF_StrCmp(encoder_attr->ordering, "Identity-H") == 0) {
ret += HPDF_Dict_AddName (font, "Encoding", "Identity-H");
attr->cmap_stream = CreateCMap (encoder, xref);
if (attr->cmap_stream) {
ret += HPDF_Dict_Add (font, "Encoding", attr->cmap_stream);
} else
return NULL;
if (attr->cmap_stream) {
ret += HPDF_Dict_Add (font, "ToUnicode", attr->cmap_stream);
} else
return NULL;
} else {
attr->cmap_stream = CreateCMap (encoder, xref);
if (attr->cmap_stream) {
ret += HPDF_Dict_Add (font, "Encoding", attr->cmap_stream);
} else
return NULL;
}
}
if (ret != HPDF_OK)
@ -357,9 +384,9 @@ CIDFontType2_New (HPDF_Font parent, HPDF_Xref xref)
if (HPDF_Dict_Add (font, "DW2", array) != HPDF_OK)
return NULL;
ret += HPDF_Array_AddNumber (array, fontdef->font_bbox.bottom);
ret += HPDF_Array_AddNumber (array, fontdef->font_bbox.bottom -
fontdef->font_bbox.top);
ret += HPDF_Array_AddNumber (array, (HPDF_INT32)(fontdef->font_bbox.bottom));
ret += HPDF_Array_AddNumber (array, (HPDF_INT32)(fontdef->font_bbox.bottom -
fontdef->font_bbox.top));
HPDF_MemSet (tmp_map, 0, sizeof(HPDF_UNICODE) * 65536);
@ -370,15 +397,25 @@ CIDFontType2_New (HPDF_Font parent, HPDF_Xref xref)
HPDF_UINT j;
for (j = 0; j < 256; j++) {
HPDF_UINT16 cid = encoder_attr->cid_map[i][j];
if (cid != 0) {
HPDF_UNICODE unicode = encoder_attr->unicode_map[i][j];
HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef, unicode);
tmp_map[cid] = gid;
if (max < cid)
max = cid;
}
}
if (encoder->to_unicode_fn == HPDF_CMapEncoder_ToUnicode) {
HPDF_UINT16 cid = encoder_attr->cid_map[i][j];
if (cid != 0) {
HPDF_UNICODE unicode = encoder_attr->unicode_map[i][j];
HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef,
unicode);
tmp_map[cid] = gid;
if (max < cid)
max = cid;
}
} else {
HPDF_UNICODE unicode = (i << 8) | j;
HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef,
unicode);
tmp_map[unicode] = gid;
if (max < unicode)
max = unicode;
}
}
}
if (max > 0) {
@ -399,14 +436,14 @@ CIDFontType2_New (HPDF_Font parent, HPDF_Xref xref)
if (w != dw) {
if (!tmp_array) {
if ((ret = HPDF_Array_AddNumber (array, i)) != HPDF_OK)
if (HPDF_Array_AddNumber (array, i) != HPDF_OK)
return NULL;
tmp_array = HPDF_Array_New (font->mmgr);
if (!tmp_array)
return NULL;
if ((ret = HPDF_Array_Add (array, tmp_array)) != HPDF_OK)
if (HPDF_Array_Add (array, tmp_array) != HPDF_OK)
return NULL;
}
@ -422,16 +459,15 @@ CIDFontType2_New (HPDF_Font parent, HPDF_Xref xref)
if (!attr->map_stream)
return NULL;
if ((ret = HPDF_Dict_Add (font, "CIDToGIDMap", attr->map_stream))
!= HPDF_OK)
if (HPDF_Dict_Add (font, "CIDToGIDMap", attr->map_stream) != HPDF_OK)
return NULL;
for (i = 0; i < max; i++) {
HPDF_BYTE u[2];
HPDF_UINT16 gid = tmp_map[i];
u[0] = gid >> 8;
u[1] = gid;
u[0] = (HPDF_BYTE)(gid >> 8);
u[1] = (HPDF_BYTE)gid;
HPDF_MemCpy ((HPDF_BYTE *)(tmp_map + i), u, 2);
}
@ -567,14 +603,14 @@ TextWidth (HPDF_Font font,
(HPDF_CIDFontDefAttr)attr->fontdef->attr;
dw2 = cid_fontdef_attr->DW2[1];
} else {
dw2 = attr->fontdef->font_bbox.bottom -
attr->fontdef->font_bbox.top;
dw2 = (HPDF_INT)(attr->fontdef->font_bbox.bottom -
attr->fontdef->font_bbox.top);
}
HPDF_Encoder_SetParseText (encoder, &parse_state, text, len);
while (i < len) {
HPDF_ByteType btype = HPDF_CMapEncoder_ByteType (encoder, &parse_state);
HPDF_ByteType btype = (encoder->byte_type_fn)(encoder, &parse_state);
HPDF_UINT16 cid;
HPDF_UNICODE unicode;
HPDF_UINT16 code;
@ -585,7 +621,7 @@ TextWidth (HPDF_Font font,
if (btype == HPDF_BYTE_TYPE_LEAD) {
code <<= 8;
code += *text;
code = (HPDF_UINT16)(code + *text);
}
if (btype != HPDF_BYTE_TYPE_TRIAL) {
@ -596,7 +632,7 @@ TextWidth (HPDF_Font font,
w = HPDF_CIDFontDef_GetCIDWidth (attr->fontdef, cid);
} else {
/* unicode-based font */
unicode = HPDF_CMapEncoder_ToUnicode (encoder, code);
unicode = (encoder->to_unicode_fn)(encoder, code);
w = HPDF_TTFontDef_GetCharWidth (attr->fontdef, unicode);
}
} else {
@ -652,8 +688,8 @@ MeasureText (HPDF_Font font,
(HPDF_CIDFontDefAttr)attr->fontdef->attr;
dw2 = cid_fontdef_attr->DW2[1];
} else {
dw2 = attr->fontdef->font_bbox.bottom -
attr->fontdef->font_bbox.top;
dw2 = (HPDF_INT)(attr->fontdef->font_bbox.bottom -
attr->fontdef->font_bbox.top);
}
HPDF_Encoder_SetParseText (encoder, &parse_state, text, len);
@ -668,7 +704,7 @@ MeasureText (HPDF_Font font,
if (btype == HPDF_BYTE_TYPE_LEAD) {
code <<= 8;
code += b2;
code = (HPDF_UINT16)(code + b2);
}
if (!wordwrap) {
@ -687,7 +723,8 @@ MeasureText (HPDF_Font font,
tmp_len = i + 1;
if (real_width)
*real_width = w;
} else
} /* else
//Commenting this out fixes problem with HPDF_Text_Rect() splitting the words
if (last_btype == HPDF_BYTE_TYPE_TRIAL ||
(btype == HPDF_BYTE_TYPE_LEAD &&
last_btype == HPDF_BYTE_TYPE_SINGLE)) {
@ -696,7 +733,7 @@ MeasureText (HPDF_Font font,
if (real_width)
*real_width = w;
}
}
}*/
}
if (HPDF_IS_WHITE_SPACE(b)) {
@ -711,19 +748,19 @@ MeasureText (HPDF_Font font,
tmp_w = HPDF_CIDFontDef_GetCIDWidth (attr->fontdef, cid);
} else {
/* unicode-based font */
unicode = HPDF_CMapEncoder_ToUnicode (encoder, code);
unicode = (encoder->to_unicode_fn)(encoder, code);
tmp_w = HPDF_TTFontDef_GetCharWidth (attr->fontdef,
unicode);
}
} else {
tmp_w = -dw2;
tmp_w = (HPDF_UINT16)(-dw2);
}
if (i > 0)
w += char_space;
}
w += (HPDF_DOUBLE)tmp_w * font_size / 1000;
w += (HPDF_REAL)((HPDF_DOUBLE)tmp_w * font_size / 1000);
/* 2006.08.04 break when it encountered line feed */
if (w > width || b == 0x0A)
@ -743,10 +780,12 @@ MeasureText (HPDF_Font font,
}
static char*
UINT16ToHex (char *s,
HPDF_UINT16 val,
char *eptr)
UINT16ToHex (char *s,
HPDF_UINT16 val,
char *eptr,
HPDF_BYTE width)
{
HPDF_BYTE b[2];
HPDF_UINT16 val2;
@ -763,7 +802,14 @@ UINT16ToHex (char *s,
*s++ = '<';
if (b[0] != 0) {
/*
* In principle a range of <00> - <1F> can now not be
* distinguished from <0000> - <001F>..., this seems something
* that is wrong with CID ranges. For the UCS-2 encoding we need
* to add <0000> - <FFFF> and this cannot be <00> - <FFFF> (or at
* least, that crashes Mac OSX Preview).
*/
if (width == 2) {
c = b[0] >> 4;
if (c <= 9)
c += 0x30;
@ -771,7 +817,7 @@ UINT16ToHex (char *s,
c += 0x41 - 10;
*s++ = c;
c = b[0] & 0x0f;
c = (char)(b[0] & 0x0f);
if (c <= 9)
c += 0x30;
else
@ -779,14 +825,14 @@ UINT16ToHex (char *s,
*s++ = c;
}
c = b[1] >> 4;
c = (char)(b[1] >> 4);
if (c <= 9)
c += 0x30;
else
c += 0x41 - 10;
*s++ = c;
c = b[1] & 0x0f;
c = (char)(b[1] & 0x0f);
if (c <= 9)
c += 0x30;
else
@ -799,6 +845,21 @@ UINT16ToHex (char *s,
return s;
}
static char*
CidRangeToHex (char *s,
HPDF_UINT16 from,
HPDF_UINT16 to,
char *eptr)
{
HPDF_BYTE width = (to > 255) ? 2 : 1;
char *pbuf;
pbuf = UINT16ToHex (s, from, eptr, width);
*pbuf++ = ' ';
pbuf = UINT16ToHex (pbuf, to, eptr, width);
return pbuf;
}
static HPDF_Dict
CreateCMap (HPDF_Encoder encoder,
@ -843,17 +904,17 @@ CreateCMap (HPDF_Encoder encoder,
ret += HPDF_Stream_WriteStr (cmap->stream,
"%%IncludeResource: ProcSet (CIDInit)\r\n");
pbuf = HPDF_StrCpy (buf, "%%BeginResource: CMap (", eptr);
pbuf = HPDF_StrCpy (pbuf, encoder->name, eptr);
pbuf = (char *)HPDF_StrCpy (buf, "%%BeginResource: CMap (", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, encoder->name, eptr);
HPDF_StrCpy (pbuf, ")\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
pbuf = HPDF_StrCpy (buf, "%%Title: (", eptr);
pbuf = HPDF_StrCpy (pbuf, encoder->name, eptr);
pbuf = (char *)HPDF_StrCpy (buf, "%%Title: (", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, encoder->name, eptr);
*pbuf++ = ' ';
pbuf = HPDF_StrCpy (pbuf, attr->registry, eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, attr->registry, eptr);
*pbuf++ = ' ';
pbuf = HPDF_StrCpy (pbuf, attr->ordering, eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, attr->ordering, eptr);
*pbuf++ = ' ';
pbuf = HPDF_IToA (pbuf, attr->suppliment, eptr);
HPDF_StrCpy (pbuf, ")\r\n", eptr);
@ -874,24 +935,24 @@ CreateCMap (HPDF_Encoder encoder,
ret += HPDF_Stream_WriteStr (cmap->stream,
"/CIDSystemInfo 3 dict dup begin\r\n");
pbuf = HPDF_StrCpy (buf, " /Registry (", eptr);
pbuf = HPDF_StrCpy (pbuf, attr->registry, eptr);
pbuf = (char *)HPDF_StrCpy (buf, " /Registry (", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, attr->registry, eptr);
HPDF_StrCpy (pbuf, ") def\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
pbuf = HPDF_StrCpy (buf, " /Ordering (", eptr);
pbuf = HPDF_StrCpy (pbuf, attr->ordering, eptr);
pbuf = (char *)HPDF_StrCpy (buf, " /Ordering (", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, attr->ordering, eptr);
HPDF_StrCpy (pbuf, ") def\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
pbuf = HPDF_StrCpy (buf, " /Supplement ", eptr);
pbuf = (char *)HPDF_StrCpy (buf, " /Supplement ", eptr);
pbuf = HPDF_IToA (pbuf, attr->suppliment, eptr);
pbuf = HPDF_StrCpy (pbuf, " def\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, " def\r\n", eptr);
HPDF_StrCpy (pbuf, "end def\r\n\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
pbuf = HPDF_StrCpy (buf, "/CMapName /", eptr);
pbuf = HPDF_StrCpy (pbuf, encoder->name, eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/CMapName /", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, encoder->name, eptr);
HPDF_StrCpy (pbuf, " def\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
@ -899,13 +960,13 @@ CreateCMap (HPDF_Encoder encoder,
ret += HPDF_Stream_WriteStr (cmap->stream, "/CMapType 1 def\r\n\r\n");
if (attr->uid_offset >= 0) {
pbuf = HPDF_StrCpy (buf, "/UIDOffset ", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/UIDOffset ", eptr);
pbuf = HPDF_IToA (pbuf, attr->uid_offset, eptr);
HPDF_StrCpy (pbuf, " def\r\n\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
}
pbuf = HPDF_StrCpy (buf, "/XUID [", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/XUID [", eptr);
pbuf = HPDF_IToA (pbuf, attr->xuid[0], eptr);
*pbuf++ = ' ';
pbuf = HPDF_IToA (pbuf, attr->xuid[1], eptr);
@ -914,7 +975,7 @@ CreateCMap (HPDF_Encoder encoder,
HPDF_StrCpy (pbuf, "] def\r\n\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
pbuf = HPDF_StrCpy (buf, "/WMode ", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/WMode ", eptr);
pbuf = HPDF_IToA (pbuf, (HPDF_UINT32)attr->writing_mode, eptr);
HPDF_StrCpy (pbuf, " def\r\n\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
@ -928,9 +989,8 @@ CreateCMap (HPDF_Encoder encoder,
HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->code_space_range,
i);
pbuf = UINT16ToHex (buf, range->from, eptr);
*pbuf++ = ' ';
pbuf = UINT16ToHex (pbuf, range->to, eptr);
pbuf = CidRangeToHex(buf, range->from, range->to, eptr);
HPDF_StrCpy (pbuf, "\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);
@ -952,9 +1012,7 @@ CreateCMap (HPDF_Encoder encoder,
for (i = 0; i < attr->notdef_range->count; i++) {
HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->notdef_range, i);
pbuf = UINT16ToHex (buf, range->from, eptr);
*pbuf++ = ' ';
pbuf = UINT16ToHex (pbuf, range->to, eptr);
pbuf = CidRangeToHex(buf, range->from, range->to, eptr);
*pbuf++ = ' ';
pbuf = HPDF_IToA (pbuf, range->cid, eptr);
HPDF_StrCpy (pbuf, "\r\n", eptr);
@ -983,9 +1041,7 @@ CreateCMap (HPDF_Encoder encoder,
for (i = 0; i < attr->cmap_range->count; i++) {
HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->cmap_range, i);
pbuf = UINT16ToHex (buf, range->from, eptr);
*pbuf++ = ' ';
pbuf = UINT16ToHex (pbuf, range->to, eptr);
pbuf = CidRangeToHex(buf, range->from, range->to, eptr);
*pbuf++ = ' ';
pbuf = HPDF_IToA (pbuf, range->cid, eptr);
HPDF_StrCpy (pbuf, "\r\n", eptr);
@ -994,7 +1050,7 @@ CreateCMap (HPDF_Encoder encoder,
if ((i + 1) %100 == 0) {
phase--;
pbuf = HPDF_StrCpy (buf, "endcidrange\r\n\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "endcidrange\r\n\r\n", eptr);
if (phase > 0)
pbuf = HPDF_IToA (pbuf, 100, eptr);
@ -1011,14 +1067,14 @@ CreateCMap (HPDF_Encoder encoder,
}
if (odd > 0)
pbuf = HPDF_StrCpy (buf, "endcidrange\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "endcidrange\r\n", eptr);
pbuf = HPDF_StrCpy (pbuf, "endcmap\r\n", eptr);
pbuf = HPDF_StrCpy (pbuf, "CMapName currentdict /CMap "
pbuf = (char *)HPDF_StrCpy (pbuf, "endcmap\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, "CMapName currentdict /CMap "
"defineresource pop\r\n", eptr);
pbuf = HPDF_StrCpy (pbuf, "end\r\n", eptr);
pbuf = HPDF_StrCpy (pbuf, "end\r\n\r\n", eptr);
pbuf = HPDF_StrCpy (pbuf, "%%EndResource\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, "end\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, "end\r\n\r\n", eptr);
pbuf = (char *)HPDF_StrCpy (pbuf, "%%EndResource\r\n", eptr);
HPDF_StrCpy (pbuf, "%%EOF\r\n", eptr);
ret += HPDF_Stream_WriteStr (cmap->stream, buf);

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.3 >> -- hpdf_font_tt.c
* << Haru Free PDF Library >> -- hpdf_font_tt.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,
@ -177,6 +180,7 @@ CreateDescriptor (HPDF_Font font)
ret += HPDF_Dict_AddName (descriptor, "Type", "FontDescriptor");
ret += HPDF_Dict_AddNumber (descriptor, "Ascent", def->ascent);
ret += HPDF_Dict_AddNumber (descriptor, "Descent", def->descent);
ret += HPDF_Dict_AddNumber (descriptor, "CapHeight", def->cap_height);
ret += HPDF_Dict_AddNumber (descriptor, "Flags", def->flags);
array = HPDF_Box_Array_New (font->mmgr, def->font_bbox);
@ -244,7 +248,7 @@ CharWidth (HPDF_Font font,
}
HPDF_TextWidth
static HPDF_TextWidth
TextWidth (HPDF_Font font,
const HPDF_BYTE *text,
HPDF_UINT len)
@ -280,7 +284,7 @@ TextWidth (HPDF_Font font,
}
HPDF_UINT
static HPDF_UINT
MeasureText (HPDF_Font font,
const HPDF_BYTE *text,
HPDF_UINT len,
@ -304,14 +308,14 @@ MeasureText (HPDF_Font font,
tmp_len = i + 1;
if (real_width)
*real_width = w;
*real_width = (HPDF_REAL)w;
w += word_space;
} else if (!wordwrap) {
tmp_len = i;
if (real_width)
*real_width = w;
*real_width = (HPDF_REAL)w;
}
w += (HPDF_DOUBLE)CharWidth (font, b) * font_size / 1000;
@ -326,7 +330,7 @@ MeasureText (HPDF_Font font,
/* all of text can be put in the specified width */
if (real_width)
*real_width = w;
*real_width = (HPDF_REAL)w;
return len;
}
@ -402,5 +406,3 @@ OnFree (HPDF_Dict obj)
HPDF_FreeMem (obj->mmgr, attr);
}
}

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.3 >> -- hpdf_font_type1.c
* << Haru Free PDF Library >> -- hpdf_font_type1.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,
@ -330,13 +333,13 @@ Type1Font_OnWrite (HPDF_Dict obj,
if (!fontdef_attr->is_base14font || encoder_attr->has_differences) {
char *pbuf;
pbuf = HPDF_StrCpy (buf, "/FirstChar ", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/FirstChar ", eptr);
pbuf = HPDF_IToA (pbuf, encoder_attr->first_char, eptr);
HPDF_StrCpy (pbuf, "\012", eptr);
if ((ret = HPDF_Stream_WriteStr (stream, buf)) != HPDF_OK)
return ret;
pbuf = HPDF_StrCpy (buf, "/LastChar ", eptr);
pbuf = (char *)HPDF_StrCpy (buf, "/LastChar ", eptr);
pbuf = HPDF_IToA (pbuf, encoder_attr->last_char, eptr);
HPDF_StrCpy (pbuf, "\012", eptr);
if ((ret = HPDF_Stream_WriteStr (stream, buf)) != HPDF_OK)

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_fontdef.c
* << Haru Free PDF Library >> -- hpdf_fontdef.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,

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.1 >> -- HPDF_FontDef_base14.c
* << Haru Free PDF Library >> -- hpdf_fontdef_base14.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,
@ -10,7 +13,6 @@
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
* 2006.07.25 modified.
*/
#include "hpdf_conf.h"

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_fontdef_cid.c
* << Haru Free PDF Library >> -- hpdf_fontdef_cid.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,

View File

@ -1,7 +1,10 @@
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_fontdef_cns.c
* << Haru Free PDF Library >> -- hpdf_fontdef_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,

Some files were not shown because too many files have changed in this diff Show More