Skip to content

Additional features #87

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 78 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6816ba7
add new docx table celll and border style features and update templaa…
anush735 Dec 20, 2024
2558bdb
add {remove?} feature to remove the added shape completely when the t…
anush735 Dec 24, 2024
3ec7eed
add new pdf option convert_to_pdfa for generating PDF/A format and up…
anush735 Dec 25, 2024
c24f7b1
add option to addd custom text to signature field
anush735 Dec 25, 2024
a8edf10
add new option watermark_rotation for pdf config
anush735 Dec 26, 2024
a5c3b4a
add new option to provide start of the page number in output config
anush735 Dec 26, 2024
03a3336
add new option to hide pptx slides
anush735 Dec 27, 2024
6b48a39
add new options in autolink and hyperlink tags to provide font_color …
anush735 Dec 30, 2024
26c494a
add feature to attach files in pdf and updated output options to retr…
anush735 Dec 30, 2024
806a1e6
add _distribute option to distribute the data evenly among the column…
anush735 Dec 30, 2024
c41bdd4
add preserve_tag_style option for hyperlink and autolink
anush735 Dec 31, 2024
cd797d5
add new option for xlsx cell style property
anush735 Dec 31, 2024
0a82907
add new option for html property
anush735 Dec 31, 2024
63915e6
add option to update table of content of word document
anush735 Jan 2, 2025
eb8d7f8
add new option to insert barcode in pdf config
anush735 Jan 2, 2025
efd715c
add new options firstSliceAngle and holeSize in chart options for dop…
anush735 Jan 2, 2025
460029e
add new chart option enableAreaTransparency for Area Chart
anush735 Jan 2, 2025
6277a63
add new chart types AreaStacked and LineStacked chart
anush735 Jan 2, 2025
1ef961d
update documentation and examples
anush735 Jan 6, 2025
d7860c5
refectore and update documentation
anush735 Jan 6, 2025
c1551ce
refactore code to add new classes for autolink and hyperlink options
anush735 Jan 6, 2025
fa6a318
update documentation
anush735 Jan 6, 2025
bfa3479
refactor constructor of pdf config and update documentation
anush735 Jan 7, 2025
85437af
add pdf include feature and test
prabinbessie Apr 18, 2025
fdf50a1
added compare files feature and test
prabinbessie Apr 18, 2025
95994c1
add change locale with test
prabinbessie Apr 18, 2025
843374a
Add PDF annotation feature with tests for PDFComment and PDFComments
prabinbessie Apr 21, 2025
561a286
Add Password Encryption Feature with Test
prabinbessie Apr 25, 2025
39ca78c
Add Merge Cells on Tabular Looping with example
prabinbessie Apr 28, 2025
f39f23f
PDF Forms using Form Tag
prabinbessie Apr 29, 2025
d87a7ff
Add density on Image Tag Options
prabinbessie May 2, 2025
a98aeee
Add Output to Directory now supports return_output
prabinbessie May 6, 2025
88b3ced
Add Data Batching with test
prabinbessie May 6, 2025
ecf2b49
fix: return value
prabinbessie May 7, 2025
f3c0e7b
Add Transformation Function with example
prabinbessie May 9, 2025
d061142
Test Fix
prabinbessie May 9, 2025
2630153
Docs Upadted For Density
prabinbessie May 13, 2025
56ac682
Updated PptxAutolink : where now constructor have name and value othe…
prabinbessie May 13, 2025
2104fcb
Renamed :From ( Remove -> PptxShapeRemove)
prabinbessie May 13, 2025
17bcd2d
Updated PptxHyperlink : where now constructor have name and Url othe…
prabinbessie May 13, 2025
9364aac
Updated _distribute to ForEachInline class and added example
prabinbessie May 14, 2025
c822e83
Updated Example for Distribute
prabinbessie May 15, 2025
a35a95c
Docs Upadted
prabinbessie May 15, 2025
84bda61
fix: only include wrap_text in CellStyleXlsx output when true
prabinbessie May 19, 2025
e2a79a8
fix : set the distribute when true and fixed the example with its act…
prabinbessie May 20, 2025
0f513d8
Merged PptxAutilink with AutoLink
prabinbessie May 20, 2025
6247eba
Merged : PptxHyperlink with HyperLink
prabinbessie May 20, 2025
0c9ef21
Docs : Fixed for HyperLink Preservetag
prabinbessie May 21, 2025
7c0d796
change signature for printjob
prabinbessie May 21, 2025
f106425
Modified HideSlide : supports {hide condition}
prabinbessie May 21, 2025
ce6531a
Removed duplicate test
prabinbessie May 21, 2025
8e76df2
Path updated
prabinbessie May 22, 2025
c1a10af
add examples for lineStacked and areaStacked
prabinbessie May 23, 2025
bf84484
Add Example for ImageTag
prabinbessie May 26, 2025
a03c717
Add example for Htmltag
prabinbessie May 26, 2025
3391170
Add Example for PageBreak
prabinbessie May 26, 2025
9888b71
Add example for Markdown Tag
prabinbessie May 27, 2025
41374dd
Path Update
prabinbessie May 27, 2025
16ec8a0
Add Example for Table Of Content Tag
prabinbessie May 27, 2025
01b06eb
Add Example for Attach And Embed Tag
prabinbessie May 28, 2025
a881739
add example for Encryption
prabinbessie May 28, 2025
fbcefa1
Add example for Uncertain Loop
prabinbessie May 28, 2025
3a22f4f
Add example for horizontal loop
prabinbessie May 28, 2025
d68d724
Refactor Loop Example
prabinbessie May 29, 2025
345d7c4
Add example For Slide Loop
prabinbessie May 29, 2025
8962d0c
Add Example For Sheet Loop
prabinbessie May 29, 2025
8d8408b
Add Example For Label tag
prabinbessie May 29, 2025
272e8b7
Add HideSheet
prabinbessie May 30, 2025
fe9601e
Add Example For Span Tag
prabinbessie May 30, 2025
f519d10
Add example For Pptx Shape Remove
prabinbessie May 30, 2025
48020dc
Add Example for Raw Tag
prabinbessie May 30, 2025
d51ae07
Add Example For HideSlide
prabinbessie Jun 2, 2025
0de68f8
Add Exmaple For SheetProtection
prabinbessie Jun 2, 2025
2589d3e
add Exmple For Codes(Bar code ,Qrcode For Xml
prabinbessie Jun 2, 2025
77ebe10
Add Example for Hyperlink Autolink Image Insert tag In PPTX
prabinbessie Jun 3, 2025
ea81a39
Refactor IncludePdf and test
prabinbessie Jun 4, 2025
7bfdcaf
Add Example for PdfInclude
prabinbessie Jun 4, 2025
5931a99
Add Build script
prabinbessie Jun 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added BeginerGuide/Loop/data/label_temp.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/data/loop_template.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/data/shhet_temp.xlsx
Binary file not shown.
Binary file added BeginerGuide/Loop/data/slide_temp.pptx
Binary file not shown.
Binary file added BeginerGuide/Loop/data/tem.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/data/un_loop.docx
Binary file not shown.
63 changes: 63 additions & 0 deletions BeginerGuide/Loop/merge_loop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import sys
sys.path.insert(0, "PATH_TO_COP_DIR")
import cloudofficeprint as cop


data = cop.elements.ElementCollection("data")

eng_emp1 = cop.elements.ElementCollection.from_mapping({
"name": "John Smith",
"project": "Website Redesign",
"status": "In Progress"
})

eng_emp2 = cop.elements.ElementCollection.from_mapping({
"name": "Emily Johnson",
"project": "API Development",
"status": "Completed"
})

eng_emp3 = cop.elements.ElementCollection.from_mapping({
"name": "Michael Brown",
"project": "Mobile App",
"status": "Planning"
})

mkt_emp1 = cop.elements.ElementCollection.from_mapping({
"name": "Sarah Wilson",
"project": "Brand Campaign",
"status": "In Progress"
})

mkt_emp2 = cop.elements.ElementCollection.from_mapping({
"name": "David Thompson",
"project": "Market Research",
"status": "Not Started"
})

engineering_dept = cop.elements.ElementCollection.from_mapping({
"department": "Engineering"
})
engineering_dept.add(cop.elements.ForEachMergeCells("employees", [eng_emp1, eng_emp2, eng_emp3]))

marketing_dept = cop.elements.ElementCollection.from_mapping({
"department": "Marketing"
})
marketing_dept.add(cop.elements.ForEachMergeCells("employees", [mkt_emp1, mkt_emp2]))

departments = cop.elements.ForEachMergeCells("departments", [engineering_dept, marketing_dept])

data.add(departments)

server = cop.config.Server(
"http://localhost:8010/"
)
# Create print job
# PrintJob combines template, data, server and an optional output configuration
printjob = cop.PrintJob(
data=data,
server=server,
template=cop.Resource.from_local_file("./data/tem.docx"),
)
response = printjob.execute()
response.to_file("./output/output.docx")
Binary file added BeginerGuide/Loop/output/label_output.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/output/output.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/output/output.pptx
Binary file not shown.
Binary file added BeginerGuide/Loop/output/output_loop.docx
Binary file not shown.
Binary file added BeginerGuide/Loop/output/sheet_output.xlsx
Binary file not shown.
Binary file added BeginerGuide/Loop/output/uncertain_loop.docx
Binary file not shown.
65 changes: 65 additions & 0 deletions BeginerGuide/Loop/usingLabel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import sys
sys.path.insert(0,"PATH_TO_COP_DIR")
import cloudofficeprint as cop

# Create main collection
collection = cop.elements.ElementCollection()

# Create elements for the labels
element1 = cop.elements.ElementCollection.from_mapping(
{
"FirstName": "John",
"LastName": "Smith",
"Company": "Tech Solutions Inc.",
"Address1": "123 Business Ave",
"City": "San Francisco",
"State": "CA",
"PostalCode": "94105"
}
)
element2 = cop.elements.ElementCollection.from_mapping(
{
"FirstName": "Sarah",
"LastName": "Johnson",
"Company": "Marketing Pro LLC",
"Address1": "456 Market Street",
"City": "New York",
"State": "NY",
"PostalCode": "10013"
}
)
element3 = cop.elements.ElementCollection.from_mapping(
{
"FirstName": "Michael",
"LastName": "Brown",
"Company": "Digital Services Co.",
"Address1": "789 Innovation Blvd",
"City": "Chicago",
"State": "IL",
"PostalCode": "60601"
}
)

loopLabel = cop.elements.loops.Labels(
name="labels",
content=[element1, element2, element3]
)
# Add the loop to the main collection
collection.add(loopLabel)

# Server
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key="YOUR_API_KEY")
)

# Create print job
printjob = cop.PrintJob(
data=collection,
server=server,
template=cop.Resource.from_local_file("./data/label_temp.docx")
)

# Execute and save the output
response = printjob.execute()
response.to_file("./output/label_output.docx")
55 changes: 55 additions & 0 deletions BeginerGuide/Loop/usingLoop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import sys
sys.path.insert(0,"PATH_TO_COP_DIR")
import cloudofficeprint as cop

# Create main collection
collection = cop.elements.ElementCollection()

# Create elements for the loop
element1 = cop.elements.ElementCollection.from_mapping(
{
"a": 1,
"b": 2,
"c": 3
}
)

element2 = cop.elements.ElementCollection.from_mapping(
{
"a": 4,
"b": 5,
"c": 6
}
)

# Create loop
loop = cop.elements.loops.ForEachInline(
name="loop_name",
content=[element1, element2]
)

# Add loop to collection
collection.add(loop)

# Server configuration
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key="YOUR_API_KEY")
)

# Create print job with output type specified
# For running on localhost you do not need api_key else replace below "YOUR_API_KEY" with your api key.
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key = "YOUR_API_KEY")
)
# Create print job
# PrintJob combines template, data, server and an optional output configuration
printjob = cop.PrintJob(
data=collection,
server=server,
template=cop.Resource.from_local_file("./data/loop_template.docx"),
)
# Execute and save
response = printjob.execute()
response.to_file("./output/output_loop.docx")
68 changes: 68 additions & 0 deletions BeginerGuide/Loop/usingSheetLoop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import sys
sys.path.insert(0,"PATH_TO_COP_DIR")
import cloudofficeprint as cop

# Create main collection
collection = cop.elements.ElementCollection()

# Create elements for customer invoices
element1 = cop.elements.ElementCollection.from_mapping(
{
"cust_first_name": "John",
"cust_last_name": "Smith",
"orders": [
{"order_name": "Office Supplies", "order_total": "$525.00"},
{"order_name": "Electronics", "order_total": "$1,299.99"},
{"order_name": "Furniture", "order_total": "$2,450.00"}
]
}
)

element2 = cop.elements.ElementCollection.from_mapping(
{
"cust_first_name": "Sarah",
"cust_last_name": "Johnson",
"orders": [
{"order_name": "Software License", "order_total": "$899.00"},
{"order_name": "IT Support", "order_total": "$750.00"}
]
}
)

element3 = cop.elements.ElementCollection.from_mapping(
{
"cust_first_name": "Michael",
"cust_last_name": "Brown",
"orders": [
{"order_name": "Marketing Services", "order_total": "$3,500.00"},
{"order_name": "Training Materials", "order_total": "$450.00"},
{"order_name": "Cloud Storage", "order_total": "$199.99"}
]
}
)

# Create sheet loop
loop = cop.elements.loops.ForEachSheet(
name="customers",
content=[element1, element2, element3]
)

# Add loop to collection
collection.add(loop)

# Server configuration
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key="YOUR_API_KEY")
)

# Create print job
printjob = cop.PrintJob(
data=collection,
server=server,
template=cop.Resource.from_local_file("./data/shhet_temp.xlsx")
)

# Execute and save
response = printjob.execute()
response.to_file("./output/sheet_output.xlsx")
61 changes: 61 additions & 0 deletions BeginerGuide/Loop/usingSlideLoop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import sys
sys.path.insert(0,"PATH_TO_COP_DIR")
import cloudofficeprint as cop

# Create main collection
collection = cop.elements.ElementCollection()

# Create elements for the loop
element1 = cop.elements.ElementCollection.from_mapping(
{
"a": "Sales Report Q1",
"b": "Total Revenue: $125,000",
"c": "Growth: 15% YoY"
}
)
element2 = cop.elements.ElementCollection.from_mapping(
{
"a": "Marketing Metrics Q1",
"b": "New Customers: 2,500",
"c": "Campaign ROI: 225%"
}
)
element3 = cop.elements.ElementCollection.from_mapping(
{
"a": "Product Performance Q1",
"b": "Units Sold: 45,000",
"c": "Customer Satisfaction: 4.8/5"
}
)
element4 = cop.elements.ElementCollection.from_mapping(
{
"a": "Support Analytics Q1",
"b": "Tickets Resolved: 3,200",
"c": "Average Response Time: 2.5h"
}
)

#slide loop
loop = cop.elements.loops.ForEachSlide(
name="slideloop",
content=[element1, element2, element3, element4]
)
# Add the loop to the main collection
collection.add(loop)

# Server
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key="YOUR_API_KEY")
)

# Create print job
printjob = cop.PrintJob(
data=collection,
server=server,
template=cop.Resource.from_local_file("./Loop/data/slide_temp.pptx")
)

# Execute and save the output
response = printjob.execute()
response.to_file("./Loop/output/output")
49 changes: 49 additions & 0 deletions BeginerGuide/Loop/usingUncertainLoop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import sys
sys.path.insert(0,"PATH_TO_COP_DIR")
import cloudofficeprint as cop

# Create main collection
collection = cop.elements.ElementCollection()

# Create products data
products = [
{"prod_name": "Business Shirt", "category": "Mens"},
{"prod_name": "Trousers", "category": "Mens"},
{"prod_name": "Jacket", "category": "Mens"},
{"prod_name": "Blouse", "category": "Womens"},
{"prod_name": "Skirt", "category": "Womens"},
{"prod_name": "Ladies Shoes", "category": "Womens"},
{"prod_name": "Belt", "category": "Accessories"},
{"prod_name": "Bag", "category": "Accessories"},
{"prod_name": "Mens Shoes", "category": "Mens"},
{"prod_name": "Wallet", "category": "Accessories"}
]

#elements for each product item
product_elements = []
for product in products:
element_collection = cop.elements.ElementCollection()
element_collection.add(cop.elements.Property("prod_name", product["prod_name"]))
element_collection.add(cop.elements.Property("category", product["category"]))
product_elements.append(element_collection)

#ForEach loop
collection.add(cop.elements.ForEach(name="products", content=product_elements))

# Server configuration
server = cop.config.Server(
"http://localhost:8010/",
cop.config.ServerConfig(api_key="YOUR_API_KEY")
)

# Create print job
template = cop.Resource.from_local_file("./data/un_loop.docx")
printjob = cop.PrintJob(
data=collection,
server=server,
template=template
)

# Execute and save
response = printjob.execute()
response.to_file("./output/uncertain_loop.docx")
Binary file added BeginerGuide/Transformation/data/template.docx
Binary file not shown.
Binary file added BeginerGuide/Transformation/output/output.pdf
Binary file not shown.
Loading